MATLAB: What should I do so that only gray image converts into binary , not the black backgroung while moving the threshold.

Image Processing Toolboxthresholdthresholding a gray image and converting into binary

Dear Image analyst , I have a gray image ( a selected ROI) displayed in a black background screen. I am trying to use your adjustable threshold method to convert this gray image into binary.while moving the threshold cursor to convert this gray image into binary image , the black background is also changing from black to white and is including into total pixel calculations and in histogram. But I want only my ROI to convert from gray to binary not the background.

Best Answer

Just change your thresholds. Instead of going from 0 to 150, go from 150 to 255. If that's not right, post a screenshot and describe it in more detail.
Related Question