LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I determine the liquid level in a bottle (LabView Vision)?

How can I determine the liquid level in a bottle (LabView Vision)? Does anybody have an example code? The task is, that if liqid level is between two predetermined level, the program writes, that it is correct else it writes incorrect. Thank you.

0 Kudos
Message 1 of 6
(4,908 Views)

I would suggest camera, backlight, and using a rake to find the line in a predefined ROI.  This is a very simplified answer but is one way to do it with vision.  Without MUCH more detail I cant answer this (IE is the bottle clear, what hardware do you have....) there are also other liquid level sensors you can consider in addition to vision.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 6
(4,900 Views)

I only open a picture, I don't use camera, camcorder, etc. I have attached an example picture.

0 Kudos
Message 3 of 6
(4,891 Views)

Well, reading the first part of the subject I would have proposed a balance.....

 

Doing it with a camera/picture  is easy when you have a reproducible setup.

And since you measure with light, you should have the best possible control over the light.

You want a good contrast...

 

Will the bottle always be of the same type/shape?


Will the liquid always be the same (transparent/water?)

 

Can you place it always at the same position?

 

Play with different backgrounds / lightsources

 

Next is the software: There is a vision addon for labview to program the detection.

Usual steps:

detect bottle

align to bottle

detect level ( detect a horizontal line (contrast change) in a field of view )

 

 

EDIT: Usually you try to have a good focus 😉

 

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 6
(4,849 Views)

For image analysis applications, at least 50% of the functionality is already provided by the way of the image aquisition.

As the previous posters already pointed out, you have to make sure that the image has the best focus you can achieve in terms of:

- Contrast

- Sharpness

- Resolution

- Size

 

To be more precise on "Resolution": You dont need the highest resolution. You need a camera with sufficient resolution in order to acquire images which are not blurry.

"Size" refers to the fact that you want to acquire only the object of interest, in your case the bottle. Anything else is waste of data and resolution, hence you have to make sure that your optics alow to zoom in on the bottle only.

 

Contrast is usually best achieved by proper lighting and using a black/white camera only.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 6
(4,834 Views)

here is a little play with your bad picture:

edge.jpg

 

used only the small field of interest (here a guess) ,

used only the red channel ( takes out most of the light reflection)

edge cut filter.png

grey scale, 3x(blurr, median filter) , played with  contrast -gamma - saturation

edge red channel to grey - saturation- gamma-contrast.png

 

now you need to add the edge detection and some sort of scale.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 6
(4,804 Views)