Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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, this you can capture the Grayscale by using the two upper thirds of the image
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 );

// ..... //

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, this thus you can capture extract the Grayscale grayscale by using the two upper thirds of the image
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 );

// ..... //