MATLAB Answers

Hi, I am doing a project that load a f.mat, which a exported from Image Lableler. Can someone help me to fix the error below ?plz

12 views (last 30 days)
jerry huang
jerry huang on 29 Jan 2020
Answered: Rajani Mishra on 11 Feb 2020
%%設定路徑(SignPath=positive image ; noSignPath = negative image)
SignPath= fullfile('C:','Users','Administrator','Desktop','build model','380to780hyper(D5200)','matlab course','7_objectDetection','test1-28');
noSignPath= fullfile('C:','Users','Administrator','Desktop','build model','380to780hyper(D5200)','matlab course','7_objectDetection','nosignpath');
%%label positive samples (使用labler app)
imageLabeler(SignPath);
I use the imagelabeler to finish labeling and export with the name f.mat
load('f.mat');
addpath(SignPath);
%%train a cascade object detector called signdetector.xml using HOG feature
num = 2
switch num
case 1
trainCascadeObjectDetector('signdetector.xml',gTruth,noSignPath,'FlaseAlarmRate',0.1,'NumCascadeStages',4);
case 2
trainCascadeObjectDetector('signdetector.xml',gTruth,noSignPath,'FlaseAlarmRate',0.01,'NumCascadeStages',4);
end
Error started here:
Can any one teach me how to transfer gTruth type to struct , char, table?? Thx!
I dont know why they can load .mat file as table type? Instead of mine

Answers (1)

Rajani Mishra
Rajani Mishra on 11 Feb 2020
Function trainCascadeObjectDetector() accepts “positiveInstances” argument of type struct, char, table whereas gTruth is of type groundTruth object. groundTruth object has “labelDefinitions” and “LabelData” properties. LabelData property contains label data for each ROI and scene label, specified as a table for image collections or a timetable for videos or image sequence.
You can use LabelData instead of using gTruth object itself. For more information about gTruth object please refer below(refer to the examples section):

  0 Comments

Sign in to comment.

Sign in to answer this question.