Here is a line fitting to the motorcycle frame from last week:
This is one from a car in the background:
As seen in the first image, we now have a more robust model for detecting motion towards a traffic stop.
A possible solution to "Why doesn't the traffic light work with motorbikes(motorcycles)?"
For all the frames in the video:
Compute the background by a sliding average.
Do an image subtraction of the background image from the current image.
Convert the resultant image to a binary image and use a connected component labeling
threshold on area to reduce noise
for all the blobs on the current frame:
compute position(centroid), area, boundingbox
compare the current blob's position, area against the global blob set
if positions are the nearest and within a certain threshold, add position to the matching global blob
if the positions are not near, add to global blob set
if a blob's trajectory has shown the intended direction path in the specified area, turn on boolean flag for triggering