How to use opencv to find circles
I get a picture,but it's format is YUV422,I want to find circles in it,how should I do? Thank you!
I get a picture,but it's format is YUV422,I want to find circles in it,how should I do? Thank you!
Adopt this code: http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html#code
To operate with YUV422 images, try the following modification to the mentioned code sample;
Mat src, src_gray;
src = imread(argv[1], CV_LOAD_IMAGE_GRAYSCALE);
if( !src.data )
{ return -1; }
// YUV422 has 1.5 times the height of the captured frame when read as grayscale, thus you can extract the grayscale by using the two upper thirds of the image only
Rect grayscaleImageAra(0,0,src.cols, src.rows*2/3);
src_gray = src(grayscaleImageAra); // crop the Grayscale part fromt he YUV422 image
// FROM THIS LINE UNCHANGED CODE FROM http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html#code
/// Reduce the noise so we avoid false circle detection
GaussianBlur( src_gray, src_gray, Size(9, 9), 2, 2 );
// ..... //
Asked: 2013-10-03 05:46:02 -0600
Seen: 549 times
Last updated: Oct 03 '13
count only the black pixels inside the contour. [closed]
OpenCV Matrix memory release after imread command
SolvePnP returns wrong rotation
Draw the lines detected by cv::HoughLines
Stretch all of the image rows in order to make them of constant length
How to use PCA SIFT in opencv ?
Adjust the rotation of car plate
Is there a 2.0 series version of the HDR tutorial? Currently broken.
How do I help OpenCV Developers autogenerate C wrappers for C++ code?
Try HoughCircles. Should work(: