Function similar to bwareaopen

6 ビュー (過去 30 日間)
Cristina
Cristina 2011 年 11 月 5 日
Is there any function similar to bwareaopen but to eliminate pixel greater than x?
When I used M3=bwareaopen(M2,250) --> This action eliminates in M2 the region less that 250 area. Bui if I want that the area greater than 8000 will be eliminated. What function can I used?

採用された回答

Sven
Sven 2011 年 11 月 5 日
The following will remove any areas greater than 8000 pixels:
M3 = M2 & ~bwareaopen(M2,8000);
Another option would be to use regionprops() to get the area of every mask and then remove [stats.Area]>8000, but I think the above 1-line solution is cleaner.

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by