简体   繁体   English

MATLAB,气泡流中自由表面检测算法

[英]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). 我正在尝试找出一种从PIV图像中检测自由表面的算法(请参见附件)。 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). 理想情况下,我想要一个x和y值的数组,它们表示自由表面的坐标(如连续的平滑曲线)。 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 典型的PIV图像

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. 如您所见,这种方法并不完美,主要是因为我在im2bw为阈值选择了一个随机值,如果您对图像的不同列使用自适应阈值,则应该会更好。

Try to work on your lighting otherwise. 否则,请尝试在照明上工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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