0

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

Web_Designer
  • 72,308
  • 93
  • 206
  • 262
Fryderyk
  • 1
  • 1
  • Can you try to be a little bit more clear in what you are after (like a paint edit of what you want to obtain exactly)? If I understood properly, it's not a trivial task to do. If you have lot's of images you could set it as a segmentation problem and eventually learning the segmentation from a manually labelled dataset. – R.Falque Feb 14 '16 at 16:19
  • @R.Bergamote I have added a paint edit of the sort of thing I'm after. You're absolutely right, it is not a trivial task. How would I go about setting it as a segmentation problem? Could you point me to some more info/references on this? I have tons of pictures like that, basically a camera takes around 12 pictures a second of the running experiment. – Fryderyk Feb 14 '16 at 21:00

1 Answers1

0

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: enter image description here

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.

R.Falque
  • 904
  • 8
  • 29