Laser beam center line extraction algorithm based on straight line segment screening

CN118379344BActive Publication Date: 2026-09-18CHANGJIANG SPATIAL INFORMATION TECH ENG CO LTD (WUHAN)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410357267.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2026-09-18
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

[0004]然而,在噪声影响因素多、且近距离对激光光束进行拍照的情况下,以上这些方法难以取得稳定且精确的提取结果,因此,亟需进行新的算法研究

Benefits of technology

[0031] 1) The present invention can realize high-precision extraction of the laser beam center line when there are many influencing factors such as noise and air disturbance and the laser beam is photographed at a close distance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379344B_ABST
    Figure CN118379344B_ABST
Patent Text Reader

Abstract

The application discloses a laser beam center line extraction algorithm based on straight line segment screening and relates to the technical field of computer vision and image processing. It comprises the following steps: 1, image preprocessing: performing image preprocessing on a laser beam photo; 2, adaptive ROI region selection; 3, straight line segment extraction: performing cutting on the original image based on the ROI region range, performing straight line segment extraction on the cut image, and obtaining straight line segments of the laser beam edge; 4, boundary straight line fitting; and 5, center line extraction: obtaining the center line of the laser beam. The application can realize high-precision extraction of the laser beam center line under the condition that noise, air disturbance and other factors are many and the laser beam is photographed at a close distance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology, and more specifically to a laser beam centerline extraction algorithm based on line segment selection. Background Technology

[0002] Centerline extraction of laser beams / stripes has wide applications in fields such as visual measurement, 3D reconstruction, and security monitoring. The effectiveness of centerline extraction directly affects the accuracy and results of subsequent applications. Furthermore, due to the complexity of laser beam application scenarios and the variety of environmental conditions, there are high requirements for the stability and generalization of extraction algorithms.

[0003] Currently, based on different implementation principles, existing beam / stripe center extraction methods can be divided into three categories. The first category is the geometric center extraction method of light stripes, including edge method, threshold method, skeleton refinement method, etc.; the second category is the energy center extraction method of light stripes, including gray-scale centroid method, extreme value method, curve fitting method, direction template method, etc.; the third category is innovative methods that are different from traditional methods, mainly including Steger method and deep learning-based methods, etc. (Li Yingying, Zhang Zhiyi, Yuan Lin. A review of light stripe center extraction in line structured light [J]. Progress in Lasers and Optoelectronics, 2013, 50(10):13-22.).

[0004] However, when there are many noise-affecting factors and when the laser beam is photographed at close range, the above methods are difficult to obtain stable and accurate extraction results. Therefore, new algorithm research is urgently needed. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the above-mentioned background technology and to provide a laser beam centerline extraction algorithm based on straight line segment screening.

[0006] To achieve the aforementioned first objective, the technical solution of the present invention is: a laser beam centerline extraction algorithm based on straight line segment screening, characterized by comprising the following steps:

[0007] Step 1, Image Preprocessing: Perform image preprocessing on the laser beam photograph;

[0008] Step 2, Adaptive ROI Region Selection; includes the following steps:

[0009] Step 2.1: Set the initial coordinates of the top left corner of the ROI region of the image to xmin = w, ymin = h; and the initial coordinates of the bottom right corner to xmax = 0, ymax = 0.

[0010] Where w is the image width and h is the image height;

[0011] 0≤xmin,xmax≤w,0≤ymin,ymax≤h;

[0012] Step 2.2: Based on the color and high-brightness characteristics of the laser beam, determine the grayscale segmentation threshold or the RGB color component segmentation threshold c between the laser beam and the background in the image, and the buffer size d;

[0013] Step 2.3: Traverse each pixel of the image to obtain the grayscale value or RGB color component value c of the pixel i , the row h where the pixel is located i , the column w where the pixel is located i ;

[0014] When c i >c, update the range of the image ROI according to the following rules: if w i <xmin, then make xmin=w i ; if h i <ymin, then make ymin=h i ; if w i >xmax, then make xmax=w i ; if h i >ymax, then make ymax=h i ;

[0015] Step 2.4: Repeat step 2.3 until all pixels in the image have been traversed;

[0016] Step 2.5: Finally, expand the ROI area outward according to the buffer size d to obtain the finally extracted ROI range:

[0017]

[0018]

[0019]

[0020] Step 3, straight line segment extraction: crop the original image based on the ROI range, and extract straight line segments from the cropped image to obtain the straight line segments at the edge of the laser beam;

[0021] Step 4, boundary straight line fitting: group the straight line segments on both sides of the laser beam, with the left straight line segments as one group and the right straight line segments as one group; extract the endpoint coordinates of all straight line segments in each group, perform least squares fitting, and obtain the edge lines on both sides of the laser beam.

[0022] Step 5, centerline extraction: obtain the centerline of the laser beam.

[0023] In the above technical solution, step 3 further comprises step 3.1, straight line segment screening: in the extraction result of straight line segment extraction in step 3, the straight line segments are screened to remove interfering straight line segments, the method is as follows: let the straight line segment D i (0<i≤n) has a length of l i and a slope of k i ;

[0024] the overall slope of the laser beam is

[0025]

[0026] the fluctuation ranges of the straight line segment slope relative to the overall slope of the laser beam are α1 and α2 (both α1 and α2 are between 0 and 1), and the length threshold is L, then the contour lines meeting the screening conditions shall satisfy:

[0027]

[0028] In the above technical solution, in step 1, performing image preprocessing on the laser beam photograph comprises grayscale, smoothing denoising and edge enhancement processing, which eliminates interference factors outside the laser beam while highlighting the edge features of the laser beam.

[0029] In the above technical solution, in step 5, since the laser has a divergence angle which is an acute angle, the acute angle bisector is calculated for the two side edge lines of the laser beam, so as to obtain the center line of the laser beam.

[0030] Compared with the prior art, the present invention has the following advantages:

[0031] 1) The present invention can realize high-precision extraction of the laser beam center line when there are many influencing factors such as noise and air disturbance and the laser beam is photographed at a close distance.

[0032] 2) The adaptive ROI region selection of the present invention adaptively selects the laser beam ROI region in the preprocessed image, narrows the image range, reduces the amount of data processing, thereby improving the processing and extraction efficiency of the algorithm. Description of Drawings

[0033] Figure 1 is a flow chart of the present invention.

[0034] Figure 2 is an image of an original photograph.

[0035] Figure 3 is an image obtained after image preprocessing by the present invention.

[0036] Figure 4 is an image obtained after extraction by the adaptive ROI region selection of the present invention.

[0037] Figure 5 This is the image after the straight line segment extraction according to the present invention.

[0038] Figure 6 The image is the result of line segment filtering according to the present invention.

[0039] Figure 7 This is the image after fitting the boundary line of this invention.

[0040] Figure 8 The image is extracted using the centerline of this invention. Detailed Implementation

[0041] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but these descriptions are not intended to limit the invention and are merely illustrative. The advantages of the present invention will become clearer and easier to understand through this description.

[0042] Referring to the attached diagram, the laser beam centerline extraction algorithm based on straight line segment selection is characterized by the following steps:

[0043] Step 1, Image Preprocessing: Perform image preprocessing on the laser beam photograph;

[0044] Step 2, Adaptive ROI Region Selection: Adaptively select the ROI region of the laser beam in the preprocessed image to narrow the image range, reduce the amount of data processing, and thus improve the efficiency of the algorithm's extraction; including the following steps:

[0045] Step 2.1: Set the initial coordinates of the top left corner of the ROI region of the image to xmin = w, ymin = h; and the initial coordinates of the bottom right corner to xmax = 0, ymax = 0.

[0046] Where w is the image width and h is the image height;

[0047] 0≤xmin,xmax≤w,0≤ymin,ymax≤h;

[0048] Step 2.2: Based on the color and high brightness characteristics of the laser beam, determine the grayscale segmentation threshold or RGB color component segmentation threshold c between the laser beam and the background in the image, as well as the buffer size d;

[0049] Step 2.3: Traverse each pixel of the image and obtain the pixel's grayscale value or RGB color component value c. i The row h where the pixel is located i The column w where the pixel is located i ;

[0050] When c i When >c, the image ROI region range is updated according to the following rules: If w i<xmin, then let xmin = w i ; if h i <ymin, then let ymin = h i ; if w i >xmax, then let xmax = w i ; if h i >ymax, then let ymax = h i ;

[0051] Step 2.4: Repeat step 2.3 until all pixels of the image have been traversed;

[0052] Step 2.5: Finally, expand the ROI outward according to the buffer size d to obtain the finally extracted ROI range:

[0053]

[0054]

[0055]

[0056] Step 3, Straight line segment extraction: Crop the original image based on the ROI range, and perform straight line segment extraction on the cropped image to obtain straight line segments at the edge of the laser beam;

[0057] Step 4, Boundary line fitting: Group the straight line segments on both sides of the laser beam, with the left straight line segments as one group and the right straight line segments as the other group; extract the endpoint coordinates of all straight line segments in each group, perform least squares fitting, and obtain edge lines on both sides of the laser beam.

[0058] Step 5, Center line extraction: obtain the center line of the laser beam.

[0059] Step 3 further comprises step 3.1, straight line segment screening: the extraction result obtained in step 3, straight line segment extraction, may contain some interference straight line segments generated due to influences such as noise or air disturbance, therefore it is necessary to screen the straight line segments and eliminate interference straight line segments; the method is as follows: let the i-th straight line segment D i (0<i≤n) has a length of l i and a slope of k i ;

[0060] the overall slope of the laser beam is

[0061]

[0062] the floating ranges of the slope of a straight line segment relative to the overall slope of the laser beam are α1 and α2 (both α1 and α2 are between 0 and 1), and the length threshold is L, then the contour line meeting the screening condition shall satisfy:

[0063]

[0064] In step 1, the laser beam image is preprocessed, including grayscale conversion, smoothing and noise reduction, and edge enhancement, to highlight the edge features of the laser beam while eliminating interference factors outside the laser beam.

[0065] In step 5, since the laser has a divergence angle, which is an acute angle, the center line of the laser beam can be obtained by calculating the acute angle bisectors of the two edge lines of the laser beam.

[0066] Example

[0067] Taking a 532nm green solid-state laser with model number MW-GL-532 / 300mW as an example, an industrial camera is used to obtain a close-up photo of the laser beam, and the center line of the laser beam in the photo is extracted using the present invention.

[0068] Figure 2 As seen in the original photograph, due to noise and air disturbance, there are obvious burrs on both sides of the laser beam's edges, making it difficult to obtain the desired centerline extraction effect using traditional methods.

[0069] First, the image is converted to grayscale and filtered, and the result is as follows. Figure 3 As shown.

[0070] Then, the ROI range was extracted, and the result is as follows: Figure 4 As shown, after extraction, the image area is significantly reduced.

[0071] For the image after ROI extraction, the LSD line segment detection algorithm is used to extract line segments, and the results are as follows. Figure 5 As shown, the extraction results contain some small line segments that are not parallel to the direction of the laser beam.

[0072] Based on length and slope thresholds, the extracted line segments are filtered, retaining only the longer segments whose direction is parallel to the laser beam direction. The results are as follows. Figure 6 As shown.

[0073] For the selected straight line segments on both sides of the laser beam, extract the coordinates of all endpoints and perform least-squares line fitting on each segment. The results are as follows: Figure 7 As shown.

[0074] Finally, the acute angle bisectors of the left and right edges of the laser beam are calculated, which are the center lines of the laser beam. The results are as follows: Figure 8 As shown.

[0075] In summary, this invention enables high-precision extraction of the laser beam centerline even under conditions of numerous influencing factors such as noise and air disturbance, and when photographing the laser beam at close range. All other aspects not described herein are prior art.

Claims

1. A laser beam centerline extraction algorithm based on straight line segment selection, characterized in that, Includes the following steps: Step 1: Take a close-up photo of the laser beam; Image preprocessing: Perform image preprocessing on the laser beam photo; Step 2, Adaptive ROI Region Selection; includes the following steps: Step 2.1: Set the initial coordinates of the upper right corner of the ROI region of the image to xmin=w, ymin=h; and the initial coordinates of the lower left corner to xmax=0, ymax=0. Where w is the image width and h is the image height; , ; Step 2.2: Based on the color and high brightness characteristics of the laser beam, determine the grayscale segmentation threshold or RGB color component segmentation threshold between the laser beam and the background in the image. and buffer size ; Step 2.3: Traverse each pixel of the image and obtain the pixel's grayscale value or RGB color component value. The row where the pixel is located The column where the pixel is located ; when When updating the ROI region range of the image according to the following rules: If Then make ; like Then make ;like Then make ;like Then make ; Step 2.4: Repeat step 2.3 until all pixels of the image have been traversed; Step 2.5: Finally, expand the ROI region outward according to the buffer size d to obtain the final extracted ROI range: ; ; ; Step 3, Line segment extraction: The original image is cropped based on the ROI region, and line segments are extracted from the cropped image to obtain the line segments of the laser beam edge; Step 4, Boundary line fitting: Group the line segments on both sides of the laser beam, with the left line segments as one group and the right line segments as another group; extract the endpoint coordinates of all line segments in each group, perform least squares fitting, and obtain the edge lines on both sides of the laser beam. Step 5, Centerline Extraction: Obtain the centerline of the laser beam; Step 3 also includes step 3.1, line segment filtering: In the line segment extraction results of step 3, the line segments are filtered to remove interfering line segments. The method is as follows: Let the line segment... ( The length of ) is The slope is ; The overall slope of the laser beam is ; The slope of the straight segment fluctuates relative to the overall slope of the laser beam. ( (All values ​​are between 0 and 1), and the length threshold is... Then, the contour lines that meet the screening criteria should satisfy: ; Based on length and slope thresholds, the extracted line segments are filtered, retaining only the longer segments that are parallel to the laser beam direction. In step 5, since the laser has a divergence angle, which is an acute angle, the center line of the laser beam can be obtained by calculating the acute angle bisectors of the two edge lines of the laser beam. In step 1, the laser beam image is preprocessed, including grayscale conversion, smoothing and noise reduction, and edge enhancement, to highlight the edge features of the laser beam while eliminating interference factors outside the laser beam.

Citation Information

Patent Citations

  • Method for extracting center line of laser stripe

    CN104657587A

  • Probability Hough straight line detection-based workpiece surface feature-point-free positioning method

    CN114463425A

  • Laser center line extraction method based on improved Steger algorithm

    CN117058224A