Ask Your Question

Revision history [back]

I can't paint the circle into image after using Hough transform :(

Hi everybody ! I used Hough transform to detect circle and then I will paint the circle into my input image ( tennis ball ) depend on those parameter that Hough issued ( center,radius ). Here is my code :

            Mat src1 = imread("banhtennis.jpg");
    Mat src2 = src1.clone();
    Mat gray,canny;

    vector<Vec3f> circles;
    for(int i=0;i<circles.size();i++)
        Point center(cvRound(circles[i][0]),cvRound(circles[i][1]));
        int radius = cvRound(circles[i][2]);
            imshow("Anh sau khi tim thay duong tron",src2);

The result I received after running my program was many red circles that were painted on the input image but not the circle I need. I need the circle cover my ball in this image. Can everyone help me about this problem ? I will attach this image at here C:\fakepath\banhtennis.jpg Thanks very much ^^