A laser spot array detection method and system for structured light parameter calibration

By employing steps such as image distortion correction, filtering, adaptive threshold segmentation, and projective transformation, the problems of multiple laser spots, uneven intensity, and image differences in laser spot detection in industrial endoscopes were solved, achieving high-precision structured light parameter calibration.

CN119152032BActive Publication Date: 2025-11-21BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411275595.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-11-21
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

In industrial endoscopes, due to the limitations of the endoscope tubing size, problems such as more than the actual spot size, uneven spot intensity, and large differences in spot image may occur during laser spot detection, affecting the robustness and accuracy of structured light parameter calibration.

Method used

A laser spot array detection method is adopted, which includes steps such as image distortion correction, filtering, adaptive threshold segmentation, region evaluation, energy integration, projective transformation and seed point segmentation. It automatically locates the position of the spot array, fills in missing spots, and iteratively corrects deviations to achieve sub-pixel accuracy.

Benefits of technology

It improves the reliability and accuracy of structured light parameter calibration, reduces the calibration difficulty, realizes automated calibration, and achieves sub-pixel level spot positioning accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152032B_ABST
    Figure CN119152032B_ABST
Patent Text Reader

Abstract

The application discloses a laser spot array detection method and system for structured light parameter calibration, comprising: capturing a laser array spot image on a laser calibration plane by using a structured light camera, performing distortion correction processing and image filtering; extracting a red channel image and performing full-image adaptive threshold segmentation, erosion and expansion operation, screening the Gaussian centroid coordinates of candidate regions and corresponding channels according to the area of the regions; calculating the position of the peak value by using the position relationship and energy distribution of the candidate points, positioning the position of the spot array, and generating a theoretical spot array; calculating the actual spot position by using a projection transformation and completing the missing spot, performing secondary positioning correction on the spot array by using a seed point segmentation algorithm, and iteratively performing projection transformation to correct the spot deviation, so that the sub-pixel level spot position is obtained; the application realizes the sub-pixel position detection of the spot in the structured light parameter calibration, reduces the difficulty of the pipeline calibration of the structured light camera, and improves the reliability and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of laser array spot detection technology, and more specifically to a laser array spot detection method and system for structured light parameter calibration. Background Technology

[0002] Currently, structured light-based industrial endoscopes have been widely used for defect detection and measurement of industrial products. However, the use of structured light for measurement requires prior calibration of the structured light measurement system, including camera calibration and structured light parameter calibration. Structured light parameter calibration refers to determining the projection parameters of the structured light in the camera coordinate system so that the three-dimensional spatial coordinates of the structured light stripes or spots can be determined by combining the position of the structured light image on the object surface during measurement.

[0003] Laser spot arrays are a commonly used projection mode in structured light. Therefore, determining the precise position of the laser spot array in the camera image and identifying the spot number in the array are important steps in achieving structured light positioning and measurement tasks.

[0004] However, in structured light measurement using industrial endoscopes, due to the limitations of the endoscope's tubing size, the angle between the camera's visual axis and the main laser projection direction is small, almost parallel, and the baseline distance between the camera lens center and the laser projection source center is very short. Therefore, the working distance of industrial endoscopes is very small, resulting in the following problems when detecting laser spot:

[0005] (1) After the laser beam array is reflected on the surface of the object, some of the light is reflected again by the endoscope lens to the surface of the object to form interference beams, which may result in more beams than the actual beam array in the image; (2) The unevenness of the laser beam projection intensity causes some beams to have a white center and a diffuse area around them, while some beams only have the corresponding laser color and no white center, and the beam intensity may be insufficient to form an effective beam image; In addition, the different absorption or reflection of laser light by different object surfaces will also cause a great difference in the laser beam image.

[0006] Therefore, how to provide a laser spot array detection method for structured light parameter calibration in structured light endoscope systems, so as to improve the robustness and reliability of structured light parameter calibration, and at the same time improve the accuracy and speed of structured light pipeline calibration, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0007] In view of this, the present invention provides a laser spot array detection method and system for structured light parameter calibration to solve some of the technical problems mentioned in the background art.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] A laser spot array detection method for structured light parameter calibration includes the following steps:

[0010] S1. On the laser calibration plane, a full-color image of the image to be detected containing an M×N array of laser spots is captured using a structured light camera. The image to be detected is then subjected to distortion correction using the intrinsic parameters of the calibrated structured light camera and the lens distortion coefficients to obtain a corrected image. Finally, the corrected image is subjected to image filtering to reduce image noise.

[0011] S2. Decompose the filtered image into an RGB three-channel image, extract the red channel, and filter out the interference of other channel colors on spot detection;

[0012] S3. Perform full-image adaptive threshold segmentation on the red channel image, perform erosion and dilation operations on the segmented image, evaluate each connected region, sort by region area, and select the Gaussian centroid coordinates and corresponding channels of the top 2×M×N candidate regions.

[0013] S4. Using the positional relationship and grayscale distribution of candidate points, perform energy integration and calculate the position of the peak, locate the position of the spot array and extract the center position of the M×N spot array to generate an equidistant theoretical spot array.

[0014] S5. Using the position of the theoretical spot array, the position of the actual spot is calculated using projective transformation, and the missing spot is filled in. The spot array is then corrected for secondary positioning using a seed point segmentation algorithm. Projective transformation is then performed iteratively to correct the spot deviation. Finally, the straight line is fitted to obtain the sub-pixel level spot position.

[0015] Preferably, the image filtering process specifically involves performing 5×5 Gaussian filtering, mean filtering, and 3×3 Gaussian filtering consecutively.

[0016] The preferred method for evaluating the region for each connected component is as follows:

[0017]

[0018] Where: r represents passing the evaluation system, b represents the indicator exceeding the maximum threshold, and s represents the indicator falling below the threshold.

[0019] Minimum threshold For the connected region Ω i area max area min This represents the upper and lower bounds of the area of ​​the connected region; For the connected region Ω i The aspect ratio of the circumscribed rectangle.max ratio min This represents the upper and lower bounds of the aspect ratio of the bounding rectangle; R represents the intensity of the red channel at the Gaussian centroid of the connected domain. the This is the minimum threshold for the intensity of the red channel at the Gaussian centroid of the light spot.

[0020] Preferably, step S4 specifically includes:

[0021] S41. Calculate the maximum radius of the light spot using the maximum area of ​​the candidate region, and generate a template for the entire image using the Gaussian centroid coordinates and the maximum radius of the light spot. That is, for each Gaussian centroid coordinate, generate a circular MASK segmentation image with the maximum radius of the light spot as the radius.

[0022] S42. Integrate the segmented image along the X and Y axes respectively to obtain two one-dimensional results ΔX and ΔY after integration;

[0023] S43. Use the peak values ​​of the one-dimensional results after two integrations to locate the light spot. Use the position of the first peak in ΔX (1) and the position of the Mth peak in ΔX (M) and the position of the first peak in ΔY (1) and the position of the Nth peak in ΔY (N) to locate the four corner coordinates of the light spot array (ΔX (1), ΔY (1)), (ΔX (1), ΔY (N)), (ΔX (M), ΔY (1)), (ΔX (M), ΔY (N)).

[0024] S44. Generate a theoretical light spot array using the four corner coordinates of the light spot array. The theoretical light spot array represents the distribution of light spots under vertical illumination. Calculate the horizontal and vertical spacing of the four corner coordinates. Divide the horizontal and vertical spacing into M×N equal parts to generate the coordinates of the M×N theoretical light spot array elements.

[0025] Preferably, the one-dimensional results ΔX and ΔY are as follows:

[0026]

[0027] Where: H is the height of the image, and W is the width of the image;

[0028] The horizontal spacing is as follows:

[0029]

[0030] The vertical spacing is as follows:

[0031]

[0032] The specific coordinates of the elements in the M×N theoretical light spot array are:

[0033] l ij=(ΔY(1)+(i-1)·η, ΔX(1)+(j-1)·μ), i=1, 2…M, j=1, 2…N

[0034] Where ΔX(M) is the position of the Mth peak, ΔY(1) is the position of the first peak, and ΔY(N) is the position of the Nth peak.

[0035] Preferably, step S5 specifically includes:

[0036] S51. Within the neighborhood of each element in the theoretical grid, find the actual light spot in the Gaussian centroid of the candidate region. Record the found actual light spots as identified and record the corresponding positions of the unidentified points.

[0037] S52. Based on the planar transformation relationship from each element in the theoretical grid to the actual light spot, solve the projective transformation matrix through four non-collinear points;

[0038] S53. Calculate the corresponding position of the unidentified point using the projective transformation matrix and the position of the theoretical mesh element, and then calculate the pixel position of the unidentified point;

[0039] S54. Perform seed point segmentation on the M×N light spot array points, perform secondary optimization positioning, and establish eight-neighborhoods. Start growth from the brightest point in the vicinity of the actual light spot, selecting directions from the eight-neighborhood array and judging growth conditions. If no neighboring seed points of a seed point have grown, determine if a threshold condition is met. When all seed points cannot grow, stop segmenting the spot's precise contour and calculate the contour's Gaussian centroid O. i ′;

[0040] S54. Utilize all candidate points O i ′ and theoretical point l ij Recalculate the projective transformation matrix H', and apply the recalculated projective transformation matrix H' to O. i The process involves iteratively updating H', which involves using H' to calculate the corresponding position of unidentified points, then using the generated results to correct O'i, recalculating H'', until the output O'i reaches a stable state.

[0041] Preferably, the planar transformation relationship from each element in the theoretical mesh to the actual light spot is as follows:

[0042]

[0043]

[0044] The projective transformation matrix is:

[0045]

[0046] The corresponding position γ of the unidentified pointi for:

[0047]

[0048] The eight-neighbor delta is:

[0049] a=[(-1 -1) (0 -1) (1 -1) (1 0) (1 1) (0 1) (-1 1)(-1 0)]

[0050] The threshold condition is:

[0051]

[0052] Among them, O i Let i be the coordinates of the Gaussian centroid of the candidate region, i = 1, 2, 3…2 × M × N; l ij For the light spot in the i-th row and j-th column of the theoretical grid neighborhood, l ij (x) is l ij The corresponding x-coordinate, l ij (y) is l ij The corresponding ordinate; p ij p is the light spot detected in the i-th row and j-th column of the theoretical grid neighborhood. ij (x) is p ij The corresponding x-coordinate, p ij (y) is p ij The corresponding ordinate; γ i For the missing light spot in the light spot array, γ i (x) is γ i The corresponding x-coordinate, γ i (y) is γ i The corresponding ordinate.

[0053] A laser spot array detection system for structured light parameter calibration, based on the aforementioned laser spot array detection method for structured light parameter calibration, includes a structured light camera, an image correction module, a filtering module, a channel extraction module, a region filtering module, a theoretical spot array generation module, a projective transformation module, a seed point segmentation module, and an iterative correction module.

[0054] A structured light camera is used to capture a full-color image of the object to be detected, containing an M×N array of laser spots, on a laser calibration plane.

[0055] The image correction module is used to perform distortion correction processing on the image to be detected using the intrinsic lens distortion coefficients of the calibrated structured light camera to obtain a corrected image.

[0056] The filtering module is used to perform image filtering on the corrected image to reduce image noise;

[0057] The channel extraction module is used to decompose the filtered image into an RGB three-channel image, extract the red channel, and filter out the interference of other channel colors on spot detection;

[0058] The region filtering module is used to perform full-image adaptive threshold segmentation on the red channel image, perform erosion and dilation operations on the segmented image, evaluate each connected component, sort the regions by area, and filter the Gaussian centroid coordinates and corresponding channels of the top 2×M×N candidate regions.

[0059] The theoretical spot array generation module is used to perform energy integration and calculate the position of the peak by utilizing the positional relationship and energy distribution of candidate points, locate the position of the spot array and extract the center position of the M×N spot array, and generate an equidistant theoretical spot array.

[0060] The projective transformation module is used to calculate the position of the actual light spot using the position of the theoretical light spot array and the projective transformation algorithm, and to fill in the missing light spots.

[0061] The seed point segmentation module is used to perform secondary positioning correction on the spot array using the seed point segmentation algorithm;

[0062] The iterative correction module is used to iteratively perform projective transformation to correct the spot deviation, and finally fit the straight line to obtain the sub-pixel spot position.

[0063] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the laser spot array detection method for structured light parameter calibration.

[0064] A processing terminal includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the laser spot array detection method for structured light parameter calibration.

[0065] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a laser spot array detection method and system for structured light parameter calibration. Based on the M×N array spot image captured by an uncalibrated structured light camera under calibration conditions, the position of the M×N array spot captured by the camera can be automatically located without manual marking, reducing the difficulty of structured light camera pipeline calibration. The captured M×N array spot image may contain spot-like noise and spot missing phenomena, improving reliability and robustness. The positioning accuracy of the M×N array spot can reach the sub-pixel level, improving the accuracy of structured light camera parameter calibration, which is of great significance for completing the automated calibration of structured light endoscope systems. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0067] Figure 1 A schematic diagram of a laser spot array detection method for structured light parameter calibration provided by the present invention;

[0068] Figure 2 A schematic diagram of the various indicators for candidate point evaluation and screening provided by this invention;

[0069] Figure 3 A schematic diagram of the energy integration method detection site provided by the present invention;

[0070] Figure 4 This is a schematic diagram of the X-axis integration results provided by the present invention;

[0071] Figure 5 This is a schematic diagram of the Y-axis integration results provided by the present invention;

[0072] Figure 6 This is a schematic diagram of the segmented region provided by the present invention;

[0073] Figure 7 A schematic diagram of perspective transformation provided by the present invention;

[0074] Figure 8 This is a schematic diagram illustrating the calculation of missing position coordinates using planar transformation provided by the present invention. Detailed Implementation

[0075] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0076] In practical applications, the structured light camera is a combination of a monocular camera and a projection system, capable of emitting a laser spot array with a specific distribution pattern. The distribution pattern of the laser spot array is determined to be M×N, with the laser spots equidistantly distributed and exhibiting essentially uniform brightness during vertical illumination. The laser spots should have a certain grayscale difference from the background, requiring their brightness to be higher than the working background, and they should be segmentable by an adaptive threshold segmentation algorithm. The calibration environment may exhibit some surface absorption and reflection phenomena, but the calibration plane must be free of uneven surfaces or steps. Surface absorption should not disrupt the distribution pattern of the spot array; that is, no row or column should be completely absorbed, rendering it undetectable. This invention uses a structured light camera to capture an image of the spot array, which is then segmented into multiple candidate regions using adaptive threshold detection. These candidate regions are then filtered. Energy integration is performed on the filtered regions to calculate the peak position, locate the spot array, and generate a theoretical spot array. Projective transformation is then used to calculate the actual spot positions from the theoretical spots, filling in any missing spots. The seed point segmentation algorithm is used to perform secondary positioning correction on the light spot. Based on the distribution pattern information of the light spot array, the projective transformation is iteratively performed to correct the light spot deviation and obtain the sub-pixel level light spot position.

[0077] Example 1 discloses a laser spot array detection method for structured light parameter calibration, such as... Figure 1 This includes the following steps:

[0078] S1. On the laser calibration plane, a full-color image I1 containing an M×N array of laser spots is captured using a structured light camera. The image to be detected is then distorted using the intrinsic parameters of the calibrated structured light camera and the lens distortion coefficients to obtain a rectified image I2 in RGB format. The rectified image is then filtered to reduce image noise.

[0079] S2. Decompose the filtered image into an RGB three-channel image, extract the red channel, and filter out the interference of other channel colors on spot detection;

[0080] S3. Perform full-image adaptive thresholding segmentation on the red channel image, dividing the entire image into patches and calculating an adaptive threshold for each path to segment the entire image. Then, apply erosion and dilation operations to the segmented image using a 3×3 template to filter out interference from small segmentation regions on the positioning accuracy. Finally, for each connected component Ω... i Regional evaluation was conducted, and the Gaussian centroid coordinates O of the top 2×M×N candidate regions were selected by sorting them by area. i and corresponding channels;

[0081] S4. Using the positional relationship and grayscale distribution of candidate points, perform energy integration and calculate the position of the peak, locate the position of the spot array and extract the center position of the M×N spot array to generate an equidistant theoretical spot array.

[0082] S5. Using the position of the theoretical spot array, the position of the actual spot is calculated using projective transformation, and the missing spot is filled in. The spot array is then corrected for secondary positioning using a seed point segmentation algorithm. Projective transformation is then performed iteratively to correct the spot deviation. Finally, the straight line is fitted to obtain the sub-pixel level spot position.

[0083] To further implement the above technical solution, the image filtering process specifically involves continuously performing 5×5 Gaussian filtering, mean filtering, and 3×3 Gaussian filtering.

[0084] In this embodiment, the filter template is:

[0085]

[0086] Where: gaus_kernel1 is the Gaussian kernel for the first filtering, gaus_kernel2 is the Gaussian kernel for the second filtering, and avr_kernel is the template for mean filtering.

[0087] To further implement the above technical solution, the method for evaluating the region of each connected component is as follows:

[0088]

[0089] Where: r represents passing the evaluation system, b represents the indicator exceeding the maximum threshold, and s represents the indicator falling below the minimum threshold. For the connected region Ω i area max area min To define the upper and lower bounds of the area of ​​the connected region, the actual spot size is usually considered when taking the area. max =1500, area min =50; For the connected region Ω i The aspect ratio of the circumscribed rectangle. max ratio min The ratio is the upper and lower bounds of the aspect ratio of the circumscribed rectangle, and is usually taken into account considering the actual shape of the light spot. max =1.5, ratio min =0.67; R represents the intensity of the red channel at the Gaussian centroid of the connected domain. the The minimum threshold for the intensity of the red channel at the Gaussian centroid of the light spot is given by, for example... Figure 2 ;

[0090] After satisfying three evaluations, save the location O of the Gaussian centroid of the region. i Sort by region area and save the centroids of the top 2×M×N regions. If the area is less than 2×M×N, save all of them.

[0091] To further implement the above technical solutions, such as Figures 3-6 Step S4 specifically includes:

[0092] S41. Utilize the maximum area S of the candidate region max Calculate the maximum radius R of the light spot. max A template is generated for the entire image using the Gaussian centroid coordinates and the maximum radius of the light spot, i.e., for each Gaussian centroid coordinate O i i = 1, 2, 3…2×M×N, generate a circular MASK segmentation image with the maximum radius of the light spot as the radius;

[0093] Maximum radius R of the light spot max for:

[0094]

[0095] S42. Integrate the segmented image along the X and Y axes respectively to obtain two one-dimensional results ΔX and ΔY after integration;

[0096] S43. Due to the distribution characteristics and features of the light spot, the M×N light spot array should have MN peaks in ΔX and ΔY, and the distance between each pair of the MN peaks should not be too large. Then, the peaks of the two integrated one-dimensional results are used to locate the light spot. The four corner coordinates of the light spot array are located using the positions of the first peak in ΔX (1), the Mth peak in ΔX (M), the first peak in ΔY (1), and the Nth peak in ΔY (N).

[0097] S44. Generate a theoretical light spot array L using the four corner coordinates of the light spot array. The theoretical light spot array represents the light spot distribution under perpendicular illumination. Calculate the horizontal and vertical spacing of the four corner coordinates. Divide the horizontal and vertical spacings into M×N equal parts to generate the coordinates l of the M×N theoretical light spot array elements. ij .

[0098] To further implement the above technical solution, the one-dimensional results ΔX and ΔY are as follows:

[0099]

[0100] Where: H is the height of the image, and W is the width of the image;

[0101] The horizontal spacing is as follows:

[0102]

[0103] The vertical spacing is as follows:

[0104]

[0105] The specific coordinates of the elements in the M×N theoretical light spot array are:

[0106] l ij =(ΔY(1)+(i-1)·η,ΔX(1)+(j-1)·μ),i=1,2…M,j×1,2…N

[0107] Where ΔX(M) is the position of the Mth peak, ΔY(1) is the position of the first peak, and ΔY(N) is the position of the Nth peak.

[0108] To further implement the above technical solution, step S5 specifically includes:

[0109] S51. In each element l of the theoretical grid ij Within the vicinity of the candidate region, the Gaussian centroid O i Find the actual light spot p ij The actual light spot p that was found ij Record the points as identified, and also record the corresponding positions γ of the unidentified points. i ;

[0110] S52. Based on the planar transformation relationship from each element in the theoretical mesh to the actual light spot, such as... Figure 7 The projective transformation matrix is ​​solved by using four non-collinear points;

[0111] S53. Calculate the corresponding positions of unidentified points using the projective transformation matrix and the positions of theoretical mesh elements, thereby calculating the pixel positions of the unidentified points, such as... Figure 8 ;

[0112] S54. Seed point segmentation is performed on the M×N light spot array points, secondary optimization positioning is carried out, and an eight-neighbor delta is established; from the actual light spot p ij Growth begins at the brightest point in the nearest neighborhood. Directions are selected from the eight-neighbor delta array, and growth conditions are checked. If no neighboring seed points of the seed point (seed) have grown, a threshold condition is checked. If no seed points can grow, the segmentation of the spot's precise contour is stopped, and the Gaussian centroid O of the contour is calculated. i ′;

[0113] S54. Utilize all candidate points O′ iand theoretical point l′ ij Recalculate the projective transformation matrix H′, and apply the recalculated projective transformation matrix H′ to O. i The process involves iterative updates, where H′ is used to calculate the corresponding positions of unidentified points, and the generated results are then used to correct O′. i Recalculate H″ until the output is O. i It reaches a stable state and basically stops changing.

[0114] To further implement the above technical solution, since the transformation from vertical shooting to actual angle shooting is essentially a planar transformation, each element l in the theoretical mesh... ij To the actual light spot p ij The plane transformation relationship is as follows:

[0115]

[0116] Wherein, the projective transformation matrix H can be set as

[0117]

[0118] Substituting H into the plane transformation relation, we get:

[0119]

[0120] The above equation is derived as follows:

[0121]

[0122] Given a projective transformation matrix H, multiplying its elements by the same number results in a homography a*H that has the same effect as H. We can assume a to be 1 / h. 22 Then H has only 8 free elements, and the projective transformation matrix H can be solved by 4 non-collinear points;

[0123] In practical applications, the projective transformation equation in the projective transformation algorithm includes 8 unknowns. A set of corresponding points can provide 2 sets of solutions, therefore at least 4 sets of corresponding points are needed to solve for H. However, to ensure that the algorithm's accuracy can reach the sub-pixel level, in reality, at least 4 sets of corresponding points are required. Groups or more, that is, at least Each light spot can be identified by an adaptive threshold algorithm;

[0124] The corresponding position γ of the unidentified point i for:

[0125]

[0126] The eight-neighbor delta is:

[0127] delat=[(-1 -1) (0 -1) (1 -1) (1 0) (1 1) (0 1) (-1 1) (-1 0)]

[0128] The threshold condition is:

[0129]

[0130] Among them, O i Let i be the coordinates of the Gaussian centroid of the candidate region, i = 1, 2, 3…2 × M × N; l ij For the light spot in the i-th row and j-th column of the theoretical grid neighborhood, l ij (x) is l ij The corresponding x-coordinate, l ij (y) is l ij The corresponding ordinate; p ij p is the light spot detected in the i-th row and j-th column of the theoretical grid neighborhood. ij (x) is p ij The corresponding x-coordinate, p ij (y) is p ij The corresponding ordinate; γ i For the missing light spot in the light spot array, γ i (x) is γ i The corresponding x-coordinate, γ i (y) is γ i The corresponding ordinate.

[0131] This invention provides data support for the calibration of structured light camera parameters by accurately locating the laser spot array captured by the structured light camera, thereby improving the accuracy of the calibration. It eliminates the need for manual determination of spot positions, allows for the calculation and generation of missing spots, and improves the reliability and robustness of the method through iterative optimization.

[0132] Example 2: A laser spot array detection system for structured light parameter calibration, based on a laser spot array detection method for structured light parameter calibration, including a structured light camera, an image correction module, a filtering module, a channel extraction module, a region filtering module, a theoretical spot array generation module, a projective transformation module, a seed point segmentation module, and an iterative correction module;

[0133] A structured light camera is used to capture a full-color image of the object to be detected, containing an M×N array of laser spots, on a laser calibration plane.

[0134] The image correction module is used to perform distortion correction processing on the image to be detected using the intrinsic lens distortion coefficients of the calibrated structured light camera to obtain a corrected image.

[0135] The filtering module is used to perform image filtering on the corrected image to reduce image noise;

[0136] The channel extraction module is used to decompose the filtered image into an RGB three-channel image, extract the red channel, and filter out the interference of other channel colors on spot detection;

[0137] The region filtering module is used to perform full-image adaptive threshold segmentation on the red channel image, perform erosion and dilation operations on the segmented image, evaluate each connected component, sort the regions by area, and filter the Gaussian centroid coordinates and corresponding channels of the top 2×M×N candidate regions.

[0138] The theoretical spot array generation module is used to perform energy integration and calculate the position of the peak by utilizing the positional relationship and energy distribution of candidate points, locate the position of the spot array and extract the center position of the M×N spot array, and generate an equidistant theoretical spot array.

[0139] The projective transformation module is used to calculate the position of the actual light spot using the position of the theoretical light spot array and the projective transformation algorithm, and to fill in the missing light spots.

[0140] The seed point segmentation module is used to perform secondary positioning correction on the spot array using the seed point segmentation algorithm;

[0141] The iterative correction module is used to iteratively perform projective transformation to correct the spot deviation, and finally fit the straight line to obtain the sub-pixel spot position.

[0142] Example 3: A computer-readable storage medium storing a computer program that, when executed by a processor, implements a laser spot array detection method for structured light parameter calibration.

[0143] Example 4: A processing terminal includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements a laser spot array detection method for structured light parameter calibration.

[0144] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0145] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A laser spot array detection method for structured light parameter calibration, characterized in that, Includes the following steps: S1. On the laser calibration plane, a full-color image of the image to be detected containing an M×N array of laser spots is captured using a structured light camera. The image to be detected is then subjected to distortion correction using the intrinsic parameters of the calibrated structured light camera and the lens distortion coefficients to obtain a corrected image. Finally, the corrected image is subjected to image filtering to reduce image noise. S2. Decompose the filtered image into an RGB three-channel image, extract the red channel, and filter out the interference of other channel colors on spot detection; S3. Perform full-image adaptive threshold segmentation on the red channel image, perform erosion and dilation operations on the segmented image, evaluate each connected region, sort by region area, and select the Gaussian centroid coordinates and corresponding channels of the top 2×M×N candidate regions. S4. Using the positional relationship and grayscale distribution of candidate points, perform energy integration and calculate the position of the peak, locate the position of the spot array and extract the center position of the M×N spot array to generate an equidistant theoretical spot array. S5. Using the position of the theoretical spot array, the position of the actual spot is calculated using projective transformation, and the missing spot is filled in. The spot array is then corrected for secondary positioning using a seed point segmentation algorithm. Projective transformation is then performed iteratively to correct the spot deviation. Finally, the straight line is fitted to obtain the sub-pixel level spot position.

2. The laser spot array detection method for structured light parameter calibration according to claim 1, characterized in that, The image filtering process specifically involves performing 5×5 Gaussian filtering, mean filtering, and 3×3 Gaussian filtering consecutively.

3. The laser spot array detection method for structured light parameter calibration according to claim 1, characterized in that, The method for evaluating the region for each connected component is as follows: Where: r represents passing the evaluation system, b represents the indicator exceeding the maximum threshold, and s represents the indicator falling below the minimum threshold. For the connected region Ω i area max area min This represents the upper and lower bounds of the area of ​​the connected region; For the connected region Ω i The aspect ratio of the circumscribed rectangle. max ratio min This represents the upper and lower bounds of the aspect ratio of the bounding rectangle; R represents the intensity of the red channel at the Gaussian centroid of the connected domain. the This is the minimum threshold for the intensity of the red channel at the Gaussian centroid of the light spot.

4. The laser spot array detection method for structured light parameter calibration according to claim 1, characterized in that, Step S4 specifically includes: S41. Calculate the maximum radius of the light spot using the maximum area of ​​the candidate region, and generate a template for the entire image using the Gaussian centroid coordinates and the maximum radius of the light spot. That is, for each Gaussian centroid coordinate, generate a circular MASK segmentation image with the maximum radius of the light spot as the radius. S42. Integrate the segmented image along the X and Y axes respectively to obtain two one-dimensional results ΔX and ΔY after integration; S43. Use the peak values ​​of the one-dimensional results after two integrations to locate the light spot. Use the position of the first peak in ΔX (1) and the position of the Mth peak in ΔX (M) and the position of the first peak in ΔY (1) and the position of the Nth peak in ΔY (N) to locate the four corner coordinates of the light spot array (ΔX (1), ΔY (1)), (ΔX (1), ΔY (N)), (ΔX (M), ΔY (1)), (ΔX (M), ΔY (N)). S44. Generate a theoretical light spot array using the four corner coordinates of the light spot array. The theoretical light spot array represents the distribution of light spots under vertical illumination. Calculate the horizontal and vertical spacing of the four corner coordinates. Divide the horizontal and vertical spacing into M×N equal parts to generate the coordinates of the M×N theoretical light spot array elements.

5. A laser spot array detection method for structured light parameter calibration according to claim 4, characterized in that, The one-dimensional results ΔX and ΔY are as follows: Where: H is the height of the image, and W is the width of the image; The horizontal spacing is as follows: The vertical spacing is as follows: The specific coordinates of the elements in the M×N theoretical light spot array are: l ij =(ΔY(1)+(i-1)·η,ΔX(1)+(j-1)·μ),i=1,2…M,j=1,2…N Where ΔX(M) is the position of the Mth peak, ΔY(1) is the position of the first peak, and ΔY(N) is the position of the Nth peak.

6. The laser spot array detection method for structured light parameter calibration according to claim 1, characterized in that, Step S5 specifically includes: S51. Within the neighborhood of each element in the theoretical grid, find the actual light spot in the Gaussian centroid of the candidate region. Record the found actual light spots as identified and record the corresponding positions of the unidentified points. S52. Based on the planar transformation relationship from each element in the theoretical grid to the actual light spot, solve the projective transformation matrix through four non-collinear points; S53. Calculate the corresponding position of the unidentified point using the projective transformation matrix and the position of the theoretical mesh element, and then calculate the pixel position of the unidentified point; S54. Perform seed point segmentation on the M×N light spot array points, perform secondary optimization positioning, and establish eight-neighborhoods; start growth from the brightest point in the neighborhood of the actual light spot, select directions from the eight-neighborhood array, and judge the growth conditions. If the neighboring seed points of a seed point have not grown, determine whether the threshold condition is met. When all seed points cannot grow, stop segmenting the spot's precise contour and calculate the Gaussian centroid coordinates O of the candidate region. i ; S55. Utilize the Gaussian centroid coordinates O of the candidate region i The light spot l in the i-th row and j-th column of the theoretical grid neighborhood ij Recalculate the projective transformation matrix H, and then apply the recalculated projective transformation matrix H to O. i Iterative updates are performed, that is, the corresponding positions of unidentified points are calculated using the projective transformation matrix H, and then the generated results are used to correct O. i Recalculate the projective transformation matrix H until the output O is reached. i To reach stability.

7. The laser spot array detection method for structured light parameter calibration according to claim 6, characterized in that, The planar transformation relationship from each element in the theoretical mesh to the actual light spot is as follows: The projective transformation matrix is: The corresponding position γ of the unidentified point i for: The eight-neighbor delta is: delta=[(-1 -1) (0 -1) (1 -1) (1 0) (1 1) (0 1) (-1 1) (-1 0)] The threshold condition is: Among them, O i Let i be the coordinates of the Gaussian centroid of the candidate region, i = 1, 2, 3…2 × M × N; l ij For the light spot in the i-th row and j-th column of the theoretical grid neighborhood, l ij (x) is l ij The corresponding x-coordinate, l ij (y) is l ij The corresponding ordinate; p ij p is the light spot detected in the i-th row and j-th column of the theoretical grid neighborhood. ij (x) is p ij The corresponding x-coordinate, p ij (y) is p ij The corresponding ordinate; γ i For the missing light spot in the light spot array, γ i (x) is γ i The corresponding x-coordinate, γ i (y) is γ i The corresponding ordinate.

8. A laser spot array detection system for structured light parameter calibration, characterized in that, The system is used to implement the laser spot array detection method for structured light parameter calibration as described in any one of claims 1-7. The system includes a structured light camera, an image correction module, a filtering module, a channel extraction module, a region filtering module, a theoretical spot array generation module, a projective transformation module, a seed point segmentation module, and an iterative correction module. A structured light camera is used to capture a full-color image of the object to be detected, containing an M×N array of laser spots, on a laser calibration plane. The image correction module is used to perform distortion correction processing on the image to be detected using the intrinsic lens distortion coefficients of the calibrated structured light camera to obtain a corrected image. The filtering module is used to perform image filtering on the corrected image to reduce image noise; The channel extraction module is used to decompose the filtered image into an RGB three-channel image, extract the red channel, and filter out the interference of other channel colors on spot detection; The region filtering module is used to perform full-image adaptive threshold segmentation on the red channel image, perform erosion and dilation operations on the segmented image, evaluate each connected component, sort the regions by area, and filter the Gaussian centroid coordinates and corresponding channels of the top 2×M×N candidate regions. The theoretical spot array generation module is used to perform energy integration and calculate the position of the peak by utilizing the positional relationship and grayscale distribution of candidate points, locate the position of the spot array and extract the center position of the M×N spot array, and generate an equidistant theoretical spot array. The projective transformation module is used to calculate the position of the actual light spot using the position of the theoretical light spot array and the projective transformation algorithm, and to fill in the missing light spots. The seed point segmentation module is used to perform secondary positioning correction on the spot array using the seed point segmentation algorithm; The iterative correction module is used to iteratively perform projective transformation to correct the spot deviation, and finally fit the straight line to obtain the sub-pixel spot position.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements a laser spot array detection method for structured light parameter calibration as described in any one of claims 1-7.

10. A processing terminal, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements a laser spot array detection method for structured light parameter calibration as described in any one of claims 1-7.