computer vision - train Cascade ObjectDetector matlab -


i'm asking how can'i use traincascadeobjectdetector while create positive smples structre composed of filename , bonding boxes cordinates. hase negative exemple images file. when lnche function flow

traincascadeobjectdetector('newdetector.xml', str, negativefolder, 'falsealarmrate', 0.2, 'numcascadestages', 5); 

i have error:

error using traincascadeobjectdetector>parseinputs (line 306) argument 'positive_instances' failed validation error: cannot find struct field 'imagefilename' in positive_instances.  error in traincascadeobjectdetector (line 161) parser = parseinputs(varargin{:}); 

as error says, str not contain field called imagefilename, should field image files are. quoting matlab documentation:

positive_instances array of structs information positive instances. struct fields are: imagefilename - string specifies image name. image can true color, grayscale, or indexed, in of formats supported imread.

objectboundingboxes    - m-by-4 matrix of [x y width height]                           bounding boxes specifying object                          locations. 

so, str argument should array of structs information, i.e (file1 has 3 boxes, file2 2 , file3 4):

str = struct('imagefilename',{'file1path', 'file2path', 'file3path'},...   'objectboundingboxes',{[xbox1 ybox1 w1 h1;xbox2 ybox2 w2 h2;xbox3 ybox3 w3 h3]...   [xbox1 ybox1 w1 h1;xbox2 ybox2 w2 h2],...    [xbox1 ybox1 w1 h1;xbox2 ybox2 w2 h2;xbox3 ybox3 w3 h3,xbox4 ybox4 w4 h4]}); 

or other way want declare it. sure input files in format.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -