フィルターのクリア

Training semantic segmentation on grayscale image gives RGB-Triplet pixel label IDs error

1 回表示 (過去 30 日間)
asdf
asdf 2019 年 5 月 2 日
コメント済み: Curtis Zhang 2021 年 6 月 3 日
However, I am trying to run the code on my set of images with are grayscale instead of rgb
I just tried
imageDir = fullfile(outputDir,'myImages');
labelDir = fullfile(outputDir,'myLabels');
imds = imageDatastore(imageDir);
classNames = ["objects","background"];
labelIDs = [255 0];
pxds = pixelLabelDatastore(labelDir,classNames,labelIDs);
I = read(imds);
C = read(pxds);
But that gives me this error:
Error using matlab.io.datastore.PixelLabelDatastore.label2cat (line
970)
Pixel label image has RGB-triplet pixel label IDs instead of scalar
pixel label IDs.
Error in matlab.io.datastore.PixelLabelDatastore/label2categorical
(line 878)
L =
matlab.io.datastore.PixelLabelDatastore.label2cat(...
Error in matlab.io.datastore.PixelLabelDatastore/read (line 459)
C = this.label2categorical(C, info);
Error in
C = read(pxds);
Why is this?

回答 (1 件)

Alexandre Broc
Alexandre Broc 2019 年 7 月 15 日
Hi, did you find an answer ?
I got the same problem
  3 件のコメント
yuwen liu
yuwen liu 2020 年 2 月 27 日
Hi, did you find an answer ?
I got the same problem.
My label images were RGB.But when I ran "[net, info] = trainNetwork(pximds,lgraph,options); ",
I had the error
wrong use trainNetwork (line 165)
Pixel label image has RGB-triplet pixel label
IDs instead of scalar pixel label IDs.
Curtis Zhang
Curtis Zhang 2021 年 6 月 3 日
delete alpha and transfom 3d into 2 d

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by