我试图检测如图中的所有球,但是你可以看到并未检测到全部。我已经尝试调整参数2个小时了,但是没有更多的球被检测到。我的检测代码如下,请帮忙。我的头都快炸了。
IplImage* gray = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1);
CvMemStorage* storage = cvCreateMemStorage(0);
//covert to grayscale
cvCvtColor(img, gray, CV_BGR2GRAY);
// This is done so as to prevent a lot of false circles from being detected
cvSmooth(gray, gray, CV_GAUSSIAN, 5, 5);
IplImage* canny = cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,1);
//detect circles
CvSeq* circles = cvHoughCircles(canny, storage, CV_HOUGH_GRADIENT, 1, 27.0, 80, 64,0,0);