bwareaopen for RGB and binary
조회 수: 3 (최근 30일)
이전 댓글 표시
hi sir, can I know how to use bwareaopen for RGB image. after I convert the rgb image to binary, do I need to put uint8 and [] when displaying the binary images?
[Merged information from duplicate question]
hi sir, may I know how to assign the conversion of rgb to binary. for instance,, I've used this coding but the output is all black,why is that:
%%Binary
im=uint(im)
figure;imshow(im,[])
%%remove pxls less than 100
pixels=100;
detectObject=uint8(bwareaopen,pixels)
figure;imahow(detectObject,[])
댓글 수: 0
답변 (2개)
Image Analyst
2012년 10월 29일
편집: Image Analyst
2012년 10월 30일
That doesn't make sense. You don't use bwareaopen for RGB AND binary. You use it just for binary images.
You do not need to cast binary (logical) images to uint8 or use [] in imshow() for binary images.
Try
binaryImage = im < someThresholdValue;
detectObject = bwareaopen(binaryImage, pixels);
imshow(detectObject);
댓글 수: 5
Image Analyst
2012년 11월 1일
Are you asking us to give advice on your image without showing us your image? How successful do you think we can be in that situation?
Walter Roberson
2012년 10월 29일
bwareaopen() is a function call that you need to apply to your data. You are instead calling it with no parameters, so it would be returning the empty matrix.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!