Laser stripe center line extraction method based on gray scale and curvature constraint

By employing a method based on grayscale and curvature constraints, and using improved anisotropic Gaussian filtering and energy function optimization, the problems of insufficient extraction speed, accuracy, and anti-interference ability of laser stripe center lines were solved, achieving high-precision and high-efficiency extraction in complex environments.

CN121169999APending Publication Date: 2025-12-19HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511266882.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve a balance between speed, accuracy, and anti-interference capabilities in laser stripe centerline extraction, and traditional methods are ineffective when dealing with noise and curvature variations.

Method used

A laser stripe centerline extraction method based on grayscale and curvature constraints is adopted. Noise is removed by improved anisotropic Gaussian filtering, and the path is optimized by combining curvature model and energy function to extract the laser stripe centerline.

Benefits of technology

It improves the accuracy and anti-interference ability of laser stripe centerline extraction, while ensuring real-time performance, enabling accurate extraction of the centerline in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169999A_ABST
    Figure CN121169999A_ABST
Patent Text Reader

Abstract

The invention discloses a laser stripe center line extraction method based on gray scale and curvature constraint, relates to the technical field of laser stripe center line extraction, and compared with a traditional Gaussian filtering method, an improved anisotropic Gaussian filtering mode adopted by the invention can better reserve edge information of laser stripes; in addition, by integrating the influence of the gray scale and the curvature, the precision of extracting the center line of the laser stripe is improved, and meanwhile, the real-time performance and the anti-interference capability are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of laser stripe center line extraction, and particularly relates to a laser stripe center line extraction method based on gray level and curvature constraint. BACKGROUND

[0002] Three-dimensional reconstruction technology is a main means to obtain spatial information of an object, and is widely applied to industrial detection, reverse engineering, cultural relic protection and other fields. Laser scanning three-dimensional reconstruction has become an important means for high-precision three-dimensional topography measurement due to its simple system structure, high precision and strong real-time performance. Three-dimensional reconstruction technology projects laser onto the surface of an object to be measured, and further deduces three-dimensional space coordinates of the object to be measured according to center coordinates of laser stripes on the surface of the object. Laser stripe center line extraction is a core link of laser scanning three-dimensional reconstruction, and the speed and precision thereof directly affect the quality of subsequent three-dimensional point cloud reconstruction. Therefore, how to quickly and accurately extract the center line of the laser stripe is a key to affecting the speed and precision of the entire three-dimensional reconstruction system.

[0003] How to balance the speed, accuracy and anti-interference ability of laser stripe center line extraction has been a difficult problem for researchers. Traditional laser stripe center line extraction methods include geometric center method, extreme value method, gray gravity method and Steger algorithm. The extraction speed of geometric center method and extreme value method is very fast, but the extraction accuracy is greatly affected by noise, and the extraction effect is relatively poor. The gray gravity method can well meet the real-time requirement, but only uses the transverse or longitudinal gray information of the stripe, and the extraction effect is not ideal for the stripe with varying curvature. Although the gray gravity method based on normal line improves the extraction effect of laser stripe with varying curvature to some extent, it is sensitive to noise and slow in processing speed. Xiao Zhen et al. improved the weight distribution strategy of the gray gravity method in the paper "Track fastener reconstruction and fault diagnosis based on improved gray gravity method" of China Laser, Vol. 51, No. 8, which improved the accuracy of the gray gravity method, but still did not solve the problem of the gray gravity method with varying curvature. Liu Tianci et al. proposed a laser stripe center line extraction method based on normal line guidance in the paper "Laser center line extraction method based on normal line guidance" of Applied Optics, Vol. 44, No. 1. The root mean square error of this method is improved by 0.2339 pixels compared with the gray gravity method, and the details are better preserved, but the process is complicated and difficult to meet the real-time requirement. Steger algorithm uses Hessian matrix to calculate the normal direction of line laser stripe, and then solves the center point in the normal direction through Taylor expansion of gray distribution function, which has high theoretical accuracy, but the calculation amount is large and it is difficult to meet the real-time requirement. Wang Yu et al. proposed a line laser center line extraction method based on improved Steger algorithm flow in the paper "Line laser center line extraction method based on improved Steger algorithm flow" of Optoelectronic Technology, Vol. 45, No. 1. The extraction accuracy is improved by 28% and 19% compared with the traditional gray gravity method and Steger algorithm respectively. Although many improved methods of Steger algorithm have been reported, the processing speed is difficult to improve essentially. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a laser stripe center line extraction method based on gray level and curvature constraint, which can well balance the speed, accuracy and anti-interference ability of laser stripe center line extraction.

[0005] The technical problem to be solved by the present application is solved by the following technical scheme:

[0006] A laser stripe center line extraction method based on gray level and curvature constraint, comprising the following steps:

[0007] S1, place the measured object in front of the line laser scanning probe, use the line laser scanning device to scan and take pictures of the measured object, and obtain a serialized image dataset containing laser stripes. During the acquisition of the stripe image, different brightness stripe images are taken by adjusting the camera exposure time to simulate different lighting conditions.

[0008] S2, use median filtering to process the stripe image to remove salt and pepper noise, and then use improved anisotropic Gaussian filtering to process the stripe image, which can remove Gaussian noise while preserving the edge information of the laser stripes.

[0009] The specific steps of the improved anisotropic Gaussian filtering are as follows:

[0010] (1) Calculate the gradient amplitude of the image at pixel coordinates (x, y) by formulas (1)-(3)

[0011]

[0012] where I x , I y respectively represent the gradients of the pixel point in the horizontal direction and the vertical direction.

[0013]

[0014]

[0015] where G x (i,j) and G y (i,j) respectively represent the gradient kernels of the Sobel operator in the horizontal direction and the vertical direction.

[0016] (2) Construct an adaptive weight W by formula (4), where the weight W contains gradient information, and the corresponding weight size is adaptively matched according to the size of the gradient.

[0017]

[0018] where T is a set gradient threshold.

[0019] (3) Traverse the entire image, and perform weighted filtering processing on each pixel point according to the adaptive weight, while reducing noise interference and preserving edge features. Let the coordinates of the target pixel point be (x, y), the pixel point set of the target pixel point in the surrounding area S be (x i ,y i ), and the gray value of the corresponding pixel point be I(x i ,y i ). The gray value I'(x, y) of the target pixel point after filtering is obtained by formula (5).

[0020]

[0021] wherein W(x i ,y i ) is the size of the adaptive weight W at the pixel point (x i ,y i ).

[0022] S3, by calculating the normal and tangent direction of the laser stripe, constructing a curvature model, and constructing an energy function to select the optimal path of the center line, a laser stripe center line extraction method based on gray level and curvature constraint is designed to extract the laser stripe center line of the stripe image.

[0023] The specific steps of the laser stripe center line extraction method based on gray level and curvature constraint are as follows:

[0024] (1) In order to accurately obtain the normal direction information of the laser stripe, a structure tensor J is constructed for any pixel point (x, y) in the image.

[0025]

[0026] wherein I x represents the gradient of the pixel point in the horizontal direction; I y represents the gradient of the pixel point in the vertical direction; and < > represents the local area Gaussian weighted average.

[0027] The structure tensor J is subjected to eigenvalue decomposition to obtain two eigenvalues λ1 and λ2, wherein λ1>λ2; the eigenvector corresponding to the maximum eigenvalue λ1 is v1, v1=(v 1x ,v 1y ); and the normal direction angle θ is obtained from formula (7).

[0028]

[0029] The value range of θ is Since the tangent direction angle , the value range of θ' is 0~π; the normal direction angle θ and the tangent direction angle θ' corresponding to any pixel point in the image are obtained by calculation.

[0030] (2) The traditional method mainly relies on the gray level information to determine the path of the subsequent center line, and such method is highly sensitive to noise and is prone to gray discontinuity or abnormality. In order to overcome the above defects, a curvature model t is introduced on the basis of the gray level information to limit the bending degree of the center line, so that the center line remains smooth.

[0031] Assuming that the laser stripe center line is a smooth curve on a two-dimensional plane, since the image is taken by vertically irradiating the object with a laser line, the pixel longitudinal coordinate y is taken as the independent variable and the pixel horizontal coordinate x is taken as the dependent variable. The path of the laser center line is a parametric curve C(y) = (x(y), y), and the curvature K(y) is used to represent the rate of change of the tangent direction within the unit arc length, that is, the local bending degree of the curve, as shown in formula (8).

[0032]

[0033] The continuous curvature equation is converted into a discrete form, and the three-point central difference method is used to convert K(y) into a discrete form K i , as shown in formulas (9)-(11).

[0034]

[0035] , as shown in formulas (9)-(11). i ′ and x i ″ are the first derivative and the second derivative, respectively. |K i | is larger, the curve is more curved; and Δy is the longitudinal coordinate distance of the selected adjacent two pixel points. Since the laser stripe center line is extracted by row traversal in the present application, and there is a center point in each pixel row with a pixel point, the Δy of the selected adjacent two pixel points is 1. Formula (11) can be simplified as formula (12).

[0036]

[0037] (3) The laser stripe center line optimal path selection problem is converted into an energy minimization problem, and an energy function E containing the laser stripe gray scale and the laser stripe curvature information is constructed, as shown in formulas (13)-(15).

[0038] E = E g + μE c (13)

[0039]

[0040] , as shown in formulas (9)-(11). g , as shown in formulas (9)-(11). c , as shown in formulas (9)-(11). 2 , as shown in formulas (9)-(11). 2

[0041] ​The actual laser stripe center line path is composed of discrete pixel points {P i =(x i ,y i )}, so E needs to be converted into a discrete function form. For each pixel point (x,y), 2K+1 points are selected along the n direction, and the distance between adjacent two pixel points is Δt. The relationship between the pixel point (x k ,y k ) selected along the n direction and the pixel point (x,y) is shown in equation (16).

[0042] (x k ,y k )=(x,y)+k·Δt·n,k=-K,...,K (16)

[0043] The weight function w k of the pixel point (x k ,y k ) is shown in equation (17).

[0044]

[0045] The discrete form of E g is obtained from equation (16) and equation (17), as shown in equation (18).

[0046]

[0047] The discrete form of E is obtained in combination with the discrete curvature K i , as shown in equation (19).

[0048]

[0049] The smaller the value of E, the smaller the total energy of the comprehensive influence of the gray scale and the curvature, and the closer the path is to the actual center line of the laser stripe. The energy e i of each position in the path is taken as an evaluation index, as shown in equation (20).

[0050]

[0051] Each pixel point corresponds to a unique tangent direction angle θ' i . The state of each pixel point is set as {P i =(x i ,y i ,θ' i )}, indicating the current position and direction of the pixel point; the position of the next selected pixel point (x i+1 ,y i+1 ) is limited to the position of the previous pixel point (x i ,yi ) of the θ' I In the ±Δθ' direction, the pixel point with the minimum value in each pixel row is selected as the pixel point of each pixel row, and the pixel points selected from each pixel row jointly form the extracted laser stripe center line. i

[0052] S4, according to the principle that the tangent direction of the pixel point on the ideal laser stripe center line is orthogonal to the gradient direction, the laser stripe center line is sub-pixel corrected, and the accuracy of the laser stripe center extraction is improved to the sub-pixel level.

[0053] The tangent direction t of the pixel point (x, y) on the ideal laser stripe center line is orthogonal to the gradient direction , as shown in formula (21).

[0054]

[0055] Where t=(cosθ', sinθ') T , θ' is the tangent direction angle corresponding to the point.

[0056] For the pixel point (x0, y0), let the true sub-pixel offset be (Δx, Δy), and the gradient is expanded by the first-order Taylor formula near the point, as shown in formula (22).

[0057]

[0058] Where H is the Hessian matrix, as shown in formula (23).

[0059]

[0060] In order to make the offset sub-pixel on the ideal laser stripe center line, formula (24) should be satisfied.

[0061]

[0062] Let the pixel point be offset along its corresponding normal direction, then Δx=-dsinθ' and Δy=dcosθ'.

[0063] Combined with formula (23) and formula (24), formula (25) is obtained.

[0064]

[0065] The position of the offset sub-pixel can be obtained from d, and the laser stripe center line is sub-pixel corrected by traversing the image.

[0066] The beneficial effects of the present application are:

[0067] ​1、Compared with the traditional Gaussian filtering method, the improved anisotropic Gaussian filtering method adopted by the application can better preserve the edge information of the laser stripe.

[0068] 2、The application improves the accuracy of laser stripe center line extraction by comprehensively considering the influence of gray scale and curvature, while ensuring real-time performance and anti-interference capability. BRIEF DESCRIPTION OF DRAWINGS

[0069] Figure 1 The flow chart of the laser stripe center line extraction method described in the application;

[0070] Figure 2 The original image (a) and the median filtering image (b) in Example 1;

[0071] Figure 3 The images processed by the traditional Gaussian filtering (a) and the improved anisotropic Gaussian filtering (b) of the application in Example 1, respectively;

[0072] Figure 4 The chessboard calibration plate image with laser lines in Example 1;

[0073] Figure 5 The laser stripe center line extracted based on the gray scale information by the traditional method;

[0074] Figure 6 The schematic diagram of the pixel points constituting the laser center line path in Example 1;

[0075] Figure 7 The schematic diagram of the pixel point selection in the gray scale energy term in Example 1;

[0076] Figure 8 The schematic diagram of the center line path selection in Example 1;

[0077] Figure 9 The laser stripe center line extracted in Example 1;

[0078] Figure 10 The sub-pixel correction schematic diagram of the application;

[0079] Figure 11 The laser stripe center line images extracted by the extraction method (a) of the application, the gray scale barycenter method (b), the normal-based gray scale barycenter method (c) and the traditional Steger algorithm (d), respectively;

[0080] Figure 12 The high-precision ceramic gauge image;

[0081] Figure 13The evaluation index results are shown for the images after being processed by the extraction method of this invention, the gray-level centroid method, the gray-level centroid method based on normals, and the traditional Steger algorithm, respectively; where (a) is a line graph composed of RMSE obtained by processing 10 sets of images by these four methods; and (b) is the average RMSE obtained by processing 10 sets of images by these four methods.

[0082] Figure 14 The images are 3D reconstruction results after being processed by the extraction method of this invention (a), gray-level centroid method (b), normal-based gray-level centroid method (c), and traditional Steger algorithm (d). Detailed Implementation

[0083] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below with reference to specific embodiments and illustrations.

[0084] Example 1

[0085] like Figure 1 As shown, this embodiment provides a method for extracting the center line of laser stripes based on grayscale and curvature constraints, including the following steps:

[0086] S1. Place the plaster cast of the figure directly in front of the line laser scanning probe and use a line laser scanning device (D650NX-T1685) to scan and photograph the plaster cast of the figure, obtaining a serialized image dataset containing laser stripes. During the acquisition of stripe images, the exposure time of the camera (MER2-302-56U3M / C) was adjusted to capture stripe images of different brightness to simulate different lighting conditions. The camera's exposure time ranged from 1000μs to 10000μs, increasing by 1000μs each time, for a total of 10 sets of stripe images representing different environmental conditions.

[0087] S2. Median filtering is used to process the striped image to remove salt-and-pepper noise. The processing effect is as follows: Figure 2 As shown. Further processing of the stripe image using an improved anisotropic Gaussian filter can remove Gaussian noise while preserving the edge information of the laser stripes.

[0088] The specific steps of the improved anisotropic Gaussian filtering are as follows:

[0089] (1) Calculate the gradient magnitude of the image at pixel coordinates (x, y) using formulas (1)-(3).

[0090]

[0091] Among them, I x I y These represent the gradients of the pixel in the horizontal and vertical directions, respectively.

[0092]

[0093] wherein G x (i,j) and G y (i,j) represent the gradient kernel of Sobel operator in horizontal direction and vertical direction respectively.

[0094] (2) Construct adaptive weight W from formula (4), at this time the weight W contains gradient information, and the corresponding weight size is adaptively matched according to the size of the gradient.

[0095]

[0096] wherein T is the set gradient threshold.

[0097] (3) Traverse the entire image, and perform weighted filtering processing on each pixel point according to the adaptive weight, so as to reduce noise interference while retaining edge features. Assuming that the coordinates of the target pixel point are (x, y), the pixel point set of the region S around the target pixel point is (x i ,y i ), and the gray value of the corresponding pixel point is I(x i ,y i ), the gray value I'(x, y) of the target pixel point after filtering processing is obtained from formula (5).

[0098]

[0099] wherein W(x i ,y i ) is the size of the adaptive weight W at the pixel point (x i ,y i ). The processing effects of the traditional Gaussian filter and the improved anisotropic Gaussian filter are shown in Figure 3 .

[0100] To quantitatively verify the influence of the improved anisotropic Gaussian filter on the subsequent laser stripe center line extraction, a chessboard calibration plate image with a laser line is used for testing, as shown in Figure 4 . Three groups of test data are obtained by using median filtering, median filtering and Gaussian filtering, and median filtering and improved anisotropic Gaussian filtering to process the image, and the three groups of test data are uniformly processed by using the gray gravity center method. Since the true value of the center line of the laser stripe cannot be determined, the pixel coordinates obtained by the gray gravity center method are linearly fitted as the true value of the center line of the laser stripe, the root mean square error RMSE is used to evaluate the precision of the extraction of the center line of the laser stripe, and the results are shown in Table 1.

[0101] Table 1

[0102]

[0103] From Table 1, compared with only using the median filtering processing, after the median filtering processing, the subsequent laser stripe center line extraction error is reduced by 33.2% by using the Gaussian filtering processing; compared with only using the median filtering processing, after the median filtering processing, the subsequent error is reduced by 52.4% by using the anisotropic Gaussian filtering processing; compared with using the Gaussian filtering processing, the subsequent laser stripe center line extraction error is reduced by 28.7% by using the anisotropic Gaussian filtering processing. This shows that the filtering processing method proposed in the application has certain help for the accuracy improvement of the subsequent laser stripe center line extraction.

[0104] S3, a laser stripe center line extraction method based on gray level and curvature constraint is designed by calculating the normal and tangent direction of the laser stripe, constructing a curvature model, and constructing an energy function to select the optimal path of the center line, and the laser stripe center line of the stripe image is extracted.

[0105] The specific steps of the laser stripe center line extraction method based on gray level and curvature constraint are as follows:

[0106] (1) In order to accurately obtain the normal direction information of the laser stripe, a structure tensor J is constructed for any pixel point (x, y) in the image.

[0107]

[0108] Wherein, I x represents the gradient of the pixel point in the horizontal direction; I y represents the gradient of the pixel point in the vertical direction; and represents the local region Gaussian weighted average.

[0109] The structure tensor J is subjected to eigenvalue decomposition to obtain two eigenvalues λ1 and λ2, wherein λ1>λ2; the characteristic vector corresponding to the maximum eigenvalue λ1 is v1, v1=(v 1x ,v 1y ); the normal direction angle θ is solved from formula (7).

[0110]

[0111] The value range of θ is Since the tangent direction angle , the value range of θ' is 0~π; the normal direction angle θ and the tangent direction angle θ' corresponding to any pixel point in the image are calculated.

[0112] (2) The extraction process of the laser stripe center line can be regarded as a path optimization process, and the core objective is to find a continuous curve in the image, which needs to be as close as possible to the actual center position of the laser stripe, and to avoid sharp bending changes. The traditional method mainly relies on gray information to determine the path of the subsequent center line, and such method is highly sensitive to noise and is prone to gray discontinuity or abnormality, such as Figure 5 The center line path extracted based on the gray information deviates from the ideal track, resulting in the jagged or discontinuous phenomenon of the extracted center line, which cannot accurately reflect the real characteristics of the laser stripe center line. In order to overcome the above defects, the curvature model t is introduced on the basis of the gray information to limit the bending degree of the center line, so that the center line remains smooth.

[0113] Assuming that the laser stripe center line is a smooth curve in a two-dimensional plane, since the image is shot by vertically irradiating the object by the laser line, the pixel longitudinal coordinate y needs to be taken as the independent variable, and the pixel horizontal coordinate x needs to be taken as the dependent variable. The path of the laser center line is a parameter curve C(y) = (x(y), y), and the curvature K(y) is used to represent the rate of change of the tangent line direction within the unit arc length, that is, the local bending degree of the curve, as shown in formula (8).

[0114]

[0115] The above analysis is the curvature equation of the laser stripe center line path in the ideal state, and the actual laser stripe center line path is composed of a plurality of discrete pixel points {P i = (x i ,y i )} as shown in Figure 6 .

[0116] The continuous curvature equation is converted into a discrete form, and the three-point central difference method is used to convert K(y) into a discrete form K i , as shown in formulas (9)-(11).

[0117]

[0118]

[0119] Wherein, x i ' and x i " are the first derivative and the second derivative, respectively. |K i | is larger, the curve is more sharply curved; and Δy is the longitudinal coordinate distance of the selected adjacent two pixel points. Since the laser stripe center line is extracted by row traversal in the present application, and there is a center point in each pixel row with a pixel point, Δy = 1 of the selected adjacent two pixel points. Formula (11) can be simplified as formula (12).

[0120]

[0121] (3) The laser stripe center line optimal path selection problem is converted into an energy minimization problem, and an energy function E containing laser stripe gray scale and laser stripe curvature information is constructed, as shown in equations (13)-(15).

[0122] E = E g + μE c (13)

[0123] E g = -∫∫I((x,y)+t·n)·w(t)dtdy (14)

[0124] E c =∫K 2 (y)dy(15)

[0125] where E g is the gray scale energy term; E c is the curvature energy term; μ is the weight function of the curvature energy; I(x,y) is the gray scale value of the image at pixel horizontal coordinate x; t is the offset along the normal direction, t = 0 represents the current pixel point; n is the unit normal vector of the laser stripe, n = (cosθ, sinθ), θ is the normal direction angle; w(t) is the Gaussian weight function, w(t) = e^(-t 2 / (2σ 2 )).

[0126] The actual laser stripe center line path is composed of a plurality of discrete pixel points {P i = (x i ,y i )}, so it is necessary to convert E into a discrete function form. For each pixel point (x,y), 2K+1 points are selected along the n direction, and the distance between adjacent two pixel points is Δt, as shown in Figure 7 The relationship between the pixel point (x k ,y k ) selected along the n direction and the pixel point (x,y) is shown in equation (16).

[0127] (x k ,y k ) = (x,y) + k·Δt·n, k = -K,...,K (16)

[0128] The weight function w k corresponding to the pixel point (x k ,y k ) is shown in equation (17).

[0129]

[0130] E can be obtained from formulas (16) and (17). g The discretized form is shown in Equation (18).

[0131]

[0132] Combined with discrete curvature K i The discrete form of E is obtained, as shown in formula (19).

[0133]

[0134] A smaller E-value indicates a smaller total energy resulting from the combined effects of grayscale and curvature, and the closer the path is to the actual centerline of the laser stripe. The energy e at each position along the path... i As an evaluation indicator, it is shown in formula (20).

[0135]

[0136] Each pixel corresponds to a unique tangent direction angle θ' i Let the state of each pixel be {P}. i =(x i ,y i ,θ' i )} represents the current position and orientation of the pixel; the next pixel to be selected (x) i+1 ,y i+1 The position is limited to the previous pixel (x). i ,y i ) of θ' I In the ±Δθ' direction, such as Figure 8 As shown, red circles represent selected points, and blue circles represent candidate points to be selected. To reduce computational complexity and obtain sufficient candidate points, Δθ' is set to 30°. The point e in each pixel row is selected. i The smallest pixel, formed by the pixels selected from each pixel row, constitutes the extracted center line of the laser stripe, such as... Figure 9 As shown.

[0137] S4. Based on the principle that the tangent direction of the pixel on the center line of the ideal laser stripe is orthogonal to the gradient direction, the extracted center line of the laser stripe is corrected to sub-pixel level, thereby improving the accuracy of laser stripe center extraction to the sub-pixel level.

[0138] The tangent direction t of the pixel (x,y) on the center line of the ideal laser stripe is related to the gradient direction. Orthogonal, as shown in formula (21).

[0139]

[0140] Where t = (cosθ', sinθ') T θ' is the tangent angle corresponding to that point.

[0141] For a pixel (x0, y0), let its true subpixel offset be (Δx, Δy). Expand the gradient in the vicinity of this point using the first-order Taylor formula, as shown in formula (22).

[0142]

[0143] Where H is the Hessian matrix, as shown in formula (23).

[0144]

[0145] To ensure that the offset subpixels are on the center line of the ideal laser stripe, formula (24) should be satisfied.

[0146]

[0147] Let the pixel be offset along its corresponding normal direction, then Δx = -dsinθ' and Δy = dcosθ'.

[0148] Combining formulas (23) and (24), we obtain formula (25).

[0149]

[0150] The sub-pixel position after offset can be obtained from d, such as Figure 10 As shown, the image is traversed, and subpixel correction is performed on the center line of the laser stripes.

[0151] The laser stripe centerline is extracted from the preprocessed test image according to this invention. The complex surface structure of the plaster cast human figure, with its significant curvature, can be used to evaluate the effectiveness of laser stripe centerline extraction methods. The extraction method described in this invention is compared with the gray-scale centroid method, the normal-based gray-scale centroid method, and the traditional Steger algorithm. Figure 11 As shown.

[0152] Depend on Figure 11 It is known that the gray-scale centroid method and the normal-based gray-scale centroid method are prone to extracting incorrect center points between two laser stripes or when the curvature of the laser stripes is too large. Although the traditional Steger algorithm has high theoretical accuracy in extracting the center line, it relies on the derivative of the local gradient for extraction, which easily leads to noise being mistaken for part of the laser stripe, resulting in poor performance in extracting the center line of complex laser stripes. In contrast, the extraction method described in this invention combines the gray level and curvature of the laser stripe, significantly avoiding discrete points and noise interference, and exhibits significantly better performance in complex cases where the curvature of the laser stripe varies greatly.

[0153] Select high-precision ceramic gauge as the measured object, quantitatively evaluate the performance of the laser stripe center line extraction method under different environmental conditions, such as Figure 12 As shown in the figure. After the test image is processed by the filtering processing method of the application, the above four methods are used for laser stripe center line extraction. Similarly, the pixel coordinates obtained by different methods are linearly fitted as the true value of the laser stripe center line. The center points obtained by the laser stripe center line extraction are used as the evaluation index of the laser stripe center line extraction effect. The evaluation index results of each group of images after being processed by the four laser stripe center line extraction methods are shown in Figure 13 .

[0154] As can be seen from Figure 13 , the extraction accuracy of the laser stripe center line obtained by the extraction method of the application is better than the other three methods; in the case of low exposure, the extraction effect is similar to that of the traditional Steger algorithm, and is better than that of the gray gravity center method and the gray gravity center method based on the normal line. With the increase of exposure time, more stray light points and noise interference are introduced into the photographed laser stripe image, which greatly increases the extraction accuracy of the laser stripe center line of the traditional Steger algorithm. The influence of the extraction method of the application on stray light points and noise is much smaller than that of the traditional Steger algorithm, so the extraction method of the application can maintain good accuracy in different environments. The extraction method of the application improves the extraction accuracy of the laser stripe center line by 58.3% compared with the gray gravity center method, by 46.2% compared with the gray gravity center method based on the normal line, and by 35.4% compared with the traditional Steger algorithm.

[0155] The time taken by the above four methods to perform laser stripe center line extraction processing on the 10 groups of test images is shown in Table 2.

[0156] Table 2

[0157]

[0158] As can be seen from Table 2, the speed of the extraction method of the application in processing images is not as good as the gray gravity center method, but is better than the gray gravity center method based on the normal line, and is much faster than the traditional Steger algorithm, which can well meet the real-time demand.

[0159] In summary, the extraction method of the application has advantages in laser stripe center line extraction accuracy and speed, and can well meet the needs of industrial production and defect detection.

[0160] Based on the extracted coordinates of the laser stripe centerline, camera calibration parameters, and laser plane equation, the two-dimensional image coordinates of each pixel on the centerline are accurately calculated using the principle of triangulation and converted into corresponding three-dimensional spatial point coordinates, forming a three-dimensional point cloud to reconstruct the plaster cast model of the human figure. The reconstructed plaster cast models obtained using the above four methods are then analyzed and compared for effectiveness. Figure 14 As shown.

[0161] Depend on Figure 14 It is known that when processing complex laser stripe images with large curvature variations, the 3D point cloud obtained by the gray-scale centroid method has obvious protrusions around the eyes of the person; the 3D point cloud obtained by the normal-based gray-scale centroid method, although without obvious defects, shows that a lot of point cloud data is lost; the 3D point cloud obtained by the traditional Steger algorithm is not ideal, and a large number of impurity point clouds appear; while the 3D point cloud obtained by the extraction method described in this invention is the most ideal among the above methods, accurately capturing the facial details of the person, and with almost no impurity point clouds.

[0162] Select Figure 12 The high-precision ceramic gauge block shown is used as the test object to quantitatively evaluate the three-dimensional reconstruction effect. After being processed by the above four methods and reconstructed into a three-dimensional point cloud, the final measured gauge block size results are shown in Table 3.

[0163] Table 3

[0164]

[0165] As shown in Table 3, the relative error between the reconstructed block dimensions and the true values ​​obtained by the extraction method described in this invention is the smallest, with a relative error of 0.04% for length, 0.07% for width, and 0.17% for thickness. For each size type, the error values ​​of the extraction method described in this invention are lower than those of the grayscale centroid method, the normal-based grayscale centroid method, and the traditional Steger method. This indicates that the extraction method described in this invention is superior to the other three methods in terms of dimensional reconstruction accuracy.

[0166] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A laser stripe centerline extraction method based on gray scale and curvature constraint, characterized in that, The method comprises the following steps: S1, placing the measured object in front of a line laser scanning probe, using a line laser scanning device to scan and photograph the measured object, and obtaining a sequenced image dataset containing laser stripes; S2, using median filtering to process the stripe image, and then using improved anisotropic Gaussian filtering to process the stripe image; S3, designing a laser stripe centerline extraction method based on gray level and curvature constraints through three steps of calculating the normal and tangent directions of the laser stripe, constructing a curvature model, and constructing an energy function to select an optimal path of the centerline, and extracting the laser stripe centerline of the stripe image; S4, according to the principle that the tangent direction of the pixel point on the ideal laser stripe centerline is orthogonal to the gradient direction, sub-pixel correction is performed on the extracted laser stripe centerline, and the accuracy of the laser stripe center extraction is improved to the sub-pixel level.

2. The laser stripe centerline extraction method of claim 1, wherein: In step S1, during the acquisition of the stripe image, different brightness stripe images are photographed by adjusting the camera exposure time to simulate different lighting conditions.

3. The method of claim 1, wherein: In step S2, the specific steps of the improved anisotropic Gaussian filtering are as follows: (1) Calculate the gradient magnitude of the image at pixel coordinates (x, y) from equations (1)-(3) where I x , I y respectively represent the gradient of the pixel point in the horizontal direction and the vertical direction; where G x (i,j) and G y (i,j) represent the gradient kernels of Sobel operator in horizontal and vertical directions, respectively; (2) Construct an adaptive weight W from formula (4), at this time the weight W contains gradient information, and the corresponding weight size is adaptively matched according to the size of the gradient; Wherein, T is a set gradient threshold value; (3) Traverse the entire image, and perform weighted filtering processing on each pixel point according to the adaptive weight; let the coordinates of the target pixel point be (x, y), the pixel point set of the surrounding area S of the target pixel point be (x i ,y i ), and the gray value of the corresponding pixel point be I(x i ,y i ). The gray value I'(x, y) of the target pixel point after filtering processing is obtained by formula (5); where W(x i ,y i ) is the size of the adaptive weight W at the pixel point (x i ,y i ).

4. The method of claim 1, wherein: In step S3, the specific steps of the laser stripe centerline extraction method based on gray level and curvature constraints are as follows: (1) To accurately obtain the normal direction information of the laser stripe, construct a structure tensor J for any pixel point (x, y) in the image; where I x represents the gradient of the pixel point in the horizontal direction; I y represents the gradient of the pixel point in the vertical direction; and represents the local region Gaussian weighted average. The structural tensor J is subjected to eigenvalue decomposition to obtain two eigenvalues λ1 and λ2, wherein λ1>λ2; the eigenvector corresponding to the maximum eigenvalue λ1 is v1, v1=(v 1x ,v 1y ); the normal direction angle θ is obtained from formula (7); The value range of θ is Since the tangent direction angle θ' is Therefore, the value range of θ' is 0-π; the normal direction angle θ and the tangent direction angle θ' corresponding to any pixel point in the image are obtained by calculation. (2) On the basis of the gray level information, introduce a curvature model t to limit the bending degree of the centerline, so that the centerline remains smooth; Taking the pixel longitudinal coordinate y as the independent variable and the pixel horizontal coordinate x as the dependent variable, setting the path of the laser centerline as the parametric curve C(y)=(x(y),y), and using the curvature K(y) to represent the rate of change of the tangent direction within the unit arc length, that is, the local bending degree of the curve, as shown in formula (8); The continuous curvature equation is converted into a discrete form, and a three-point central difference method is used to convert K(y) into a discrete form K i as shown in equations (9)-(11); where x i and x i are the first and second derivatives, respectively; |K i | is larger, the curve is more sharply curved; and Δy is the vertical coordinate distance between the two adjacent pixels selected; since Δy = 1, equation (11) is simplified to equation (12): (3) Convert the laser stripe centerline optimal path selection problem into an energy minimization problem, and construct an energy function E containing the gray level and curvature information of the laser stripe, as shown in formulas (13)-(15); E = E g + μE c (13) E g = -∫∫I((x, y) + t · n) · w(t) dt dy (14) E c = ∫K 2 (y) dy (15) where E g is the gray energy term; E c is the curvature energy term; μ is the weight function of the curvature energy; I(x, y) is the gray value of the image at the pixel horizontal coordinate x; t is the offset along the normal direction, which represents the current pixel point when t = 0; n is the unit normal vector of the laser stripe, n = (cosθ, sinθ), θ is the normal direction angle; w(t) is the Gaussian weight function, w(t) = e^(-t 2 / (2σ 2 )) For each pixel point (x, y), 2K+l points are selected along the n direction, the distance between two adjacent pixel points is At, the relationship between the pixel points (x k ,y k ) selected along the n direction and the pixel point (x, y) is shown in formula (16); (x k ,y k ) = (x,y) + k - At - n, k = -K,..., K (16) The pixel point (x k ,y k ) corresponds to the weight function w k As shown in formula (17); The discrete form of E g is obtained from equations (16) and (17) as shown in equation (18); Combining the discrete curvatures K i The discrete form of E is obtained as shown in equation (19); e is the energy of each position in the path i As an evaluation index, as shown in equation (20); Each pixel point corresponds to a unique tangent direction angle θ' i , let each pixel point state as {P i , x i , y i , θ' i}, represents the current position and direction of the pixel point; the position of the next selected pixel point (x i+1 , y i+1 ) is limited in the θ' I ±Δθ' direction of the last pixel point (x i , y i ), select the pixel point with the smallest e i in each pixel row, and the pixel points selected from each pixel row together constitute the extracted laser stripe center line.

5. The method of claim 1, wherein: In step S4, the tangent direction t of the pixel point (x, y) on the ideal laser stripe center line and the gradient direction orthogonal, as shown in equation (21); where t = (cos θ', sin θ') T θ' is the tangent direction angle corresponding to the point. For the pixel point (x0, y0), let the true sub-pixel offset be (Δx, Δy), and expand the gradient by the first-order Taylor formula near the point, as shown in formula (22); Wherein, H is the Hessian matrix, as shown in formula (23); In order to make the offset sub-pixel on the ideal laser stripe centerline, formula (24) should be satisfied; Let the pixel point be offset along its corresponding normal direction, then Δx=-dsinθ' and Δy=dcosθ'; Combining formula (23) and formula (24), formula (25) is obtained; The position of the offset sub-pixel is obtained from d, the image is traversed, and the sub-pixel correction is performed on the laser stripe centerline.