简体   繁体   中英

MATLAB, algorithm for free surface detection in bubbly flow

I am trying to figure out an algorithm for detecting the free surface from a PIV image (see attached). The major problem is that in the flow under consideration gas bubbles are injected into the fluid, these rise up due to buoyancy and tend to sit on top of the surface. I don't want these to be mistaken for the free surface (actually want the '2nd' edge underneath them) - I'm struggling to figure out how to include that in the algorithm. Ideally, I want an array of x and y values representing coordinates of the free surface (like a continuous, smooth curve). My initial approach was to scan the picture left to right, one column at a time, find an edge, move to the next column etc... That works somewhat ok, but fails as soon as the bubbles appear and my 'edge' splits in two. So I am wondering if there is some more sophisticated way of going about it.

If anybody have any expertise in the area of image processing/edge detection, any advice would be greatly appreciated.

Typical PIV image

Desired outcome

I think you can actually solve the problem by using morphologic methods.

A = imread('./MATLAB/ZBhAM.jpg');

figure;
subplot 131;
imshow(A)

subplot 132;
B = double(A(:,:,1));
B = B/255;
B = im2bw(B, 0.1);
imshow(B);

subplot 133;
st = strel('diamond', 5);
B = imerode(B, st);
B = imdilate(B, st);
B = imshow(B);

This gives the following result: 在此处输入图片说明

As you can see this approach is not perfect mostly because I picked a random value for the threshold in im2bw , if you use an adaptive threshold for the different column of your images you should have something better.

Try to work on your lighting otherwise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM