Viola and Jones gives very bad results
古いコメントを表示
Hi,
I trained Viola and Jones on a new class using the following simple code:
DBdir='C:\DB\cars-cut';
list=dir(DBdir);
negativeFolder = 'C:\Program Files\MATLAB\R2013a\toolbox\vision\visiondemos\non_stop_signs';
for ix=3:length(list)
im=imread(fullfile(DBdir,list(ix).name));
data(ix-2).imageFilename=list(ix).name;
data(ix-2).objectBoundingBoxes=[ 1 1 size(im,2) size(im,1)];
end
addpath(DBdir);
trainCascadeObjectDetector('cars.xml', data, negativeFolder, 'FalseAlarmRate', 0.0001, 'NumCascadeStages', 5);
Now, I'm testing this model on new images using the following simple code:
detector = vision.CascadeObjectDetector('cars.xml');
detector.MinSize=[60 60];
detector.MergeThreshold=50;
testDir='C:\DB\carstest200\carstest200';
list=dir(testDir);
for ix=3:length(list)
img=imread(fullfile(testDir,list(ix).name));
bbox = step(detector, img);
close all;
if ~isempty(bbox)
detectedImg = insertObjectAnnotation(img, 'rectangle', bbox, 'flower');
f=figure; imshow(detectedImg);
saveas(f,fullfile('C:\carsResults50',list(ix).name),'jpg');
end
end
I'm getting very bad results. The detector keeps missing the cars and labels other object and areas in the image.
Is there anything I'm doing wrong. Can someone please guide me in this problem? What do I need to do to get a good VJ detector?
Any help will be greatly appreciated as I'm quite stuck in this problem.
Thanks in advance,
Gil.
2 件のコメント
Gil
2013 年 8 月 5 日
RAMESH SEJPAL
2014 年 1 月 17 日
How can we generate and add xml file? and what type of content can we add? can we add image? please help.......
採用された回答
その他の回答 (2 件)
tahani
2013 年 11 月 9 日
0 投票
Hi, Can you help me please to find the matlab file in viola and jones algorithm (in 2013 matlab vision toolbox) which extracts features (haar, lbp or hog). this is in order to be able to change its continue aiming at using my own features.
thank you in advance
3 件のコメント
Anand
2013 年 11 月 11 日
Your question isn't very clear to me. It seems like you want to use your own feature descriptors to send to the Haar cascade classifier in the Computer Vision System Toolbox.
Given my understanding of the trainCascadeObjectDetector function, this is not possible. The only allowed feature types are those that you can specify using the 'FeatureType' parameter.
If you still want to have a crack at it, you can locate the file as follows:
>> edit trainCascadeObjectDetector.m
RAMESH SEJPAL
2014 年 1 月 17 日
@Anand , In Xml file what type of content should we add for the detector?
Anand
2014 年 1 月 29 日
If you're using the trainCascadeObjectDetector function, you don't need to add any content to the XML file. The function populates the XML file. You then use this XML file to create a detector, like so:
detector = vision.CascadeObjectDetector('xmlfilejustcreated.xml');
bbox = step(detector,new_img);
lourdes ramirez
2014 年 3 月 29 日
0 投票
Did you find the training algorithm because I'm looking too.
カテゴリ
ヘルプ センター および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!