Deleting objects from a binary image.
1 回表示 (過去 30 日間)
古いコメントを表示
Hello everyone. I have a binary image with different objects. In the image I want to remove 5th, 13th, and 20th objects. How can I remove it. Thnks.

0 件のコメント
採用された回答
Matthew Eicholtz
2016 年 3 月 21 日
L = bwlabel(bw); %where bw is your binary image
bw2 = bw; %copy of binary image
bw2(L==5) = 0; %deletes the 5th object
2 件のコメント
Image Analyst
2019 年 4 月 18 日
Try my answer below. If that doesn't work, explain more in a new question, and attach your image. And say which blob you want to delete.
その他の回答 (1 件)
Image Analyst
2016 年 3 月 21 日
You can use ismember() to extract the ones you want.
newBinaryImage = ismember(labeledImage, listOfBlobsToKeep) > 0;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!