Centerline extraction method of line structured light strip

The proposed method enhances the precision and speed of laser stripe centerline extraction by combining global thresholding, an improved Steger algorithm, and least squares fitting, addressing the limitations of existing methods.

CN115493495BActive Publication Date: 2025-05-09SHANGHAI INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211187515.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-05-09
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

Existing methods for extracting the centerline of laser stripes in line structured light three-dimensional vision measurement are either fast but inaccurate, or accurate but slow, and are prone to environmental interference.

Method used

A method involving global thresholding, improved Steger algorithm, filtering short line segments, least squares fitting, and double least squares re-fitting to enhance the accuracy and robustness of centerline extraction.

Benefits of technology

The method achieves high precision and speed in extracting laser stripe centers, improving the accuracy and robustness against environmental interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115493495B_ABST
    Figure CN115493495B_ABST
Patent Text Reader

Abstract

The present invention provides a method for extracting the center line of a line structured light strip, comprising: S1, performing global threshold processing on an image; S2, using an improved Steger algorithm to process the image obtained in step S1 to obtain the center line of the laser stripe in the image; S3, filtering out the shorter center line of the laser stripe obtained in step S2; S4, using the least squares method to perform straight line fitting on the center line of the stripe after step S3, and screening out the straight line that meets the conditions; S5, matching the collinear center line from the fitted straight line obtained in step S4, and then refitting the collinear center line using the least squares method; S6, re-correcting the coordinates of the line point through the fitted straight line obtained in step S5, and the coordinates of the line point after correction are the final coordinates of the center line point of the stripe. The present invention improves the accuracy of extracting the center line of multi-line structured light stripes, has a wide range of applications, and the accuracy of restoring the three-dimensional structure of an object using the center line obtained by the present invention is also guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for extracting a center line of a line structure light strip. Background Art

[0002] As an effective optical measurement method, line structured light 3D vision measurement technology has the advantages of non-contact, high accuracy and good real-time performance. It is widely used in industrial production, reverse engineering, computer vision and other fields. Extracting the center coordinates of the light stripe image is the key to line structured light 3D vision measurement technology. The light stripe image contains the 3D topography information of the surface of the measured object and is the basis for obtaining the 3D coordinates of the measured point. The deviation of the light stripe center line coordinate extraction will directly affect the accuracy of the 3D coordinates of the measured object.

[0003] At present, the most commonly used methods include extreme value method, grayscale centroid method, curve fitting algorithm, etc. The extreme value method and grayscale centroid method are fast in extracting the center line of laser stripes, but their stability and accuracy are poor, and they are easily disturbed by the environment. Although the curve fitting method has high accuracy, high stability, and good robustness, it has a slow detection and extraction speed and is not suitable for the detection of laser stripes in complex situations. Summary of the invention

[0004] The purpose of the present invention is to provide a method for extracting the center line of a linear structured light strip.

[0005] In order to solve the above problems, the present invention provides a method for extracting the center line of a linear structured light strip, comprising:

[0006] Step 1: Perform global thresholding on the image to obtain the processed image.

[0007] Step 2: Using the improved Steger algorithm, the center line of the laser stripes in the processed image is preliminarily obtained.

[0008] Step 3: Filter out the shorter line segments obtained in step 2 to obtain the longer laser stripe center line in the laser stripe center line.

[0009] Step 4: Use the least squares method to perform straight line fitting on the longer laser stripe center line obtained in step 3, and then select the fitting straight line that meets the preset conditions.

[0010] Step 5: Match the collinear center line from the fitted straight line that meets the preset conditions obtained in step 4 and re-fit it using the least squares method to obtain a second fitted straight line.

[0011] Step 6: The coordinates of the line points are recalibrated using the second fitting straight line obtained in step 5. The coordinates of the line points after calibration are the coordinates of the center line points of the stripes.

[0012] Furthermore, the global thresholding calculation formula in step 1 is:

[0013] ,

[0014] Where f(x, y) is the pixel value at the image coordinate (x, y), g(x, y) represents the pixel value after thresholding, and T is the set threshold.

[0015] Furthermore, the steps of the improved Steger algorithm in step 2 are as follows:

[0016] (2-1): Find the pixel values ​​of each image. , , , and , the calculation formula is as follows:

[0017] ,

[0018] in represents the first-order partial derivative of the image along x, and Similarly, represents the second-order partial derivative of the image along x, , and Similarly, G(x,y) is a two-dimensional Gaussian function, and g(x,y) is a one-dimensional Gaussian function.

[0019] (2-2): Use the Hessian matrix to calculate the eigenvalues ​​and eigenvectors. The eigenvector corresponding to the maximum eigenvalue of the Hessian matrix corresponds to the normal direction of the light strip. and The Hessian matrix is ​​expressed as:

[0020]

[0021] (2-3): Point As the standard point, the second-order Taylor expansion of the grayscale distribution function of the stripe cross section is performed to obtain the sub-pixel coordinates of the center line of the light stripe , where t is calculated as follows:

[0022] ,

[0023] Furthermore, in (2-1), each point is repeated 5 times ( , , , and ) Two-dimensional Gaussian convolution leads to low computational efficiency and reduces the real-time performance of the system. Therefore, the separability and symmetry of Gaussian convolution can be used to decompose the two-dimensional Gaussian kernel into one Gaussian row convolution and one Gaussian column convolution, reducing the amount of computation from 5n 2 The number of multiplication and addition operations is reduced to 10n multiplication and addition operations.

[0024] Furthermore, in step three, the line segments with fewer points are filtered out by setting an initial threshold of 10.

[0025] Furthermore, the conditions for selecting the fitting straight line in step 4 are as follows: (1) the number of line points of the fitting straight line cannot be less than 80; (2) the number of line points that deviate from the fitting straight line cannot exceed 2, and the judgment condition for whether it deviates from the fitting straight line is: the distance d from the line point to the fitting straight line cannot exceed 1 mm.

[0026] Furthermore, the conditional formula for determining whether the straight lines are collinear in step 5 is:

[0027] ,

[0028] in, , They represent the slopes of the two straight lines, ( , )、( , ) represent the coordinates of the midpoints of the two lines.

[0029] Furthermore, the formula for correcting the line point coordinates in step 6 is:

[0030]

[0031] in, To correct the coordinates of the previous point, are the coordinates of the corrected point.

[0032] In summary, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0033] (1) The present invention adopts full-time thresholding processing to obtain a preliminary denoised image. After the Steger algorithm is operated, a threshold is set to filter out some isolated line segments on the image. Through double denoising processing, the anti-noise ability is improved.

[0034] (2) The present invention adopts an improved Steger algorithm, which has a higher speed than the traditional Steger algorithm.

[0035] (3) The present invention adopts the Steger algorithm, and the pixel accuracy extracted reaches the sub-pixel level.

[0036] (4) The present invention uses the least square method twice to fit the line segments, and uses the final fitted straight line to correct the coordinates of the line points, thereby reducing the errors of the line points and greatly improving the accuracy of the fringe center line.

[0037] (5) In summary, the light streak center extraction algorithm of the present invention combines double denoising, improved Steger algorithm, least squares straight line fitting, and coordinate correction processing, which greatly improves the extraction accuracy of line point coordinates, while also improving the extraction speed and the ability to resist environmental interference. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is the laser stripe image to be processed;

[0039] Figure 2 is the laser stripe image after threshold processing;

[0040] Figure 3 This is the centerline image of the laser stripe extracted by the Steger algorithm;

[0041] Figure 4 This is the center line image of the laser stripes extracted by the present invention. DETAILED DESCRIPTION

[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0043] The Steger algorithm has high accuracy and stability, but the amount of calculation caused by convolution is huge, and it is difficult to accurately extract the center line in an environment with complex environmental interference, reflection, and laser stripe width changes. Therefore, designing a fast and high-precision stripe center line extraction algorithm is a technical problem that needs to be solved.

[0044] This embodiment is based on a method for extracting the center line of a line structured light strip, and mainly includes the following steps:

[0045] Step 1: Global Thresholding

[0046] like Figure 1 As shown, the background plate of the laser stripes is a 15*9 chessboard. In order to avoid the interference of the background plate on the extraction of the laser stripe center and reasonably distinguish the background plate and the laser part, a global threshold processing method is adopted to better extract the center line of the laser stripes in the future. Figure 2 is the laser stripe image after global threshold processing. The formula of the global threshold processing method is:

[0047] ,

[0048] Where f(x, y) is the pixel value at the image coordinate (x, y), g(x, y) represents the pixel value after thresholding, and T is the set threshold.

[0049] Step 2: Preliminary extraction of laser stripe centerline based on improved Steger algorithm

[0050] Find the pixel points of the image , , , and , the calculation formula is as follows:

[0051]

[0052] in, represents the first-order partial derivative of the image along x, and Similarly, represents the second-order partial derivative of the image along x, , and Similarly, G(x,y) is a two-dimensional Gaussian function, and g(x,y) is a one-dimensional Gaussian function.

[0053] In order to reduce the amount of calculation, the separability of Gaussian convolution is used to convert the above five two-dimensional convolutions on image pixels into ten one-dimensional convolutions.

[0054] The Hessian matrix is ​​used to calculate the eigenvalues ​​and eigenvectors, where the eigenvector corresponding to the maximum eigenvalue of the Hessian matrix corresponds to the normal direction of the light strip. and The Hessian matrix is ​​expressed as:

[0055] ,

[0056] By point As the standard point, the second-order Taylor expansion of the grayscale distribution function of the stripe cross section is performed to obtain the sub-pixel coordinates of the center line of the light stripe , where t is calculated as follows:

[0057] ,

[0058] Step 3: Filter out the shorter stripe center lines obtained in step 2.

[0059] Figure 3This is the center line image of the laser stripe extracted by the Steger algorithm. After the Steger algorithm, each center point is classified into multiple straight line segments. In order to remove isolated line segments and reduce unnecessary calculations, a threshold of 10 is set to remove straight line segments with less than 10 points.

[0060] Step 4: Use the least squares method to fit the center line of the stripes, and then filter out the straight lines that meet the conditions.

[0061] The conditions for screening the fitting straight line are as follows:

[0062] (1) The number of points of the fitted line must not be less than 80;

[0063] (2) The number of line points that deviate from the fitted straight line cannot exceed 2. The criterion for determining whether a line deviates from the fitted straight line is that the distance d from the line point to the fitted straight line cannot exceed 1 mm.

[0064] Step 5: Match the collinear center line from the fitted straight line and refit it using the least squares method

[0065] The conditional formula for judging whether the straight lines are collinear is:

[0066] ,

[0067] in, , They represent the slopes of the two straight lines, ( , )、( , ) represent the coordinates of the midpoints of the two lines.

[0068] Step 6: Use the fitted straight line to recalibrate the coordinates of the line points.

[0069] The correction formula is:

[0070] ,

[0071] in, To correct the coordinates of the previous point, are the coordinates of the corrected point.

[0072] After correction, the center line of the laser stripe is as follows Figure 4 shown.

[0073] The present invention improves the accuracy of extracting the center line of multi-line structured light stripes, has a wide range of applications, and the accuracy of restoring the three-dimensional structure of an object using the center line obtained by the present invention is also guaranteed. The present invention can improve the accuracy and speed of extracting the center line of multi-line structured light stripes.

[0074] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0075] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0076] Obviously, those skilled in the art can make various changes and modifications to the invention without departing from the spirit and scope of the invention. Thus, if these modifications and variations of the invention fall within the scope of the claims of the invention and their equivalents, the invention is also intended to include these modifications and variations.

Claims

1. A method for extracting the center line of a linear structured light strip, characterized in that: include: Step 1: Perform global thresholding on the image to obtain a processed image; Step 2: Using the improved Steger algorithm, the center line of the laser stripe in the processed image is obtained; Step 3: Filter out the shorter laser stripe center lines among the laser stripe center lines obtained in step 2 to obtain the longer laser stripe center lines among the laser stripe center lines; Step 4: Use the least square method to perform straight line fitting on the longer fringe center line obtained in step 3, and then select the fitting straight line that meets the preset conditions; Step 5: Match the collinear center line from the fitted straight lines that meet the preset conditions obtained in step 4, and then re-fit the collinear center line using the least squares method to obtain a second fitted straight line; Step 6: Use the second fitting straight line obtained in step 5 to recalibrate the coordinates of the line point. The coordinates of the line point after calibration are the final coordinates of the center line point of the stripe. The steps of the improved Steger algorithm in step 2 are as follows: (2-1): Find the pixel values ​​of each pixel in the processed image , , , and , the calculation formula is as follows: , in, represents the first-order partial derivative of the image along the x-axis, represents the first-order partial derivative of the image along the y-axis, represents the second-order partial derivative of the image along the x-axis, , and Similarly; G(x,y) is a two-dimensional Gaussian function, g(x,y) is a one-dimensional Gaussian function; (2-2): Use the Hessian matrix to calculate the eigenvalues ​​and eigenvectors. The eigenvector corresponding to the maximum eigenvalue of the Hessian matrix corresponds to the normal direction of the light strip. and The Hessian matrix is ​​expressed as: , (2-3): Point As the standard point, the second-order Taylor expansion of the grayscale distribution function of the stripe cross section is performed to obtain the sub-pixel coordinates of the center line of the light stripe , where t is calculated as follows: ; The conditions for selecting the fitting straight line that meets the preset conditions in step 4 are as follows: (1) The number of line points of the fitted line must not be less than 80; (2) The number of line points that deviate from the fitting straight line cannot exceed 2. The criterion for whether the line point deviates from the fitting straight line is: the distance d from the line point to the fitting straight line cannot exceed 1 mm; The conditional formula for determining whether the fitted straight lines meeting the preset conditions are collinear in step 5 is: , in, , They represent the slopes of the two straight lines, ( , )、( , ) represent the coordinates of the midpoints of the two straight lines respectively; The formula for correcting the coordinates of the line points in step 6 is: , in, To correct the coordinates of the previous point, are the coordinates of the corrected point.

2. The method for extracting the center line of a line structured light strip according to claim 1, characterized in that: In step 1, the calculation formula for global thresholding is: , in, is the pixel value at image coordinate (x, y), represents the pixel value after thresholding, and T is the set threshold.

3. The method for extracting the center line of a line structured light strip according to claim 1, characterized in that: In the Steger algorithm, the two-dimensional Gaussian kernel is equivalently decomposed into a Gaussian row convolution and a Gaussian column convolution.

4. The method for extracting the center line of a line structured light strip according to claim 1, characterized in that: In the step 3, the initial threshold value 10 is set to filter out the shorter laser stripe center lines.

Citation Information

Patent Citations

  • Line structured light stripe center line extraction method based on Hough transformation

    CN111462214A

  • Line structured light stripe center extraction method

    CN112629409A