필터 지우기
필터 지우기

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 CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by