how can i remove the white object from binary image
古いコメントを表示
I have a image with my needed object (green) and the noise (white). I want to delete the noise but have no idea for that. anyone can help

採用された回答
その他の回答 (1 件)
Image Analyst
2018 年 4 月 15 日
0 投票
You didn’t say what was unique about the object but it looks like it might be the size of the bounding box. So why don’t you compute that with regionprops()?
2 件のコメント
R G
2018 年 4 月 15 日
Image Analyst
2018 年 4 月 18 日
編集済み: Image Analyst
2018 年 4 月 18 日
Compute the bounding box.
labeledImage = bwlabel(binaryImage);
props = regionprops(labeledImage, 'BoundingBox');
Then decide which ones to keep, like if the width to height ratio is between 0.5 and 3, or whatever.
indexesToKeep = false(1, length(props));
for k = 1 : length(props)
width = props(k).BoundingBox(3);
height = props(k).BoundingBox(4);
if width/height > 0.5 || width/height < 3
% It's a fairly square box, so keep it.
indexesToKeep(k) = true;
end
end
% Extract just acceptable blobs
indexesToKeep = find(indexesToKeep);
binaryImage2 = ismember(labeledImage, indexesToKeep);
imshow(binaryImage2);
カテゴリ
ヘルプ センター および File Exchange で ROI-Based Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
