I need to track cars on the road from top-view video.
My application contain two main parts:
I have troubles with opencv trackers. Initially i tried to different trackers, but only MOSSE is fast enough. This tracker works almost perfect for case with straight road, but i faced problems with rotating cars. This situation appears on crossroads.
As i understood, bounding box of rotated object is bigger that bbox of horizontal or vertical object. As result bbox contains big part of static background and the tracker lose target object.
Are there any alternative trackers which can track contours (not bounding boxes)? Can i adjust quality of existing opencv trackers results by any settings or by adjusting picture?
Schema:
Real image:
The OpenCV object tracking API provides a variety of trackers. You can try some of the other tracking algorithms by simply changing the value of the tracker variable. Mean Shift is a object tracking algorithm that uses the logic of pixel density in different images/histograms to track objects.
OpenCV 4 comes with a tracking API that contains implementations of many single object tracking algorithms. There are 8 different trackers available in OpenCV 4.2 — BOOSTING, MIL, KCF, TLD, MEDIANFLOW, GOTURN, MOSSE, and CSRT.
In simple words, the KCF tracker focuses on the direction of change in an image (could be motion, extension or, orientation) and tries to generate the probabilistic position of the object that is to be tracked. The KCF object tracking is implemented in the TrackerKCF_create () module of OpenCV python. Below is the code along with the explanation.
In this paper, we found that a video picture is moving and that moving object is detected using OpenCV and the detected picture has been represented in frames with the help of contour by computer vision (CV) in a computer system. Detecting and recognizing an object is the initial stage of image systems in computer vision.
If your camera is stationary the following scenario is feasible:
A very basic but effective approach in this scenario might be to track the center coordinates of the bounding box, if the center coordinates only change along one axis (with a small tolerance for either axis), its a linear motion (not a rotation). If both x and y change, the car is moving in the roundabout.
This only has the weakness that it will detect diagonal motion, but since you are looking at a centered roundabout, that shouldn't be an issue.
It will also be very efficient memory-wise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With