How to convert specific part of the image into binary form.
Mostrar comentarios más antiguos
How do i want to convert only the green part to binary image so it will become like tis http://www.freeimagehosting.net/kbkac
Respuestas (1)
Image Analyst
el 4 de Ag. de 2012
How about
binaryImage = grayImage > 50; % Or some other value.
5 comentarios
Wei Qing
el 4 de Ag. de 2012
Image Analyst
el 4 de Ag. de 2012
Yes, that is a binary image. It has type logical. The number says that you want every pixel with pixel value greater than 50 to be 1 (true) or "foreground", and that everything else (darker than 51) will be 0 (false) or "background."
Wei Qing
el 4 de Ag. de 2012
Image Analyst
el 4 de Ag. de 2012
You're welcome. What way did you use? I never use im2bw() because it takes thresholds in the range of 0-1 and I find that very inconvenient. I'd rather pass in a gray level but it's not smart enough for that (yet - I'm going to bring it up with them). Internally im2bw ()does what I did. It just has to convert either the threshold to an actual gray level or convert the image to the range 0-1. But then it has to do the thresholding like I did it.
Wei Qing
el 5 de Ag. de 2012
Categorías
Más información sobre Convert Image Type en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!