I am a beginner in openCV. I want to detect some images, do I need to generate cascade file similar to one present in face detection sample app? What is the correct way?

asked 2015-12-23 05:11:01 -0600

I have installed opencv-3.0.0 using the installer from "http://downloads.sourceforge.net/opencvlibrary/opencv-3.0.0.exe". I am running the utilities opencv_createsamples and opencv_traincascade directly after running the installer. Is this the correct way to run the utilities?

edit retag flag offensive close merge delete

Comments

"Is this the correct way to run the utilities?" - yes, i'd think so.

http://docs.opencv.org/ref/master/dc/...

http://answers.opencv.org/questions/q...

berak gravatar imageberak ( 2015-12-23 05:26:22 -0600 )edit

Thanks for the response Berak. Can you help me get the steps to generate a correct cascade file?

Priyanka Agarwal gravatar imagePriyanka Agarwal ( 2015-12-23 05:54:51 -0600 )edit

read a bit, try out, come back with actual problems ?

berak gravatar imageberak ( 2015-12-23 06:11:55 -0600 )edit

I tried generating a cascade file for detecting a car. I have 500 images in negative folder and one positive image. I used the below commands: 1. opencv_createsamples -img car.png -num 550 -w 48 -h 24 –vec cars.vec 2. 2. opencv_traincascade -data data -vec cars.vec -bg bg.txt -numStages 10 -minhitrate 0.999 -maxfalsealarm 0.1 -featureType LBP -numPos 1 -numNeg 500 -w 48 -h 24 3. I replaced the cascade file in face-detection sample app with this new generated cascade file.

But many false positives gets detected too along with the car. Probably the cascade file which I generated is not correct enough to detect only the car which I supplied as a positive image.

Priyanka Agarwal gravatar imagePriyanka Agarwal ( 2015-12-23 06:23:16 -0600 )edit

I am going through many other links and materials, but any suggestion will be of great help.

Priyanka Agarwal gravatar imagePriyanka Agarwal ( 2015-12-23 06:24:31 -0600 )edit

you're trying with one positive ( -img car.png) only ? that won't work. decide, which orientation(front,back,side) you want, it will only work for one. then use the annotation tool , and gather a few hundred positives

berak gravatar imageberak ( 2015-12-23 06:24:59 -0600 )edit

Thanks Berak. Yes I am trying with one positive, because my goal is to detect a particular image. Is that not possible with OpenCV?

Priyanka Agarwal gravatar imagePriyanka Agarwal ( 2015-12-23 06:28:47 -0600 )edit

a particular image ? what do you mean exactly ?

berak gravatar imageberak ( 2015-12-23 06:40:30 -0600 )edit

I have an image of a company's logo and now I want to detect it. This logo can be present anywhere, on top of any thing. As soon as I get this logo in my camera feed, I want to detect it and mark it.

Priyanka Agarwal gravatar imagePriyanka Agarwal ( 2015-12-23 06:43:38 -0600 )edit

so, that means, you need to collect images of your logo, not whole cars, right ? why didn't you say so before ?

still, you need as many cropped images of that logo as you can get. also, try to keep it as close to 1 orientation as possible.

berak gravatar imageberak ( 2015-12-23 06:49:38 -0600 )edit