1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Fix bug: non-maximum suppression for hough circle

The non-maximum suppression in the Hough accumulator incorrectly ignores maxima that extend over more than one cell, i.e. two neighboring cells both have the same accumulator value. This maximum is dropped completely instead of picking at least one of the entries. This frequently results in obvious circles being missed.

The behavior is now changed to be the same as for hough_lines.

See also https://github.com/opencv/opencv/issues/4440
This commit is contained in:
Peter Fischer
2017-09-27 11:47:30 +02:00
committed by GitHub
parent 7475d23fec
commit 332588fcee
+2 -2
View File
@@ -1112,8 +1112,8 @@ icvHoughCirclesGradient( CvMat* img, float dp, float min_dist,
{
int base = y*(acols+2) + x;
if( adata[base] > acc_threshold &&
adata[base] > adata[base-1] && adata[base] > adata[base+1] &&
adata[base] > adata[base-acols-2] && adata[base] > adata[base+acols+2] )
adata[base] > adata[base-1] && adata[base] >= adata[base+1] &&
adata[base] > adata[base-acols-2] && adata[base] >= adata[base+acols+2] )
cvSeqPush(centers, &base);
}
}