best way to do the traincascade via the standalone tool [closed]

asked 2016-11-13 23:39:40 -0500

Yasser Akram gravatar image

updated 2016-11-14 14:38:08 -0500

Hi all

I'm trying to train a classifier to detect cars shadows (rear view) and I am facing difficulties doing that, later I want to use the output to verify the possible car region via HOG+SVM (will worry about it later). I don't know exactly what is needed to do so as I'm using around 692 positive samples with 4400 negatives converted to gray, cropped exactly to the object (160x45). for training I'm using 600 pos, 3500 neg. My target dimensions: -w 60 -h 17

Positive samples are like (160x45): image description

Negative samlpes are like (160x45): image description

And this is the horrible result with only 1 correct catch (I made the rectangle height similar to the width to match the whole car):

image description

What exactly is wrong? Do I need more samples? Is it required to do histogram equalization (before or after)? Is it mandotary to use the annotation tool (I'm using cropped images so my pos.txt having things like pos/pos2.png 1 0 0 160 45)? Do my negative samples should be a full image or just peices matches the size of the positives? I'm so confused! Appreciate any help really


edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-05 09:39:34.879205


There is no very good results

Start by sharing some results that are not satisfactory. Secondly could you elaborate more on your end goal? Cascade classification might not what you be needing. You do not need to use the annotation tool at all.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-11-14 06:14:19 -0500 )edit

Your positive set is completely random. Since boosting is internally basically trying to get an optimal seperation between positives and negatives, I am afraid your model is failing. Also your model detections are squared and your data rectangular. So you are using wrong -w and -h parameters.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-11-15 02:38:22 -0500 )edit

So what do I have to do then? As per my investigation I found everybody is telling to get samples of the object in its many statuses. For the squared detection actually I'm making it like that, when I get the Rect vector I'm making the height equals the width before I plot the borders on the image so the -w and -h are fine I suppose.

Yasser Akram gravatar imageYasser Akram ( 2016-11-15 11:58:41 -0500 )edit

Also I wonder if my positive and negative samples should be converted to grey scale and then have a histogram equalization?

Yasser Akram gravatar imageYasser Akram ( 2016-11-15 13:42:04 -0500 )edit

Well let me wrap some things up

  • Yes you need to get objects in as many conditions as possible, but this shadow object is so versatile that I am afraid it will be impossible for the machine learning to find any common features. Can you explain why you want to track shadows?
  • But why would you want to make it squared. Simply said, if an object is rectangular making it squared visually just confuses people. Please do not do it.
  • Your samples will get converted and histogram equalized automatically if you do not do it yourself in the algorithm.

I am wondering if trying to detect cars, and then just based on that detection finding the shadows isn't much easier than what your are trying to do now.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-11-16 02:54:28 -0500 )edit

The idea is getting the shadow locations, make the detected Rect as squared, resize to 64x64, then run a verification for that squared area via SVM traind with HOG from another samples of cars rear shot. I'm trying to replication the work of some other researchers in order to do some enhancements.

Yasser Akram gravatar imageYasser Akram ( 2016-11-17 06:35:17 -0500 )edit

wow your explanation does not make sense. If I was to get the locations, I would go for the cars (a widely solved problem and take the lower bounds of the detection as shadow region)

StevenPuttemans gravatar imageStevenPuttemans ( 2016-11-17 06:39:50 -0500 )edit

Maybe you are right.. Can you provide me with the best opinion, method or ready code you came across? Note that the camera is moving and not fixed.

Yasser Akram gravatar imageYasser Akram ( 2016-11-17 07:59:00 -0500 )edit