The perspective of the road makes it's hard to detect cars because the bounding boxes is in different sizes. This is important because each car’s real distance has to be calculated to find the speed. The solution to this task is to create four transformation matrices for four road lanes.
After plotting the histogram graph of the background model, the color of the road is in the middle of the sorted color value. So we use median instead of mean to calculate chromatic distortion and brightness distortion.
Background Subtraction finds it hard to detect them on the road because the color is similar to the road. Using Sobel Edge Detection instead of Background Subtraction to detect cars is the solution for this task.
Using Cars Detection algorithm with Sobel Edge Detection instead of findcontour function that already exists, to detect cars on the road
Since the capote of the cars is plane, so edge detection can not detect. We have to close the area for improving the cars detection algorithm by using union find algorithm to connect the background and find the foreground.
To track the car, we get current and next centroid of cars, calculate to accurate y position. Then use lower bound to find proper new position of car and also use car speed to predicted undetected car in the frame
Transformation Matrix is used to warp the image so the real distance of driving can be calculated. With distance and time, the speed can be made.
593 10731 21
593 10536 21
593 10170 21
593 10565 21