MATLAB: How to convert grayscale image to a binary image without using a toolbox function

grayscale to binaryImage Processing Toolbox

I want to create a binary image from a gray scale image, using a specific threshold value of 0.2, but without using im2bw(), which is in the Image Processing Toolbox. How do I do it?

Best Answer

Just threshold:
binaryImage = grayImage > 0.2; % or < or <= or >= (whatever you want).
No toolbox needed.