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

Detecting objects in OpenCV

$
0
0
I've got problem with detecting orange ball in OpenCV. In the pictures you see results after function inRange and the second one is thresholding (which is now not in the code). In both ways HoughCirles don't see circle which is seen in front of both pictures. They are not in good quality because of the camera (you can see the noise), but I think that function should have no problem in recognizing circle. Thank you for all help. My code: `enter code here` CvMemStorage *storage = cvCreateMemStorage(0); //storage area for all contours VideoCapture cap(0); if (!cap.isOpened())// if supposed not success, { cout<<" cannot open the videofile"< circles; /// Apply the Hough Transform to find the circles HoughCircles( hsv_src, circles, CV_HOUGH_GRADIENT, 1, src_gray.rows/8, 200, 100, 0, 0 ); /// Draw the circles detected for( size_t i = 0; i < circles.size(); i++ ) { Point center(cvRound(circles[i][0]), cvRound(circles[i][1])); int radius = cvRound(circles[i][2]); // circle center circle( src, center, 3, Scalar(0,255,0), -1, 8, 0 ); // circle outline circle( src, center, radius, Scalar(0,0,255), 3, 8, 0 ); } /// Show your results cout<<"Circles found: "<

Viewing all articles
Browse latest Browse all 41027

Trending Articles



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