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 [1]. 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” [1].


Original Hough map


After opening


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 [2] and Kapur [3] thresholding gives an acceptable thresholding level to detect Hough peaks.


Detected Hough peaks

  1. Gonzalez, R. C., & Woods, R. E. (2008). Digital image processing (third ed.). Upper Saddle River, New Jersey, USA: Prentice Hall.
  2. Kittler, J., & Illingworth, J. (1986). Minimum error thresholding. Pattern Recognition, 19, 41-47.
  3. Kapur, J. N., Sahoo, P. K., & Wong, A. K. C. (1985). A new method for gray level picture thresholding using the entropy of the histogram. Graph. Models Image Process., 29, 273-285.