フィルターのクリア

poly2label missing a label

2 ビュー (過去 30 日間)
Federico
Federico 2022 年 8 月 24 日
回答済み: Federico 2022 年 8 月 25 日
I've tagged an image using Matlab's Image Labeler app and I'm now converting the labeling to a semantic segmentation map following this MathWorks tutorial.
In the Image Labeler, I've identified 9 classes manually, by drawing polygons directly on the image. All the variables derived from the gTruth object do contain those 9 classes (e.g.: polygonLabels, polygonLabelIDs, etc.)...
...but when I generate my semantic segmentation map using poly2labels there's not a single pixel associated with the sixth class. It's there on all the input data, but it disappears in the segmentation map: all the pixels that were within that polygon are labeled as background (i.e.: class 0).
How's that even possible?

採用された回答

Federico
Federico 2022 年 8 月 25 日
I will answer my own question, hoping that it could help someone else having the same issue.
The problem does not lie in poly2labels, but rather in this part of the MathWorks tutorial:
out = gatherLabelData(gTruth,[labelType.Polygon],'GroupLabelData','LabelType')
If one of the labeled class in gTruth has just a single polygon, gatherLabelData fails in recognizing it as such. It instead creates a "polygon" for every vertex, which, of course, won't work in poly2labels.
The only workaround I found at the moment is to create at least two polygons in every class.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by