Image processing up to bubble sizes in octaves

Hi, I am wondering if anyone can suggest any pointers to a potential approach to sizing bubbles on the surface of the water (and not below it) in the following image. I would like to use open source software if possible (my mind tends to be an octave, given that the image is a matrix). I have absolutely no experience in image processing, so any ideas are welcome. Obviously, as a starting point, I know the size of each pixel in the raw image (this is a compressed version), so calculating the radius in pixels would be ideal.

Bubble image

Edit based on @mmgp’s thoughts

, , @mmgp, Opencv. ( C C++, , , , , , , , , . , ( , , , , , , ). , , . , , , , . , , , , ( , , ).

? ? , , @mmgp, .

: ( ): Grayscale image : Grayscale image : Grayscale image

:

 #include "opencv2/highgui/highgui.hpp"
 #include "opencv2/imgproc/imgproc.hpp"
 #include <iostream>
 #include <stdio.h>

 using namespace cv;

 /** @function main */
 int main(int argc, char** argv)
 {
 Mat src, src_gray, src_bw;

 /// Read the image
 src = imread( argv[1], 1 );

 if( !src.data )
 { return -1; }

 /// Convert it to gray
 cvtColor( src, src_gray, CV_BGR2GRAY );
 imwrite( "Gray_Image.jpg", src_gray );

 /// Threshold the image to make binary
 threshold(src_gray, src_bw, 140, 255, CV_THRESH_BINARY);
 imwrite( "Binary_Image.jpg", src_bw );

 vector<Vec3f> circles;

 /// Apply the Hough Transform to find the circles
 HoughCircles( src_bw, circles, CV_HOUGH_GRADIENT, 5, src_bw.rows/2, 5, 10, 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
 namedWindow( "Hough Circle Transform Demo", 0 );
 namedWindow( "Gray", 0 );
 namedWindow( "Binary Threshold", 0 );
 imshow( "Hough Circle Transform Demo", src );
 imshow( "Gray", src_gray );
 imshow( "Binary Threshold", src_bw );
 imwrite( "Circles_Image.jpg", src );
 waitKey(0);
 return 0;
 }
+3
1

-

.

, .

.

, , , .

0

Source: https://habr.com/ru/post/1545343/


All Articles