The assigned pixel name is having error in semnatic segmentation "pixellabeldatastore".

1 回表示 (過去 30 日間)
The code i am working upon:
pxDir = fullfile('C:\Users\Admin\Downloads\13521488\Mask');
classNames = ["Background","ground-glass" ];
pixelLabelID = [0 1]
pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);
Error displayed:
Error using pixelLabelDatastore>parseInputs (line 265)
The value of 'classNames' is invalid. 'ground-glass' is not a valid class name. Class names must be valid MATLAB variable
names. See ISVARNAME for more details.
Error in pixelLabelDatastore (line 211)
[location, classes, values,params] = parseInputs(varargin{:});
Note- Predefined labels are:
ground-glass (mask value =1), consolidation (=2) and pleural effusion (=3)

採用された回答

Image Analyst
Image Analyst 2021 年 6 月 8 日
Evidently it doesn't like the minus sign. Try
classNames = ["Background","GroundGlass"]; % String vector
or
classNames = {'Background', 'GroundGlass'}; % Cell array
  1 件のコメント
Sakshi Ahuja
Sakshi Ahuja 2021 年 6 月 8 日
Thanks for the help! This resolved my issue but when i am trying to display the label over input image i am not getting the desired output.
imDir = fullfile('C:\Users\Admin\Downloads\13521488\Train_png');
pxDir = fullfile('C:\Users\Admin\Downloads\13521488\Mask_png');
imds = imageDatastore(imDir);
classNames = ["Background","GroundGlass"];
pixelLabelID = [0 1]
pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);
I = readimage(imds,1);
C=readimage(pxds,1);
B = labeloverlay(I,C);
imshow(B)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by