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
1 view (last 30 days)
Show older comments
%%設定路徑(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!
here's a code example from https://ww2.mathworks.cn/help/vision/ug/train-a-cascade-object-detector.html?#btuo74_
I dont know why they can load .mat file as table type? Instead of mine
1 Comment
Mohammad Sami
on 29 Jan 2020
Ground Truth object has a property called LabelData which is in table form.
Answers (1)
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
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!