Answer the question
In order to leave comments, you need to log in
How to programmatically count the entered and exited cars?
It is necessary to organize a software calculation of entered and exited cars on opencv.
How to implement?
Answer the question
In order to leave comments, you need to log in
What is the difficulty? Is the camera static? fix the background, divide the area captured by the camera into 2 areas. Choose the size after which the object becomes a car. We get the following algorithm: subtract the background, binarize the resulting result (before that, we can filter using a space-time filter, i.e. we average not only over the current frame, but also over neighboring ones. This will get rid of noise, rain, snow, flying insects ), we find objects that are greater than a certain threshold (to separate cars from dogs and people), we look at how the position of the object changes. If from region 1 to region 2, then he entered, on the contrary, he left. Problems begin if the camera captures several cars at once, which can overlap each other when moving, etc. This already requires tracking the movement of the car + a method of separating one car from another. Well, after the implementation, we begin to select the parameters: can the car drive through the entire frame in 1 second. if it cannot, then everything that this will accomplish is clearly closer to the camera (birds, insects) and does not interest us.
OpenCV is not really needed here, it's like shooting sparrows from a cannon. Enough two photo barriers at the entrance (well, or two cameras, if you so desire).
If the first hurdle is passed, then the second - +1
If the second hurdle is passed, then the first - -1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question