0

HI all I am new to Matlab Image Processing toolbox, I really cannot decide to use between

im2bw(gray_image, level); 
gray_image < 0.5; ?

for im2bw(gray_image, level); level we can use the the value 0.5 or other value too?

Could anyone please explain me, If I want to Threshold a gray image, which one is better if I want to adjust the threshold level myself ?

If it is the same please kindly tell me thank...

1 Answer 1

2

As the im2bw documentation says:

Specify level in the range [0,1]. This range is relative to the signal levels possible for the image's class. Therefore, a level value of 0.5 is midway between black and white, regardless of class

This makes it slightly more flexible/convenient than image < level; depending on how you obtained the image, the values might be in the range 0-255, in which case your alternative would not give the desired result. Otherwise they are equivalent.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.