Is it possible to access the accumulator of the hough transform using opencv?

2

I have this little problem, I searched a lot on the internet and in the documentation but I did not find anything related, I need to know the accumulation value of each circle generated by the function, for example: circle of center (x, y) radius r had 50 points of accumulation

In my case, I need to know which circle has the greatest accumulation, because this is the only circle that interests me among all generated!

    
asked by anonymous 17.11.2014 / 02:13

1 answer

2

A long time later I discovered that the returned circle vector is sorted according to those who got the highest vote, so the circle of index 0 is the best circle among all.

    Mat out;
    vector<Vec3f> circles
    houghCirclesHoughCircles(inputImg, circles, method, dp, minDist, param1, param2, minRadius, maxRadius);
    ///desenhando circulo mais votado em uma imagem de mesmo tamanho da imagem original
    if (!circles.empty()) {
        Point center(circles[0][0], circles[0][1]);
        int raio = circles[0][2];
        out = Mat::zeros(inputImg.size(), inputImg.type());
        circle(out, center, raio, FScalar(0, 0, 255), -1);
    }
    return out;
    
07.06.2017 / 16:01