How to choose the right image filtering technique for my application

I am observing two droplets, one with a air bubble and one without an air bubble. The droplets are frozen and I watch the freezing process and track through time. Currently I send my black and white video (a snippet of it is attached as image.png) through an edge-detection filter in Matlab this filter is as follows:
B = edge(Frames,'canny',0.1);
The only problem with this "canny" method of filtering is that they leave too much noise inside the droplets, especially in the one with an air bubble. When I analyze with these filters, the noise interferes with my analysis of the freezing line and skews my data. As you can see in the "withotu bubble.PNG" file there is some noise around the freezing line and this noise is much worse in the "withairbubble.PNG" file that is attached. I want to know if there is a way for me to either remove or avoid all that noise surrounding the lines and only filter in the freezing line as it goes up.

Answers (1)

Then don't use edge detection. I see no reason why you'd want to use edge detection. And why can't you just throw out any droplets that have a bubble in them? Why even bother with them? Can't you just take another video, or not start recording if you see a bubble? Just record enough videos so that you have enough good videos even when you throw out the bad ones with air bubbles.

11 Comments

The droplets with air bubbles are part of the project, I have to observe their behavior and compare to droplets without air bubbles.
What other options do I have if I don’t use Edge detection?
Thresholding. What landmarks in the image do you need to locate? The outer edges of the blob?
I need to locate the outer perimeter of the droplet, so a semicircle shape; AND the freezing line inside of the droplet as it freezes over time. This line starts at the bottom and goes upwards over time until the droplet has completely frozen. Also, keep in mind that I will be doing this for numerous trials so the more of a blanket filter technique the better (like edge).
If I can clean up a lot of the insides of the droplets, I should be able to see the freezing lines more clearly and my data should be more reliable.
Didn't I make up code for detecting the freezing line in another question you posted?
Yes, but I am trying to improve my filtering process so that code can better analyze the freezing line as it moves up.
The cleaner the image the better your code works.
Can you mock up a photo to show what an "ideal" image would look like? And I still don't know what you think edge detection is gaining you. Let's say you didn't have the problem of too much noise inside the droplets with the Canny method - let's say it was ideal. THEN what would your edge image look like and how would you use that image to improve anything?
The Ideal image.jpeg is my "ideal" scenario. And the Raw image.png is the image I start with (it's a video so there will be thousands of frames but I can't upload all of that).
The "ideal" sketch shows what I want. The droplet on the left is without air and the one on the right is with air. The numbers next to the droplets represent an arbitrary time as time increases the freezing line goes up. The asterisk represents some sort of digital noise that will occur, most likely due to the air bubble in the droplet. I want to minimize this noise as much as possible.
Basically all I want is the outline of the droplet and freezing line as it moves up. I have been able to do this with droplets without air bubbles but it proves to be very difficult (maybe even impossible) with droplets with air bubbles in side. It is ok if my end product has the air bubble, as long as the freezing line is easily visible and distinguishable, I am fine. After all, that is all that I care about.
I would threshold, then take the two largest blobs. One is the base plate. The other is the droplet. For the droplet, I'd use bwconvhull() to create a mask for the droplet alone. Use the baseplate to define the zero y height. Then look inside the droplet mask area to determine the freezing line. Would that be the bottom, flat part of the bubble?
Hi, won’t thresholding the two droplets with something like Imbinarize and bwconvhull completely hide the freezing line?
I have written up some code using imbinarize and then bwconvhull but every frame I observe, the droplets are completely white and the background is black and freezing line is no where to be seen. Maybe I am misunderstanding your directions, here is my current piece of code:
F = read(Video,300);
a=graythresh(F);
BW= imbinarize(F,a)
CropBW=BW(1:329,1:1888);
CH = bwconvhull(CropBW,objects)
Your video just has one droplet in each frame, right? Not two like you had above. I assume you just stitched two different frames side-by-side.
No, my video has two droplets side by side, one with air bubble and one without; but that shouldn’t cause too many problems because I end up cropping the video into half and then analyzing each droplet individually.

Sign in to comment.

Asked:

on 19 Mar 2018

Commented:

on 26 Mar 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!