Skip to content

Commit

Permalink
[FIX] Fixed a bug in the computation of the circle perfectness
Browse files Browse the repository at this point in the history
  • Loading branch information
rlagneau committed Jan 8, 2024
1 parent d8e831c commit 984e76e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/imgproc/src/vpCircleHoughTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ vpCircleHoughTransform::computeCircleCandidates()

for (auto edgePoint : m_edgePointsList) {
// For each center candidate CeC_i, compute the distance with each edge point EP_j d_ij = dist(CeC_i; EP_j)
float rx = edgePoint.first - centerCandidate.first;
float ry = edgePoint.second - centerCandidate.second;
float rx = edgePoint.second - centerCandidate.second;
float ry = edgePoint.first - centerCandidate.first;
float r2 = rx * rx + ry * ry;
if ((r2 > rmin2) && (r2 < rmax2)) {
float gx = m_dIx[edgePoint.first][edgePoint.second];
Expand Down
2 changes: 1 addition & 1 deletion tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main(int argc, char **argv)
const int def_dilatationKernelSize = 5;
const float def_centerThresh = 70.f;
const float def_circleProbaThresh = 0.725f;
const float def_circlePerfectness = 0.65f;
const float def_circlePerfectness = 0.85f;
const float def_centerDistanceThresh = 5.f;
const float def_radiusDifferenceThresh = 5.f;
const int def_averagingWindowSize = 5;
Expand Down

0 comments on commit 984e76e

Please sign in to comment.