10-21-2008 03:56 AM
Hello,
I'm trying to detect a fluid drop / coating with a camera and LV.
But I'm having problems isolating the drop from the background.
(see attachement)
I've tried different things like increasing contrast, using edge filters and so on. But in the end all these things also increase noise, although I'm using median or gaussian filters. It just won't work.
Any ideas on how to solve this problem?
10-21-2008 06:57 AM
Hi rouven84,
you can move the histogram to get a better contrast.
Mike
10-21-2008 07:34 AM
thanks mike.
what do you mean by "moving" the histogram?
The problem is, that every step I've tried in order to increase the contrast, also added additional noise to the image, so that I could not threshold or find edges by using sobel properly.
10-21-2008 10:24 AM
10-21-2008 11:17 AM - edited 10-21-2008 11:18 AM
Yes, contrast is very low, but you can separate your drop from the background. Another question - how stable this will work for different drops, but anyway script in attachment.
Median filter with small kernel will help you to eliminate the noise a little bit, then threshold and some morhpological processing for removing small particles:

Also the problem, that background have gradient. You should probably change lighting conditions, or if it impossible, but gradient always the same, you can prepare reference image without drop and then simple subtract this background from your image.
Andrey.
10-22-2008 12:41 AM
Hello AnalogKid,
I'm using backlighting atm. Of course, I can change the lighting conditions and I've already tried some different lighting angles and sources.
The drop is on a glass slide, so I could also try injecting the light into the side of the glass, as you said. I'm going to try that now...
@Andrey:
Thank you, too, for your help and script. Basically, the steps you processed on the image are the ones, I've already tried. But your result seems much butter. I'm going to test your script and report the results later.
The only problem I'm seeing, is, that median filter could take too long to process, as I'm planing to process about 5 images / sec. in real time later on.. but we will see. 🙂
Thanks so far! I'll post the results later!
10-28-2008 01:32 PM
One thing that may help is either some color filters for your lighting or lens, or both. Even if you're using a B&W camera, color filters can do a lot to enhance a low contrast image.
Another thought might be to use a black light. Depending on the fluid you're inspecting, it might be helpful.
Good luck.
10-30-2008 10:47 AM
Lighting, lighting, lighting.
If you can light from the front, try a low angle ring light (assuming the drop has some height.) If you must use a backlight, see what IR would do (remember to remove the IR filter from the camera, if you have one.)
10-06-2010 09:18 PM
10-07-2010 12:53 AM
@melo_xu wrote:
My labview does't have the vi about median filter, but now I need this function. So can you give it to me? Thanks a lot!