Subpixel laser line center detection

I am developing a simple “laser line” scanner using C ++ and OpenCV. So far I can detect the center of the laser line with an accuracy of 1 pixel, so I have a starting point for a possible subpixel function / algorithm. (laser line length is 15-20 pixels)

Now I'm interested in refining this to subpixel accuracy. I know that OpenCV has some sub-pixel detection functions, but as far as I know, they are only for detecting angles.

If anyone has any suggestions, I would like to hear them.

Some information;

  • System: QT Framework, C ++, OpenCV library

  • Camera; Monochrome (no color) equipped with a red filter

  • Image resolution; 2560 x 1920

  • Note. Only 1 image will be analyzed for the laser line.

+4
source share
1 answer

There are two main methods that I used with good results:

  • Easy: on one frame, the threshold and find the area containing the image of the laser strip, then set the parabola to the intensity of saturated pixels in a small interval (5-7 pixels, depending on how well your focus is) around the maximum intensity in each row of images. Your substitution procedure should have a robustifier, since the outliers are likely to be, for example, near an area of ​​the scene with significant specular reflection.

  • Stiffer but more accurate if your camera’s frame rate is high enough (or the beam moves slowly enough): Curless spatio-temporal analysis .

A search for a “subpixel laser fitting” returns a few more recent results.

On the practical side, pay close attention to saturation: the exposure time (or lens aperture) should ensure that your sensor does not become saturated even when the beam hits the lightest parts of the surface of the object. Finding a peak in the area where the signal has been cut off by saturation is clearly pointless.

Focusing (and depth of field) are other areas that you need to pay attention to - a blurry image of the beam on the surface of the object will give an offset peak.

+7
source