Automatic top hat

The Automatic Top Hat operation is a thresholding algorithm to detect Hough peaks from a HoughMap. The algorithm is based on the top hat algorihm of Gonzalez and Woods [Gonzalez2008]. It consists of performing an opening of the original HoughMap and then subtracting the resultant map with the original map. The opening allows to remove any features and “leaves only an approximation of the background” [Gonzalez2008].

../../../../../_images/tophat_before.png

Original Hough map

../../../../../_images/tophat_opening.png

After opening

../../../../../_images/tophat_subtraction.png

Subtraction of the original Hough map and the map resulting from the opening

After a threshold opening is performed to detect the peaks. It was found that an average between the threshold value obtained from the minimum error [Kittler1986] and Kapur [Kapur1985] thresholding gives an acceptable thresholding level to detect Hough peaks.

../../../../../_images/tophat_threshold.png

Detected Hough peaks