Effacer les filtres
Effacer les filtres

poly2label missing a label

2 vues (au cours des 30 derniers jours)
Federico
Federico le 24 Août 2022
Réponse apportée : Federico le 25 Août 2022
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?

Réponse acceptée

Federico
Federico le 25 Août 2022
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.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by