Hough transform#
The objectives of this exercise are:
to detect lines in an image with the Hough transform
to know how to interpret a Hough transform
The Hough transform is applied to binary images, which must highlight the lines of the image. Also, an edge detection is needed. We apply the Canny detector (with the default parameters).
The function hough_line
returns the accumulator and the corresponding x-axis and y-axis.
We can see clearly the sinusoids, each corresponding to a white pixel of the image of the contours
(actually, we have done an image transformation to bring out the sinusoids).
When the sinusoids intersect, they increase the intensity of the intersection pixel.
The brightest pixels of the transform correspond to the main lines of the edges.
The function hough_line_peak
brings these pixels:
the most important are represented by the green circles on the accumulator,
and correspond to the lines shown in the image below.
Can you identify where the non-detected lines of the image are on the accumulator?
Try to detect the central circle of the object.