In the previous segment, you learnt how to track the vehicle. Previously, we found contours, hulls, and validated those hulls based on their area, aspect ratio, diagonal size, etc. We will only store the properties of the hulls as blobs which satisfies the criteria to be a vehicle. Now, you will define function Blob() inside the class Blob(), where we will calculate the properties (such as centre position, diagonal size, etc.) that we have used earlier to validate the hull. After calculating these properties, you will learn to predict the next position of a blob based on the previous centre positions. Let’s hear from Anand Mudlikar.
We need to keep record if the blob is still being tracked or if a new blob has entered the frame. We will predict the next position using predictNextPosition() function. When a vehicle is entering the video frame for the first time, the number of positions. Now, if the vehicle is tracked for 2 consecutive time frames, the variable numpositions will be 2 and based on the previous 2 frames, we will extrapolate to compute the next position.
We predict the next position based on the past five frames (in case past five frames are available) even if the object is tracked for more than five frames as it is sufficient to predict the next position. Now, you know how to predict the next position, let’s look into the tracking algorithm in the next segment.
Report an error