views:

258

answers:

4

I have a need to take an image of a series of glass test tubes, and automatically give an indication of either the level fo liquid in the tubes or the point at which the liquid reaches the bottom of the tubes. The image would probably be gathered by a webcam and processed on a standard PC. I have no restrictions on language or method, but I'll have to learn whatever it is.

I've found these more general questions on Vision on SO;

Does anyone know of any similar projects that are well documented that I could review, or other ideas / comments.

+7  A: 

If you do it with image analysis, the first thing is to get the best possible image quality. Webcam will probably do, but in addition you'll need some illumination. You want your image's background brightness to be equal everywhere and get rid of shadows, to help segmenting the image correctly. Possibly illuminating the tubes from the back could make sense.

It could be tricky - since your liquids and tubes are clear, the surface of the liquid might not be too well visible. You could also consider using ultrasound-based approach (measure the time of echo from the surface of the liquid).

Edit: one more idea: If the tubes are open from the top, why don't blow air over them, measure the pitch, and calculate the liquid level from that :-)

Joonas Pulakka
+! Good point on image and lighting. My first rule of vision is 'you can write a lot of software with light'.
kenny
Haha, well said Kenny :)
Joonas Pulakka
I would also maybe try using lighting outside the visible band (IR or UV). Depending on the type of liquid and container that could make it really easy to get find the liquid.
kigurai
Good idea! Just make sure the camera is able to see the wavelength you're using. It's more likely up to the lens/glass than the sensor.
Joonas Pulakka
a simple diffuse backlight would be fine to find the level of liquid. there are a lot of resaler for those kind of material. however, industrial grade hardware is expensive (but come in whatever shape, color, lightness, etc. you want)
Adrien Plisson
@kigurai: some (many) chemical liquids do not like IR or UV lightning... i would stay safe and keep with a standard light.
Adrien Plisson
@Joonas Pulakka: seeing a wavelength is up to the sensor. a standard CMOS or CCD sensor is generally sensitive to the near infra red (provided you remove the IR filter that generally comes bundled in front of the sensor), camera sensitive to other wavelength needs special sensors and tend to be more expensive. beware that an optical system is generally designed for visible light, and behaves differently with IR or UV lights (achromatism is particularly sensitive to the wavelength...)
Adrien Plisson
Sure, there's a limit to what wavelengths a sensor can see. I meant that typical (even cheap) cameras *do* see somewhat more than the visible spectrum, so it could be least worth trying. Of course it's a dirty hack even if it works, but... :-)
Joonas Pulakka
not a dirty hack at all, it is even pretty common to remove the IR filter to take advantage of this fact (also mounting a specific IR bandpass filter is common). but the additional bandwidth is almost always located on the IR side of the spectrum, and is quite limited: you would not implement a night-vision like system by taking advantage of this. in the case of the OP, the liquid will certainly not show much in the IR band that can't be seen in the visible band. but as always, it is only a question of lightning...
Adrien Plisson
+2  A: 

Hi,

Chesnokov-Yuriy wrote series of articles explaining image analysis in codeproject. He covers vast range of topics in all his articles. You should check this . he is really exceptional.

some of his articles, you can find useful

Cheers

Ramesh Vel

Ramesh Vel
+2  A: 

If you are looking for a free and open source too. OpenCV is a good choice and I would suggest C# as an easier thing to learn that C and this port which worked well for me. There are other ports for other languages as well.

There are good pay packages as well that may be easier for instance I've used MvTec's Halcon.

kenny
-1: Just having OpenCV in front of you won't help much unless you have an idea about what you want to do with it.Just because someone gives me a toolbox for professional mechanics does not mean that I can fix the engine in my car.
kigurai
+1  A: 

if the project is funded by a company (that is, it has an allocated budget), you should consider buying a "real" image processing library: matrox, cognex, halcon, national instruments... there are a lot of library provider. the advantage is that many tools already exists, especially concerning image registration and dimensional measurements. many even have kind of an IDE for prototyping the processing.

also consider buying a "real" camera: one with a decent CMOS or CD sensor. here again, there are dozens of providers. the difference between this and a webcam is the quality of the image. keep in mind that the resolution of the camera has a big impact on the resolution of the result. also, an good camera does not come with a lens, but you will find very good quality lenses (cosmicar/pentax are the best quality/price compromise), whereas a webcam is generally equipped with a very poor one-piece lens... lens type affect the distortion of the image, thus it affects the quality of the result.

any diffuse white-backlight should be perfect for lightning this product.

then, you can find a training in computer vision, or just find a mentor which knows how vision works and will guide you through the project.

Adrien Plisson
Actually, If the project had been slightly higher priority I would have done this, probably using National Instruments hardware and their Lab View GUI to prototype the software, in the edn I just winged it....
PaulHurleyuk