問題描述
OpenCV 文檔指出:
The OpenCV documentation states:
dp:累加器分辨率與圖像分辨率的反比.例如,如果 dp=1 ,則累加器具有與輸入圖像相同的分辨率.如果 dp=2 ,累加器的寬度和高度只有一半.
dp: Inverse ratio of the accumulator resolution to the image resolution. For example, if dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has half as big width and height.
但它沒有說明這個值的大小如何影響圓檢測.我以為累加器只是最大值的集合,它怎么有分辨率?
But it gives no indication how the size of this value affects circle detection. I thought the accumulator was just a collection of maxima, how does it have a resolution?
推薦答案
在霍夫變換期間,您將輸入圖像轉換為所謂的霍夫空間.試圖找到圓時它是 3 維的(三個維度是圓心和半徑的坐標).在轉換過程中,輸入圖像中的每個邊緣像素都會為該像素所在的所有可能的圓圈投票.
During hough transformation you transform your input image into so called hough space. It is 3-dimensional while trying to find circles (the three dimensions are the coordinates of the circle center and the radius). During the transformation each edge pixel in your input image votes for all possible circles on which the pixel could lie.
您可以將投票視為在 3 維矩陣(霍夫空間)中增加多個值.投票后,您搜索此矩陣中的最大值并讀取圓心及其半徑.
You can think of the voting as increasing multiple values within a 3-dimensional matrix (hough space). After voting you search for the highest value within this matrix and read of the circle center and its radius.
矩陣越大(與您的輸入圖像相比)(您的 dp
越小),您的投票分辨率就越高.分辨率越高,圓檢測越準確.
The bigger the matrix (compared to your input image) (the smaller your dp
), the higher the resolution of your voting. The higher the resolution, the more accurate the circle detection.
但是,檢測越準確,例如遺漏輕微退化的圓或檢測多個圓而不是一個大邊緣的圓.
However, the more accurate the detection, the more likely it is to e.g. miss slightly degenerated circles or detect multiple circles instead of one with a big edge.
這篇關于在圓霍夫變換中,累加器分辨率的反比 (dp) 是多少,它如何影響圓檢測?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!