Sunday, September 25, 2011

Lasers, speckle and sub-pixel interpolation


One task that benefits from sub-pixel interpolation is finding the midpoint of a laser line, typically if you’re doing “sheet-of-light” laser triangulation 3D-type work, (where a line is projected onto a surface from an angle and viewed from directly above, or the other way around.)

The problem I find though is that the laser line doesn’t look as good to the camera as it does to my eye. This is due to the speckle inherent in collimated laser light. One way to deal with speckle is to open up the lens aperture, creating a saturated line. But, if you then threshold the line, the edges are uneven, which means the calculated midpoint also wanders about. (Yes there are other approaches to finding the midpoint of the line, but I’m not going to go into them right now.)

This is discussed in an interesting machine vision tutorial written by one Jose Dolz, who is a rather smart computer vision expert from Spain. Under the heading “Subpixel Detection” Jose addresses morphological approaches to the laser line problem. If this is something you’re struggling with, take a look at his tutorial.

One downside of morphology is that it sucks up processing time, but there is an alternative: eliminate the speckle.

I touched on this back in May 2009 in “Dealing with laser speckle” which makes three suggestions, but more recently I’ve come across a fourth option: a “laser speckle reducer.” These clever gadgets are sold by Edmund Optics and they’re not cheap, but depending on how well they clean up your line, it might be money well spent. I’ve no experience with them so I can’t comment, but if you’ve used them I’d like to hear how that worked out.

3 comments:

Vladimír Držík said...

I have a few more notes on the speckle reduction:
1. Saturating the line is IMO not very good. By saturation, you just lose the subpixel information.
2. Opening the aperture is, on the other hand, good for speckle reduction (but without saturation). Due to the physical principle, the wider is the aperture, the smaller and less contrasty is the speckle grain.
3. There are laser pattern generators on the market with reduced speckle. I know about ones from Lasiris and Z-Laser. These are about 2-3 times more expensive than regular ones, but might be worth the money for high-precision applications.

Spencer Luster said...

Another method of speckle reduction that is used with diode lasers is to deeply modulate the drive current at high frequency.(But stay above the lasing threshold.) The idea is to force many laser modes to operate during one camera exposure time, thus decreasing the laser coherence length and therefore the speckle. This may be what the reduced speckle Lasiris and Z-Laser units are doing.

Besides making sure there is at least one full current modulation cycle during a camera exposure time, the shape of the modulation is important. You want many laser modes to operate, so use a sine wave or possibly triangle wave modulation. A square wave allows fewer modes.

Spencer

Anonymous said...

While they may not have the intensity of a laser at this point in time, structured LED lights do not suffer from the speckle that lasers do. There are several companies making structured LED lights. The concept is to use an LED filtered by a photographic mask, which can be made into many different patterns, and then focus it using a standard C-mount lens. The pattern is more dense than a laser but can be just as defined. The focal length of the lens and the working distance defines the fan angle of the light.