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

19 次查看(过去 30 天)
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 个评论
Sanjana
Sanjana 2024-4-7,11:35
Hi,
Did you find any solution for this, I'm also facing the same issue!!
Please let me know,
Thanks in advance!

请先登录,再进行评论。

回答(2 个)

Sanjana
Sanjana 2024-4-7,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 2021-12-14
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

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by