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<uchar>(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);
}