Warning using bwareafilt: "Some objects were not selected"

7 ビュー (過去 30 日間)
Nut
Nut 2017 年 1 月 20 日
コメント済み: Walter Roberson 2017 年 1 月 20 日
Hi,
I'm using the function bwareafilt to select the twelve largest objects on a binary image. Sometimes, this warning occurs:
Warning: One or more ties for n-th place occurred when selecting objects. Some objects were not selected.
What does it mean, in details? It seems it doesn't affect my processing, I can't observe any visible effect.
And how can I avoid its occurrence?
Thanks for your answers, warm regards.

採用された回答

Anand
Anand 2017 年 1 月 20 日
This typically means there were 2 or more objects with the same area, i.e. a tie. So bwareafilt had to pick some and leave out the rest.
For example, if image BW has 5 objects of areas 10, 15, 15, 20 and 25 and you ask for the 3 largest objects, you will get the warning. This is because only one among the 2 objects with area 15 was picked.
BW = [true(1,10),false,true(1,15),false,true(1,15),false,true(1,20),false,true(1,25)];
BWsel = bwareafilt(BW,3);
  2 件のコメント
Nut
Nut 2017 年 1 月 20 日
Thanks for your answer, it addressed me to investigate the problem.
It's exactly like you wrote, I lost an object. Using bwareafilt, is there a way to avoid this behaviour? I want the n largest objects, including both with the same area. Why to neglect one of them?
Thank you again.
Walter Roberson
Walter Roberson 2017 年 1 月 20 日
After you run the area filter, ask for the area of all of the results, take max and min, and then go back and rerun the area filter using that max and min instead of asking for such and such a number of results.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by