Tuesday, March 31st, 2009, 1042 days ago
Recognizing circles accurately
According to the algrithms of HOUGH, that is more accurate to line detection rather than circle detection, although some times it looks not so much different in theory. Actually, if detecting circles in a black-white picture, it will be obviously not so accurate as detection for lines. Detected circles are always flashing in different possible positions.
To solve this problem and low the mistake detection, the target picture should do some filter: SMOOTH.
cvSmooth( gray, gray, CV_GAUSSIAN, 11, 11 );
cvCanny(gray, edge, (float)edge_thresh, (float)edge_thresh*3, 5); //get the circle edges
CvSeq* circles = cvHoughCircles( gray, cstorage, CV_HOUGH_GRADIENT, 2, gray->height/50, 5, 35 );
cout << circles->total <<endl; //check how many circles detected
int i;
for( i = 0; circles->total>=2?i<2:i < circles->total; i++ ){
float* p = (float*)cvGetSeqElem( circles, i );
cvCircle( src, cvPoint(cvRound(p[0]),cvRound(p[1])), 3, CV_RGB(255,0,0), -1, 8, 0 );
cvCircle( src, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(200,0,0), 1, 8, 0);
}
POSTS MAY BE OF INTEREST
- Doing openCV in pandaboard 3 – successful installation
- Doing openCV in Pandaboard
- Hand gesture recognition for HCI
- Hand detection and image recognition
- Coming soon: A review of openCV detection & recognition
- Pattern recognition and applications
- Object tracking using AS3
- Interactive table
- Touchable holography
- About the codes sharing
- Usability of comsumer electronic products
- Rules of memory management of openCV
- Color recognition using openCV 2
- Do we need more novel interaction methods?
- Hand detection using openCV
