An object with the biggest amount of scope in the Binary image
이전 댓글 표시
Hello, I have a binary image with n white objects (not connected). How can I leave only the object with the biggest amount of scope in the picture I can do it by - bwareaopen, but in this way I have to know approximate size of an object. sorry for my english. thnx
채택된 답변
추가 답변 (2개)
Adam Filion
2013년 9월 12일
편집: Adam Filion
2013년 9월 12일
If you have Image Processing Toolbox you can use the function regionprops. It comes out to something like this, where tm is the binary image.
cc = bwconncomp(tm);
stats = regionprops(cc,'Area');
A = [stats.Area];
[~,biggest] = max(A);
tm(labelmatrix(cc)~=biggest) = 0;
You can watch a recorded presentation that steps through a similar example here:
댓글 수: 2
Felix
2013년 9월 12일
편집: Image Analyst
2013년 9월 13일
Image Analyst
2013년 9월 13일
편집: Image Analyst
2013년 9월 13일
Sean de Wolski
2013년 9월 17일
0 개 추천
Good timing, I just posted this function a few minutes ago!
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
