Skip to content

Detection

Ashwin Shenai edited this page Jan 10, 2020 · 2 revisions

Segmentation

Since the image obtained from the fish-eye camera is distorted, it is passed through an undistort function that takes the image and the camera model as the input, and outputs an undistorted image. The image is then converted to the HSV color space and a thresholding algorithm is applied to obtain only the pixels of a certain color. Contours are then extracted from the binarized image and further processed.

Contour Extraction

The contours previously obtained are first checked for a minimum pixel count. Contours smaller than this minimum are discarded. The center of the contour is obtained and then the corners are found by computing the convex hull of the contour. Firstly, we compare the area enclosed by the hull and the total area of the segment (For a convex polygon these must be almost equal). Secondly, since dimensions of the boxes are much smaller than the height from which they are viewed, the boxes will appear as quadrilaterals (hexagons at most). So we compare the lengths of the diagonals of the segment, for a regular polygon these must almost be equal.

Contours that are valid after these checks are added to a vector of valid objects, which is the final output of the object detection algorithm.

Initial image Thresholded image