pxds= pixellabeldatastore(pxDir,classes,labelIDs)
Error using pixellabeldatastore
Too many input arguments.
what are the wrong with this code??

댓글 수: 4

Geoff Hayes
Geoff Hayes 2021년 11월 22일
@fatima ismail - which version of MATLAB are you using?
What does this show
whos pxDir
whos classes
whos labelIDs
fatima ismail
fatima ismail 2021년 11월 22일
fatima ismail
fatima ismail 2021년 11월 22일
function pxds= pixellabeldatastore()
pxDir = fullfile('D:\master\thesis\pilot study\roads_colors');
classes = ["biling" "car" "pedestrian" "Road" "Sky" "greens" "pole" "Pavement"];
labelIDs={
% "Builing"
'(237 252 0; % "Builing")';
% "car"
'(169 0 189; % "car")';
% "pedestrian"
'(252 0 0; % "pedestrian")';
% "Road"
'(77 77 77; % "Road")';
% "Sky"
'(0 45 172; % "Sky")';
% "greens"
'(92 155 3; % "greens")';
% "pole"
'(119 127 3; % "pole")';
% "Pavement"
'(255 128 5; % "Pavement")';
};
pxds= [pxDir,classes,labelIDs];

댓글을 달려면 로그인하십시오.

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 12월 29일

0 개 추천

Using a folder of example images that ships with MATLAB, I was able to run your code in R2021a once I updated the labelIDs to be an array of numbers.
classes = ["biling" "car" "pedestrian" "Road" "Sky" "greens" "pole" "Pavement"];
labelIDs=[237 252 0;
169 0 189;
252 0 0;
77 77 77;
0 45 172;
92 155 3;
119 127 3;
255 128 5];
pxDir = fullfile(matlabroot,'toolbox/vision/visiondata/stopSignImages');
pxds= pixelLabelDatastore(pxDir,classes,labelIDs)
pxds =
PixelLabelDatastore with properties: Files: {41×1 cell} ClassNames: {8×1 cell} ReadSize: 1 ReadFcn: @readDatastoreImage AlternateFileSystemRoots: {}

질문:

2021년 11월 22일

답변:

2021년 12월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by