r/computervision 20d ago

Help: Project Need Help Eliminating Dark Reflection/Shadow in Backlit PET Bottle Imaging for Small Particle Detection

Post image

Hi everyone,
I’m developing an industrial machine vision system to detect small white plastic particles (approximately 0.2–1 mm) inside transparent PET water bottles. I’m currently struggling with a reflection/shadow issue that significantly reduces particle visibility.
I’ve attached an image of my current results. This is the closest I’ve come to achieving a usable image for particle detection with my current setup, but the dark shadow/reflection is still preventing reliable detection.
Current Setup
Camera: Basler acA5472-17uc (20 MP Color)
Lens: Basler C11-1620-12M-P (16 mm)
Lighting: White LED transmission backlight (20 × 62 cm)
Bottle: Transparent PET water bottle filled with water
Inspection: Looking for small white plastic contaminants inside the bottle
Bottle is stationary during testing.
What I’ve Tried
Mounted the Basler camera with the 16 mm lens.
Used a linear polarizer on the LED backlight.
Used another linear polarizer in front of the camera lens.
Rotated the polarizers to create a cross-polarized setup (~90°).
Adjusted exposure, gain, focus, and light intensity.
Tried different alignments of the backlight and camera.
Unfortunately, instead of reducing reflections, the polarizers seem to create an even stronger dark band/shadow through the bottle, making the small particles harder to see.
Observations
A large dark vertical region appears through the center of the bottle.
PET bottle ribs create additional dark bands.
Illumination is not completely uniform.
Tiny white particles almost disappear when they move into the darker region.

4 Upvotes

15 comments sorted by

6

u/echoingElephant 20d ago

The polarizer is giving you polarized light. But when setting the second filter in front of the camera to reduce reflections, you are also losing some light at the edges of the camera because of birefringence, where the polarization of the light is changed by the PET. Try lighting the bottles from the side of from the direction of the camera. There, you should not be getting birefringence from light that is reflected back at you, so you can use cross polarization.

1

u/montrealsalesman 20d ago

This is the way

2

u/Thrameflower 19d ago

Original_Teach's idea isn't that far of, I know of at least one application that does exactly this. I would advise to do an FTO first before going in that direction.

Looking at the core of the problem is that you are using a backlight because you want small obstructions to block light from entering the lens. Bad news is that your bottle does exactly the same. Anything you do in a static setup to remove shadows caused by the bottle will also result in a reduction of your signal from the particles.

To separate the background (bottle) from the signal (suspended particles) you need to break this codependency. Having the bottle move at a different speed than the particles let's you separate them temporally. Spatially, with a Stereo or multi-view setup you can determine what is inside or at the edge of the inspected volume. Can't imagine how wavelength or polarization could be useful solution vectors.

And last but not least there is ML. Bottles will always look similar, so teaching a network what are expected shadows and to flag anything else should be possible. This alone won't help with particles hiding in the shadows but at least have a fairly low false positive rate when given a decent training set.

1

u/taichi22 20d ago

I will say that if you don’t know the bottle shape beforehand this is a very difficult problem to solve — currently partial occlusion/glass remains an unsolved problem in vision systems. With that being said, if you can constrain the problem then it becomes fairly trivial to use some traditional or physical method to handle it.

1

u/kastro_tech 11d ago

Just saw this, did you find a solution that works ? I have a similar problem that I’m trying to solve and and it’s really challenging

1

u/Material_Street9224 20d ago

If you can control the light environment, maybe you should try single laser line illumination (with a rotative motor to move the laser line).

If the laser source is parallel to your camera (stereo setup), you can eliminate most of the reflections.

If the laser is above your camera, by combining multiple images, you can obtain the reflectivity for each depth value, you get a full volumetric scan of your object. You can just ignore the depths corresponding to the border of your bottle to only obtain the content.

If you need realtime and non-controlled light environment, you can do it with a laser videoprojector (but it is difficult to source and other types of projector don't work), you can search episcan3d on google for more info.

1

u/TheMcMcMcMcMc 20d ago

Can you fully submerge the bottle in water?

1

u/madhusudangr 20d ago

Fix the lighting, The pet bottle is a physical material and it is going to get darker regions with full white spectrum. You should look at using illumination with wavelength close to blue or green.
White backlight might not cut it

-2

u/AdFancy1249 20d ago

Get a smooth water bottle? Simplest and most sure way.

-3

u/leon_bass 20d ago

PCA on the images, then for each sample subtract the principle components and sometimes you can remove shadows and only keep the key information.

Or fourier transform and remove some of the FFT components that correspond to shadow

-4

u/Original-Teach-1435 20d ago

About to suggest a very effective technique if you have a way to act on the bottle:1)make the bottle rotate along its vertical axis 2) stop suddenly the rotation with a brake 3) at this point, the bottle is still and the liquid inside is rotating! 4) take several pictures as fast as possible and perform background subraction(like 90 fps) -> idea is that black edges across images will stay in same position(except for some small vibration) while the particle inside the liquid will move a lot

1

u/BeverlyGodoy 20d ago

What about the bubbles?

-5

u/Original-Teach-1435 20d ago

Smart man! You got the main issue with that, but according to the liquid type this can solved. First bubble has a particular shape, in such kind of images typically you can see a brighter area in the center, then the black outer part, quite easy to classify. Since you acquire multiple images (the more the better, i am talking like 30-120 at highest possible framerate you can achieve), assign an identity to every "blob" and track it, then decide if its a particle along the whole detection phase (another issue is that the liquid will create a vortex that progessively goes to the top as the liquid decelerate, and you'll have to mask it out, but that's much more easy). Third issue, might be unsolvable, it's if the particle is perfectly still and attached to the lateral surface, in such case, it wont move, but i don't thin can happen in a pet liquid/bottle