Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

draw circle function (x,y) coordinate help (Hough circle)

$
0
0
Hello forum, I wrote a simple code for the standard hough circular transform. However, I am unsure why the center of the circle is shifted. Can anyone help me on this ? int main(int argc, char** argv) { image = imread("lost3.png",CV_LOAD_IMAGE_GRAYSCALE); image.copyTo(canny_output); Canny(canny_output, canny_output, 100, 200, 3); namedWindow("canny output", CV_WINDOW_NORMAL); imshow("canny output", canny_output); Mat temp = Mat::zeros(image.size(), CV_8UC1); for (int i = 0; i < canny_output.rows; i++) for (int j = 0; j < canny_output.cols; j++) if (canny_output.at(i, j) != 0) { circle(temp, Point(i, j), 7, 20, 1, 0); //hough_space = hough_space + temp; image = image + temp; temp = Mat::zeros(image.size(), CV_8UC1); } namedWindow("image", CV_WINDOW_NORMAL); imshow("image", image); waitKey(0); } ![image description](/upfiles/1438429646509754.png) ![image description](/upfiles/14384378008031351.png)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>