Image labeler Train cascade error!

2 Ansichten (letzte 30 Tage)
AAAA
AAAA am 5 Dez. 2019
Bearbeitet: AAAA am 6 Dez. 2019
Hi,
I have a set of labeled images using the image labeler app. I have exported using the builtin function to gndTruth file.
I have the following code:
load('gndTruth.mat');
positiveInstances = gndTruth(:,2:1);
imDir = fullfile('positveImgDir');
addpath(imDir);
negativeFolder = fullfile('NegativeImgDir');
negativeImages = imageDatastore(negativeFolder);
trainCascadeObjectDetector('bluesDetector.xml',positiveInstances, ...
negativeFolder,'FalseAlarmRate',0.1,'NumCascadeStages',5);
I have no idea why it is causing error.

Akzeptierte Antwort

Ridwan Alam
Ridwan Alam am 6 Dez. 2019
Bearbeitet: Ridwan Alam am 6 Dez. 2019
Could the error be that I'm using pixel label instead of line or rectangle label?
Yes, sorry!
Update:
[imds,pxds] = pixelLabelTrainingData(gTruth);
But I don't think you can use imds and pxds for trainCascadeObjectDetector().
Because the positiveInstances variable requires the second table column or structure field to contain an M-by-4 matrix of M bounding boxes. Each bounding box is in the format [x y width height] and specifies an object location in the corresponding image.
  1 Kommentar
Ridwan Alam
Ridwan Alam am 6 Dez. 2019
I believe you need gTruth created with box labels. Then you can use objectDetectorTrainingData() and trainCascadeObjectDetector().

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by