IMHO the problems are the following:
- car.xml is trained by you? If so, then that is the problem; it recognizes just the poses that you gave to training. And more: it can also detect some other cars.
- If you are using SURF features from one car and you are trying to detect other different cars, this will not work. But you are saying that you want to detect one specific car and count it, so the SURF features approach is good.
You have applied the background subtraction, so you have now detections (ore regions of interest). So I am thinking of an approach like this for each detection:
- detect features
- match them
- if the matching is higher than a threshold, you say it is the car you want
For this you shall have some database of some images of that car in different positions and do the matching with all the features in your database. The matching threshold should be set based on some test. You have used a kalman filter for tracking, so you can use it for tracking, if you do not want to count the detection in each frame, but every time it enters in your field of view after it's out. Hope it is helpful.
berak hey dude can you please help me on this? it's urgent.I can't extract car feature from any video either man or vehicle it detect as same. i used only SURF method but it is not working properly and my code become tedious.
@thdrksdfthmn@abhishek Kumar Annamraju @GilLevi Hey guys please help me on this topic. Its' urgent. I already used bgs method but can't get my goal. I wan to detect only car from traffic and eliminate other like pedestrian and two wheeler . for that i want to detect only car feature. I include car xml but it gives me bad result for top view camera. My camera is at around 60 to 70 degree angle from bottom. and also i tried SURF method but don't know how to use it for my project. please help me on this. please. Thank you in advance
Can you post some code, first?
@thdrksdfthmn can you send me your email id . so that i can send you my code. I actually perform two option in parallel 1) to do surf method on video. 2)use car.xml file and then run code In 1st option I can successfully run code for image in that code I give one image as input and then it compare exact key-points in image and recognize same car from it. the same code in video i can't detect. and for 2nd option i use car.xml file it detect only top view car and only applicable to 1video for live purpose and different angle camera it is not working. So please help me on this. Thanx in advance.
I am afraid that posting my email on the forum is not a clever thing.
coco, whatever you use, you will have to get train data in the most similar situation to your test case.
you can't train with a frontal view, and test from 60° down.
also, please let's keep the discussion here on the qa site, so other folks can profit reading it or can comment with fresh ideas.
btw, see e.g. here
both mentioned waldboost detector and TLD tracker are available in opencv3.0 in the contrib repo.
@berak hey my code is round 300line. that's why i can't put it here. and i tried surf method it works..but one biggest constraint is that i can detect only one car and only one view so it will generate bad result. now what to do?