Laser Line Detection with Sub-Pixel Accuracy

Due to the fact that the image sensors have a fixed resolution and pixel size – a lot of image processing algorithms are limited with pixel resolution. One of those image processing algorithms is related to 3D laser scanners and in particularly to the laser line detection from images. This pixel quantization resolution, however, in many cases is not sufficient and greatly limits the laser scanner precision. In particularly the problem is highlighted in the linearly growing or declining surfaces, but also in strait lines where the actual laser line centre position is between two pixels. In this paper two laser line centre position detection methods with sub-pixel accuracy have been proposed and investigated. The methods have been tested on real images and as seen from the results at the end of the paper, the methods greatly improve the laser line detection accuracy and resolution. DOI: http://dx.doi.org/10.5755/j01.eee.20.5.7114

1 Abstract-Due to the fact that the image sensors have a fixed resolution and pixel size -a lot of image processing algorithms are limited with pixel resolution.One of those image processing algorithms is related to 3D laser scanners and in particularly to the laser line detection from images.This pixel quantization resolution, however, in many cases is not sufficient and greatly limits the laser scanner precision.In particularly the problem is highlighted in the linearly growing or declining surfaces, but also in strait lines where the actual laser line centre position is between two pixels.In this paper two laser line centre position detection methods with sub-pixel accuracy have been proposed and investigated.The methods have been tested on real images and as seen from the results at the end of the paper, the methods greatly improve the laser line detection accuracy and resolution.

I. INTRODUCTION
Many laser line detection algorithms [1], [2] for 3D laser line scanners detect the laser line with pixel resolution.This is mainly related to the fact that the camera sensor, capturing the laser line image, has a fixed resolution and pixel size.In one aspect-the theoretical limit for the spatial resolution is determined by the Nyquist-Shannon sampling theorem.Changes at higher frequencies, than the half of the sample rate cannot be accurately detected.The laser line is typically 1 to 10 pixels wide, in real images of interest.This one pixel accuracy however is not sufficient in many cases, if going into sub-millimetre measurements with line laser scanners.The accuracy of the laser scanner is directly related to the precision of the laser line detection algorithm and in many cases the actual laser line centre position is located between two pixels.This is highlighted particularly in a linearly growing or declining surfaces, but also on very rough surfaces as for example the pavement surface with small rocks.
Several laser line sub-pixel detection methods exist.Some of them are proposing to first detect the laser line edges [3] and then to estimate the real laser line centre position with interpolation.Furthermore, sub-pixel edge detection [4] by cubic interpolation has been also proposed to enhance this method.Unfortunately this method can produce inaccurate results, when laser scattering can cause asymmetric laser line profile with non-precise edge positions.This can cause the mathematical mean point of the laser line to deviate from the actual laser line centre.The proposed methods take into account also the intensity profile and thus are less dependent of the laser line edge positions.
Other methods [5] propose to detect the laser line centre position with sub-pixel accuracy by calculating the weighted average of the "brightest" pixel coordinates in each column.This method can still cause inaccurate results, if the laser line peak has a flat top and uneven number of brightest pixels.The result in this case is also affected by the fact, how many pixels are chosen as "brightest" pixels and where the threshold level has been set.
As known, cross-section of the laser line is similar to the Gaussian distribution from the image pixel intensity perspective.Thus Gaussian profile fitting is also a popular method [6] to detect laser line centre position with sub-pixel resolution and accuracy.With this method, however, a maximum position of the fitted Gaussian profile is detected instead of the actual laser profile peak position.This can lead to inaccurate results when the laser line width is changing.In case, if the laser line has multiple peaks a specially modified Gaussian function has to be used.
To detect real centre position of the laser line with subpixel accuracy we have proposed two new methods to find the best method for accurate laser line centre position detection with sub-pixel accuracy.Firstly a method is proposed, where laser line detection method (inverted second order Gaussian derivate kernel convolution to the laser line brightness profile) is combined with the sub-pixel correction estimation of the convolution maximum by parabola.Secondly a robust method to upsample the image before laser line detection has been proposed, improving also the laser line detection results to sub-pixel accuracy, compared with the original image.
The proposed methods have been tested on real life images and the results show, that these methods improve the laser line detection accuracy, to the sub-pixel level.

II. LASER LINE SUB-PIXEL DETECTION BY CONVOLUTION MAXIMUM CORRECTION WITH PARABOLA
The inverted second order Gaussian derivate is used for the Laser Line Detection with Sub-Pixel Accuracy laser line extraction as a kernel for convolution to the brightness (e.g.grey value) profile.The convolution is calculated for every image column to detect the position of the laser line with pixel accuracy.Figure 1 shows the laser line grey value profile and its convolution results with optimal inversed Gaussian second order derivate kernel.As seen from Fig. 1(a) the actual grey value profile is rather flat in the laser line centre position.The convolution maximum was found on the 1025 of pixel row.By looking the convolution curve Fig. 1(b) around the maximum area more closely, it can be seen, that the top of the curve is not symmetrical.
To estimate the real centre position of the laser line a point before the maximum (x1, y1), the maximum point (x2, y2) and one point after the maximum (x3, y3) can be taken.With those points it is possible to find a parabola equation that passes through all these points.By solving the system: the constants a, b and c can be easily found: )) )

III. IMAGE UPSAMPLING METHOD
One efficient approach to increase the laser line resolution and thereby the accuracy is to upsample the images.After upsampling the image, the laser line can be found in subpixel accuracy compared with the original image.Many algorithms exists [7] to upsample the image, using different methods.Many image editing software like Irfanview and image processing libraries like OpenCV already include those different upsampling methods, making this quite robust and easy method to implement.Figure 3 shows a laser line image before upsampling and Fig. 4 after the upsampling.After upsampling the image, the laser line is detected with the proposed variable width laser line detection method.

IV. RESULTS
To verify the proposed methods they were tested on several real life images.Laser lines were extracted with pixel and then with sub-pixel resolution (and accuracy).In particularly, as the problem is especially highlighted in the linearly growing or declining surfaces, but also in strait lines where the actual laser line centre position is between two pixels, those part of our test images were selected to verify the proposed methods.First the convolution maximum correction with parabola method was tested.Figure 5 shows a linearly growing laser line and a detected laser line with pixel accuracy and Fig. 6 with sub-pixel accuracy.It can be visually that our method has improved the laser line detection accuracy.
Secondly the upsampling method with the same image was tested.For comparison purpose the same image region of interest was selected to verify the method.Figure 7 shows for demonstration the detected laser line with upsampled image.It is clearly visible, that the upsampling method also improves the laser line detection accuracy.Furthermore the results seem similar or even better to the first proposed method.
For experimental purposes the convolution maximum correction with parabola method was also tested on upsampled image.Figure 8 shows the result of this combined method.It can be seen, that the accuracy has been improved, compared with the upsampled pixel accuracy image.The disadvantage of these upsampling methods is that the upsampling increases the number of pixels with the power of the upsampling level selected.This in turn decreases the laser line detection speed and increases the required processing power, which is often critical in real time systems.The speed decrease can be compensated with adaptively undersampling the image, as proposed by our previous works.Finding the optimal up and down sampling level is probably the key element of this method.
Figure 9 and Fig. 10 presents 2 laser line sections (laser line on fairly straight (few pixel fluctuations over 2 meters) floor surface and on linearly declining surface) detected by pixel and sub-pixel accuracies from original and upsampled image.It can be seen from Fig. 9 and Fig. 10, that all of the proposed methods improve the laser line detection accuracy.
In order to assess the real improvement the methods are compared to reference.It is known that in the real world both those laser line sections (linearly declining surface and strait floor surface) are straight (ideal) lines.By fitting the ideal line through the detected laser line points for every method the deviation from the ideal line can be found.This indicates how good the method is compared to the originally pixel accuracy method from original image.The less deviation from the ideal line the better the method.Figure 11 shows the deviation in pixels from the reference (ideal) line at position 0 on linearly declining surface.It can be seen that in case of pixel accuracy method from the original image Fig. 11(a) the deviation varies from 1 to -1, while all the proposed methods Fig. 11(b)-Fig.11(d) deviate much less in between 0.6 to -0.6.Root Mean Square Error (RMSE) was calculated for all the methods which were fitted with ideal lines for both line sections (declining surface and straight floor surface).Average RMSE for the both line section was calculated.It can be seen from the Table I that all the methods have improved the laser line detection.The RMSE has decreased more than 20 % for all the proposed methods.The most accurate method is the pixel accuracy method from the upsampled image.The RMSE has decreased more than 25 % compared to original image for this method.
Taking into account, that if using the upsampling method the pixel count is increased by the power of the upsampling level selected and thus the needed processing power increases also, the first proposed convolution maximum correction with parabola method seems to be more reasonable for fast and precise imaging systems.V. CONCLUSIONS This paper presents two laser line detection algorithms with sub-pixel resolution and accuracy.The methods have been described and the Matlab model has been created.The methods were tested with real life images.The detected laser lines were compared with reference (ideal) line for every method and the RMSE was calculated.The results show visually and by RMSE that all the proposed methods have improved the laser line detection accuracy to subpixel level.

1 .
Laser line cross section grey value profile (a) and convolution curve with inversed Gaussian second order derivate kernel (b).

Fig. 5 .
Fig. 5. Detected laser line with 1 pixel accuracy from original image.

Fig. 7 .
Fig. 7. Detected laser line from upsampled image with its pixel accuracy.

Fig. 9 .
Fig. 9. Detected laser line on fairly strait floor surface with pixel accuracy form original image (a), sub-pixel accuracy with convolution maximum correction method from original image (b), pixel accuracy from upsampled image (c) and sub-pixel accuracy with convolution maximum correction and upsampling method combination (d).

Fig. 10 .
Fig. 10.Detected laser line on linearly declining surface with pixel accuracy form original image (a), sub-pixel accuracy with convolution maximum correction method from original image (b), pixel accuracy from upsampled image (c) and sub-pixel accuracy with convolution maximum correction and upsampling method combination (d).

Fig. 11 .
Fig. 11.Deviation from the ideal line at position 0. Pixel accuracy form original image (a), sub-pixel accuracy with convolution maximum correction method from original image (b), pixel accuracy (sub-pixel accuracy compared to original image) from upsampled image (c) and subpixel accuracy (sub-sub-pixel compared to original image) with convolution maximum correction and upsampling method combination (d).

TABLE I .
RMSE OF METHODS BY IDEAL LINE FITTING.