Azzera filtri
Azzera filtri

poly2label missing a label

2 visualizzazioni (ultimi 30 giorni)
Federico
Federico il 24 Ago 2022
Risposto: Federico il 25 Ago 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?

Risposta accettata

Federico
Federico il 25 Ago 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.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by