How to make the grey area completely black, so it's a binary image?

3 views (last 30 days)
Tawsif Mostafiz
Tawsif Mostafiz on 16 Apr 2022
Answered: DGM on 16 Apr 2022
Hi, I have a grayscale tumor image like this:
I want to make the grey area complely dark, something like this:
(This is a mask for another image)
so that the white area remailns white, but the grey area goes dark. Is it possible?

Accepted Answer

Tala on 16 Apr 2022
Edited: Tala on 16 Apr 2022
you mean you want to have the whole tumor area white and the rest of the image black? just threshold your image

More Answers (1)

DGM on 16 Apr 2022
The mask that was used to create the hole in the image is the binarized image. You shouldn't need to turn the source image into a copy of the mask.
but if you must:
A = imread('');
A(A<255) = 0;




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!