Previously, you learnt to find the contours from a given image. In this segment, you will learn Hulls and blob detection and validation.
A convex hull is the smallest polygon that can enclose all the points. In our case, the convex hull will be the polygon that will enclose a contour.
As you can see, the contour can have an uneven shape, and convex hull encloses the contour.
The question arises – why do we need hulls? The following image gives you a clear answer to this question. The hull (right) represents a car much better than the contour (left).
As you can see in the above figure, the contour of a vehicle has a lot of patches due to various preprocessing. But our objective was to detect the boundary of the vehicle. Therefore, we find the hull which encloses the contour.
Here, the hull will have the shape of a vehicle. Since a hull represents an enclosed object, we can derive some properties from each of these hulls such as area, perimeter, centre point, area, diagonal length, etc.
In programming, generally, we define a class() to store the necessary variables and functions describing an object. Here, the properties of each hull are stored in a ‘Blob’ class, where ‘Blob’ represents an object (contour) being tracked. The properties for these blobs which will be useful in tracking and validating them. Let’s know these variables and functions from Anand Mudlikar.
In the above video, you saw some properties of the blob. These properties will be used to validate and track the blob. Now, let’s see what does it mean why we say validating a blob? Note that the properties of the hull are stored in Blob() class.
As explained, there can be objects moving in the video apart from the vehicle such as a person, dog, birds, etc. and we do not want them to be tracked. So, we will filter out unwanted moving objects using properties such as blob area, aspect ratio, etc. We will store all valid blobs in a list named as currentFrameBlobs().
Till now, you have seen to store the blobs which satisfy the condition to be a valid vehicle and store it currentFrameBlobs() list. This list will be used in tracking the vehicle, which you will learn in the next session.
Report an error