Ask Your Question

Should an image used for training always be detected?

asked 2014-03-31 22:32:55 -0600

JimM gravatar image


I have a newbie question. Just getting the feel for this platform, I used a single image (in this case a US Quarter) to create 1000 samples using the below cmd: opencv_createsamples.exe -h 48 -w 48 -num 1000 -maxxangle .2 -maxyangle .2 -maxzangle .9 -vec quarter.vec -img quarter-1.jpg -bg quarter-NEG.txt

Then I trained the following classifier: opencv_traincascade.exe -h 48 -w 48 -numPos 900 -numNeg 2000 -numStages 10 -data Data -vec quarter.vec -bg quarter-NEG.txt -featureType LBP

The fact my cascade.xml is only 4k probably screams “u screw up”, but - my main question is that shouldn’t I always receive a match if I use the same image used to create the samples (in this case, quarter-1.jpg)? Because this returns 0: MatOfRect detectQuarter= new MatOfRect(); detector.detectMultiScale(coin, detectQuarter); System.out.println("Detection result: " + detectQuarter.toArray().length);

Using 2.4.8 JAVA API. Thank you for any help!! -Jim

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2014-04-01 07:39:35 -0600

No, the image used for training will not necessarily be detected.

I think you should use more than one image for training, though.

edit flag offensive delete link more



And to add to his comment, I think it is rather stupid to use the interface to create variants of a single training image. It will basically generate artificial images which will never reach real life situations, so I would stay away from them as much as possible.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-04-01 07:45:00 -0600 )edit

Question Tools


Asked: 2014-03-31 22:32:55 -0600

Seen: 148 times

Last updated: Apr 01 '14