Pixel label image has scalar pixel label IDs instead of RGB-triplet pixel label IDs

18 visualizzazioni (ultimi 30 giorni)
Hello,
I am writing a program to perform image segmentation using a deep learning NN, following the example: https://www.mathworks.com/help/vision/ug/semantic-segmentation-using-deep-learning.html
After I execute the Start Training step to train the network, I obtain the following error:
Error using trainNetwork (line 170)
Pixel label image has scalar pixel label IDs instead of RGB-triplet pixel label IDs.
Caused by:
Error using matlab.io.datastore.PixelLabelDatastore.label2cat (line 1087)
Pixel label image has scalar pixel label IDs instead of RGB-triplet pixel label IDs.
I don't understand why I would get this error, as the label IDs in my code are in the same format as the example.
Semantic Segmentation Using Deep Learning
example:
labelIDs = { ...
% "Sky"
[
128 128 128; ... % "Sky"
]
...
My code:
labelIDs = { ...
% "Environment"
[
128 000 000; ... % "Blue"
]
...
I've looked at some of the responses from other's who have asked the same question, and there doesn't seem to be a clear response. Maybe I not seeing it.
Any help would REALLY be appreciated!
  3 Commenti
Sanjana
Sanjana il 7 Apr 2024 alle 11:35
Hi,
Did you find any solution for this, I'm also facing the same issue!!
Please let me know,
Thanks in advance!

Accedi per commentare.

Risposte (2)

Sanjana
Sanjana il 7 Apr 2024 alle 13:04
Hi,
I was getting the same issue but i resolved it.
The problem is with the dataset which you are using. For example, the labelId which you are providing, there must be a mismatch with the labels of orginal RGB image. You can check this by doing imread on the labelled image. So, either change your dataset or change the labelId according to the dataset.

yanqi liu
yanqi liu il 14 Dic 2021
yes,sir,may be change the label datetype
such as
uint8(round([128 000 000]))
ans = 1×3
128 0 0
if possible,may be upload your data mat file to do some analysis

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by