How to convert specific part of the image into binary form.

조회 수: 2 (최근 30일)
Wei Qing
Wei Qing 2012년 8월 4일
How do i want to convert only the green part to binary image so it will become like tis http://www.freeimagehosting.net/kbkac

답변 (1개)

Image Analyst
Image Analyst 2012년 8월 4일
How about
binaryImage = grayImage > 50; % Or some other value.
  댓글 수: 5
Image Analyst
Image Analyst 2012년 8월 4일
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
Wei Qing 2012년 8월 5일
actually i am using the wide line detector code to get the above image. http://www.mathworks.nl/matlabcentral/fileexchange/35754-wide-line-detector So i modified the codes in huang_usage.m in order to get what i want.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by