A laser three-dimensional contour measurement method and device
By acquiring standard sample images and marking the target area in laser 3D contour measurement, calculating the affine transformation matrix, and using MEMS galvanometer local scanning to generate a 3D point cloud map, the problem of excessive point cloud acquisition in irrelevant areas is solved, improving measurement accuracy and reducing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN LICHUAN AUTOMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-30
Smart Images

Figure CN122305966A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional contour measurement technology, and in particular to a laser three-dimensional contour measurement method and apparatus. Background Technology
[0002] In the field of industrial automation inspection, laser 3D contour measurement technology is widely used for the precision inspection of product surface morphology. Existing technologies use laser line scanning cameras or structured light cameras to perform non-discriminatory scanning of the entire product surface, and then use a back-end industrial control computer to perform 3D modeling of the full-area point cloud data, and then extract the contour features of the target area from the model. This workflow results in the collection and calculation of a large number of irrelevant area point clouds, a low proportion of effective point clouds, insufficient point cloud density in the target area, and limited measurement accuracy.
[0003] To cover a wide spatial angle across the entire surface of the product, existing solutions require wide-angle optical shaping of the laser beam. This shaping process introduces geometric distortion in the X-direction, resulting in a loss of measurement accuracy in the X-axis direction. Furthermore, the complex optical path shaping design leads to a complex system structure, high cost, and poor maintainability. In addition, existing solutions use servo motors to drive the stage to translate at a constant speed to complete the full-area scan. Positional deviations, angular deviations, and height differences at each product placement require compensation through subsequent model matching steps. The computational load of full-area 3D modeling is enormous, relying on high-performance industrial control computers, increasing the hardware cost and deployment complexity of laser 3D contour measurement. Summary of the Invention
[0004] The main objective of this invention is to provide a laser three-dimensional contour measurement method and device. This invention eliminates all translation, rotation and height deviations that occur when the product is placed each time through affine transformation, without relying on model matching steps for pose compensation. The three-dimensional coordinates of each target point are summarized in the order of the scanning path to directly generate a three-dimensional point cloud map covering the contour measurement target area, without the need to perform full-domain three-dimensional modeling, and the backend computing resource requirements are greatly reduced.
[0005] To achieve the above objectives, the present invention provides a laser three-dimensional contour measurement method, comprising the following steps: Acquire the first image of the standard sample, mark the contour measurement target area on the first image, and obtain the reference point set; Acquire a second image of the product to be tested, calculate the affine transformation matrix from the first image to the second image, and transform the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points to be tested in the second image coordinate system. The working angle range of the MEMS galvanometer is determined based on the set of points to be tested. The MEMS galvanometer is controlled to deflect within the working angle range, reflecting the laser spot to each target point on the surface of the product under test and calculating the three-dimensional coordinates of each target point. The three-dimensional coordinates of each target point are then summarized to generate a three-dimensional point cloud map of the contour measurement target area.
[0006] Optionally, in a first implementation of the first aspect of the present invention, acquiring a first image of a standard sample and marking the contour measurement target area on the first image to obtain a reference point set includes: Configure the image exposure time and laser emission power parameters, acquire images of the standard sample, and obtain the first image; The contour measurement target area is marked in the pixel coordinate system of the first image to obtain a reference point matrix set.
[0007] Optionally, in a second implementation of the first aspect of the present invention, the step of acquiring a second image of the product to be tested, calculating an affine transformation matrix from the first image to the second image, and transforming the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points to be tested in the second image coordinate system includes: Perform FAST corner detection on the first image to obtain a first descriptor set, and perform FAST corner detection on the second image to obtain a second descriptor set; The first descriptor subset and the second descriptor subset are matched to obtain matching feature point pairs; The affine transformation matrix is solved based on the matching feature point pairs, and the coordinate transformation is performed on the reference point set based on the affine transformation matrix to obtain the point set to be measured.
[0008] Optionally, in a third implementation of the first aspect of the present invention, the step of solving the affine transformation matrix based on the matching feature point pairs and performing coordinate transformation on the reference point set based on the affine transformation matrix to obtain the test point set includes: Three sets of feature point pairs are randomly selected from the matched feature point pairs to solve for the initial transformation matrix; The reprojection error of all the matching feature point pairs is calculated based on the initial transformation matrix. The matching feature point pairs with reprojection errors less than the error threshold are retained as the inlier set, and the affine transformation matrix is solved based on the inlier set. The pixel coordinates of each reference point in the reference point set are transformed according to the affine transformation matrix to obtain the point set to be tested.
[0009] Optionally, in a fourth implementation of the first aspect of the present invention, determining the working angle range of the MEMS galvanometer based on the set of points to be measured includes: The set of points to be tested is arranged in rows and columns according to the scanning order of the MEMS galvanometer in the y-direction to obtain an ordered scanning matrix; The working angle range of the MEMS galvanometer is determined based on the ordered scanning matrix.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, determining the working angle range of the MEMS galvanometer based on the ordered scanning matrix includes: Based on the row range of the ordered scanning matrix, the starting and ending row coordinates of the MEMS galvanometer in the y direction are determined, and the working angle range of the MEMS galvanometer in the y direction is obtained. Calculate the working angle interval in the x-direction corresponding to each row in the ordered scanning matrix, and take the working angle interval in the x-direction of all rows and the working angle interval in the y-direction as the working angle interval of the MEMS galvanometer.
[0011] Optionally, in a sixth implementation of the first aspect of the present invention, controlling the MEMS galvanometer to deflect within the working angle range, reflecting the laser spot to each target point on the surface of the product under test and calculating the three-dimensional coordinates of each target point, summarizing the three-dimensional coordinates of each target point, and generating a three-dimensional point cloud map of the contour measurement target area includes: The MEMS galvanometer is controlled to deflect point by point within the working angle range, and the laser spot is reflected sequentially to each target point on the surface of the product under test, and the Z-axis distance of each target point is calculated. Based on the deflection angle of the MEMS galvanometer at each target point, the X-axis and Y-axis coordinates of each target point are calculated, and the three-dimensional coordinates of each target point are constructed by combining the X-axis coordinates, the Y-axis coordinates and the Z-axis distance. The three-dimensional coordinates of each target point are summarized to generate a three-dimensional point cloud map of the contour measurement target area.
[0012] Optionally, in the seventh implementation of the first aspect of the present invention, controlling the MEMS galvanometer to deflect point by point according to the working angle range, reflecting the laser spot sequentially to each target point on the surface of the product under test, and calculating the Z-axis distance of each target point includes: The MEMS galvanometer is controlled to deflect point by point according to the working angle range, and the laser spot is reflected sequentially to each target point on the surface of the product under test. The light receiver lens module gathers the reflected light from each target point to the light receiving chip, and the offset of the light spot corresponding to each target point on the light receiving chip relative to the center of the light receiving chip is extracted to obtain the light spot offset of each target point. Based on the spot offset of each target point, the baseline distance between the laser emission center and the center of the light receiving chip, the focal length of the light receiver lens, and the laser incident angle, the Z-axis distance of each target point is calculated using the laser triangulation method.
[0013] Optionally, in an eighth implementation of the first aspect of the present invention, the step of summarizing the three-dimensional coordinates of each target point to generate a three-dimensional point cloud map of the contour measurement target area includes: The three-dimensional coordinates of each target point are summarized according to the scanning path sequence corresponding to the working angle interval to obtain a set of three-dimensional coordinates; The three-dimensional coordinates of each target point in the three-dimensional coordinate set are mapped to the coordinate system of the standard sample to generate a three-dimensional point cloud map of the contour measurement target area.
[0014] The present invention also provides a laser three-dimensional contour measurement device, comprising: The acquisition module is used to acquire the first image of the standard sample, mark the contour measurement target area on the first image, and obtain the reference point matrix set; The coordinate transformation module is used to acquire a second image of the product under test, calculate the affine transformation matrix from the first image to the second image, and transform the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points under test in the second image coordinate system. Angle analysis module is used to determine the working angle range of the MEMS galvanometer based on the set of points to be measured; The coordinate calculation module is used to control the MEMS galvanometer to deflect within the working angle range, reflect the laser spot to each target point on the surface of the product under test, calculate the three-dimensional coordinates of each target point, summarize the three-dimensional coordinates of each target point, and generate a three-dimensional point cloud map of the contour measurement target area.
[0015] In summary, this invention establishes a reference point set by annotating the contour measurement target area of the first image of the standard sample before scanning. Then, ORB feature point extraction and Hamming distance matching are performed on the second image of the product under test and the first image. Based on the RANSAC algorithm, the affine transformation matrix is solved, and the reference point set is transformed to obtain the target point set of the current product. This eliminates all translation, rotation, and height deviations that occur during product placement through affine transformation, eliminating the need for pose compensation via model matching. Furthermore, this invention arranges the target point set in rows and columns according to the scanning direction of the MEMS galvanometer, obtaining the working angle range of the MEMS galvanometer. This allows the MEMS galvanometer to deflect point-by-point only within the angle range containing the effective measurement target, skipping all non-target areas and eliminating the acquisition and calculation of invalid point clouds, thus increasing the point cloud density in the target area. Since the MEMS galvanometer only operates within a local small angle range, there is no need for large-scale wide-angle optical shaping of the laser beam, eliminating the X-axis accuracy loss introduced by wide-angle shaping in existing technologies. This simplifies the optical path structure, improves maintainability, and reduces overall hardware costs. The 3D coordinates of each target point are summarized in the order of the scanning path to directly generate a 3D point cloud map covering the target area of the contour measurement, without the need to perform full-domain 3D modeling, which greatly reduces the backend computing resource requirements. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the steps of a laser three-dimensional contour measurement method in one embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the steps of marking the target area for contour measurement in an embodiment of the present invention; Figure 3 This is a schematic diagram of the coordinate transformation steps in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the steps for determining the working angle range of a MEMS galvanometer in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the steps of generating a 3D point cloud map of the contour measurement target area in an embodiment of the present invention; Figure 6 This is a structural block diagram of the laser three-dimensional contour measurement device in an embodiment of the present invention; Figure 7 This is a schematic diagram of the overall structure of the laser three-dimensional contour measuring device in an embodiment of the present invention; Figure 8 This is a schematic diagram of the internal structure of the laser component in an embodiment of the present invention.
[0017] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0019] Reference Figure 1 This embodiment provides a laser three-dimensional contour measurement method, including the following steps: S1, acquire the first image of the standard sample, mark the contour measurement target area on the first image, and obtain the reference point set; S2, acquire the second image of the product to be tested, calculate the affine transformation matrix from the first image to the second image, transform the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points to be tested in the second image coordinate system; S3, determine the working angle range of the MEMS galvanometer based on the set of points to be measured; S4 controls the MEMS galvanometer to deflect within the working angle range, reflects the laser spot to each target point on the surface of the product under test, calculates the three-dimensional coordinates of each target point, summarizes the three-dimensional coordinates of each target point, and generates a three-dimensional point cloud map of the contour measurement target area.
[0020] This invention arranges the set of points to be measured in rows and columns according to the scanning direction of the MEMS galvanometer, obtaining the working angle range of the MEMS galvanometer. This allows the MEMS galvanometer to deflect point by point only within the angle range containing the effective measurement target, skipping all non-target areas, eliminating the acquisition and calculation of invalid point clouds, and improving the point cloud density of the target area. Since the MEMS galvanometer only operates within a local small angle range, there is no need for large-scale wide-angle optical shaping of the laser beam, eliminating the X-axis direction accuracy loss introduced by wide-angle shaping in existing technologies. The optical path structure is simplified, maintainability is improved, and the overall hardware cost is reduced. The three-dimensional coordinates of each target point are summarized in the scanning path order to directly generate a three-dimensional point cloud map covering the contour measurement target area, without the need for full-domain three-dimensional modeling, significantly reducing the backend computing resource requirements.
[0021] In one example, such as Figure 2 As shown, a first image of the standard sample is acquired, and the target area for contour measurement is marked on the first image to obtain a reference point set, including: S11, configure the image exposure time and laser emission power parameters, acquire images of the standard sample, and obtain the first image; S12, mark the contour measurement target area in the pixel coordinate system of the first image to obtain the reference point set.
[0022] Specifically, the main control board sends a fixed exposure configuration to the camera module and a stable power configuration to the laser emission drive circuit, ensuring that the standard sample is in a repeatable and reproducible observation state. For example, the image exposure time can be set to 4ms, and the laser emission power can be set to 35% of the rated output power, thus balancing contour boundary brightness, image detail preservation, and sensor saturation risk. If the surface reflectivity of the standard sample is too high, the laser emission power is reduced; if the surface reflectivity of the standard sample is too low and the boundary grayness is insufficient, the image exposure time is increased. However, during the establishment of the same batch of benchmarks, the image exposure time and laser emission power remain fixed and are no longer arbitrarily changed with each single acquisition.
[0023] In this embodiment, after the parameters are fixed, the camera module performs a benchmark acquisition on the standard sample. During the acquisition process, the standard sample is placed in the center area of the measurement field of view, and the installation distance between the standard sample and the main body of the device is kept constant so that the main outline of the standard sample falls completely within the imaging range. The image acquisition program performs distortion correction, brightness normalization and noise suppression on the original frame, reduces random noise near the edge, and preserves the gray-scale gradient changes at the contour turning position to obtain the first image.
[0024] In this embodiment, the contour measurement target area is manually and interactively annotated or semi-automatically annotated within the pixel coordinate system of the first image, separating the location requiring 3D contour measurement from the entire image. If the target area represents a single key location, several discrete pixels are directly selected as the annotation result; if the target area represents an edge, polyline, or closed contour, a continuous sampling trajectory is first generated along the contour direction, and then discretization sampling is performed according to a fixed pixel interval; if the target area represents a local surface region, the boundary of the closed region is first delineated, and then a regular point matrix is generated within the closed region according to row and column steps. For example, the horizontal sampling interval and the vertical sampling interval can be uniformly set to 3 pixels. After discretization, all target pixel positions are organized into a reference point matrix set, and each point in the reference point matrix set is recorded as a set of pixel coordinates to represent a specific contour measurement target location within the first image.
[0025] In this embodiment, the annotation stage can also include boundary review and point adjustment processing. Pixels near high reflectivity areas, shadow occlusion areas, blurred edge areas and structural fracture areas are reviewed. Positions that are obviously unfavorable to laser incident and reflection reception are removed from the reference point set, and the local sampling density is increased for turning segments with large curvature changes.
[0026] In one example, such as Figure 3As shown, a second image of the product to be tested is acquired, and the affine transformation matrix from the first image to the second image is calculated. The pixel coordinates of each reference point in the reference point set are transformed using the affine transformation matrix to obtain the set of points to be tested in the second image coordinate system, including: S21, Perform FAST corner detection on the first image to obtain a first descriptor set, and perform FAST corner detection on the second image to obtain a second descriptor set; S22, Match the first descriptor subset with the second descriptor subset to obtain matching feature point pairs; S23. Solve the affine transformation matrix based on the matching feature point pairs, and perform coordinate transformation on the reference point set based on the affine transformation matrix to obtain the point set to be measured.
[0027] Specifically, the first image serves as a reference, while the second image corresponds to the real-time imaging result of the product under test. There are translational and rotational deviations between the two, as well as scale changes caused by variations in placement height. Therefore, the reference point set in the first image is transferred to the pixel coordinate system of the second image. FAST corner detection is performed on the first image, identifying candidate corners at edge transitions with significant grayscale changes, contour intersections, and locations with obvious texture responses. Simultaneously, directional information is combined to construct a directional binary description result, forming the first descriptor subset. The second image uses the same processing method to extract corners and description results, obtaining the second descriptor subset.
[0028] A step-by-step similarity comparison is performed between the first and second descriptor subsets, using Hamming distance as the matching criterion. Candidate correspondences with the closest response patterns are selected from the first and second images. To prevent mismatches caused by duplicate textures, local reflections, and background interference, distance and uniqueness constraints are added during the matching stage. Only candidates with small distances and clear correspondences are retained, while candidates with excessively large distances or one-to-many correspondences are removed, resulting in a set of matching feature point pairs with geometric consistency. Based on this set, an initial transformation relationship is constructed by randomly selecting a small number of feature point pairs. A reprojection consistency check is performed on all candidate correspondences, retaining interior points with smaller errors. A more stable affine transformation matrix is then obtained based on the interior point set. Utilizing the overall pose difference reflected by the matching feature point pairs, the reference point set in the first image pixel coordinate system is mapped to the second image pixel coordinate system, resulting in a test point set consistent with the actual position of the product under test.
[0029] In one example, the affine transformation matrix is solved based on the matching feature point pairs, and the coordinate transformation of the reference point set is performed based on the affine transformation matrix to obtain the test point set, including: Three sets of feature point pairs are randomly selected from the matched feature point pairs to solve for the initial transformation matrix; The reprojection error of all matching feature point pairs is calculated based on the initial transformation matrix. Matching feature point pairs with reprojection errors less than the error threshold are retained as the inlier set, and the affine transformation matrix is solved based on the inlier set. The pixel coordinates of each reference point in the reference point set are transformed by the affine transformation matrix to obtain the point set to be tested.
[0030] Specifically, the minimum sample set that can support the solution of the affine relation is repeatedly extracted from all matching feature point pairs, and the consistency of the sampling results is checked using all matching results. Since a two-dimensional affine transformation contains six degrees of freedom (translation, rotation, scaling, and shear), a set of feature point pairs will give two independent constraints, and three sets of feature point pairs can form six independent equations. Therefore, after randomly selecting three sets of feature point pairs from the matching feature point pairs, the coordinates of the feature points in the reference image are... Coordinates of corresponding feature points in the image under test Establish the initial transformation relationship, where Indicates the first The x-coordinates of the reference feature points Indicates the first The ordinates of the reference feature points and This represents the x and y coordinates of the corresponding matching point in the image under test. and This represents the scaling components in both directions. and Indicates rotation and shear components, and Let the translation component be represented. The initial transformation matrix is solved as follows:
[0031] After obtaining a set of initial transformation parameters, these parameters are applied to all matching feature point pairs. For each pair of matching points, the deviation between the projected position and the true matching position is calculated, and this deviation is used as the reprojection error. For example, the reprojection error threshold can be set to 2 pixels. Two pixels are sufficient to cover the small fluctuations in corner positioning under ordinary industrial imaging conditions, while also effectively eliminating mismatched points. Matching feature point pairs with a reprojection error of less than 2 pixels are retained in the inlier set, while matching feature point pairs exceeding this threshold are removed from the current model. Subsequently, the least squares solution is re-executed around the inlier set, so that the affine transformation matrix is determined by all highly consistent matching points.
[0032] According to the affine transformation matrix, the coordinates of each reference point in the reference point set are projected onto the coordinate system of the image to be measured according to the same coordinate transformation relationship. Point-by-point conversion to the set of points to be measured The coordinate conversion relationship is as follows:
[0033] After mapping, the contour measurement target position originally defined in the reference image coordinate system is migrated to the current product image coordinate system to form a set of points to be measured.
[0034] In one example, such as Figure 4 As shown, the working angle range of the MEMS galvanometer is determined based on the set of points to be measured, including: S31. Arrange the set of points to be measured in rows and columns according to the scanning order of the MEMS galvanometer in the y-direction to obtain an ordered scanning matrix; S32, the working angle range of the MEMS galvanometer is determined based on the ordered scanning matrix.
[0035] Specifically, the set of points to be tested is used as the input set for the galvanometer scanning plan. A scanning sequence corresponding one-to-one with the image pixel coordinates is established based on the deflection mode of the MEMS galvanometer. Each point in the set corresponds to the actual measurement position on the current product under test. These discrete target positions are organized into a scanning path that can be sequentially executed by the MEMS galvanometer. During processing, the pixel ordinates of all points in the set of points to be tested are read and initially sorted in ascending order of y-direction, so that points near the same scan row are merged into the same row range. For points with the same ordinate or whose ordinate difference is within the tolerance range of the same row, they are then arranged in ascending order of x-coordinate, reconstructing the originally disordered target points into an ordered column array that expands by rows and progresses by columns. Points at different y-levels are organized into a continuous row structure, and the position order within each row is consistent with the horizontal scanning order, thus forming an ordered scanning matrix.
[0036] Information characterizing the scan boundary is extracted based on the ordered scan matrix. The start and end rows in the y-direction are identified from the overall row range of the matrix, and the distribution interval of the horizontal point column is identified within each row. This compresses the two-dimensional pixel region covered by the set of points to be measured into a set of controlled scan boundaries. When the MEMS galvanometer is subsequently deflected, it does not need to cover the entire field of view, but only needs to be targeted around the local range corresponding to the ordered scan matrix. Therefore, the top and bottom effective rows of the matrix together define the working range in the y-direction, and the leftmost and rightmost effective points within each row together define the working range in the x-direction of the corresponding row.
[0037] In one example, the operating angle range of the MEMS galvanometer is determined based on an ordered scan matrix, including: The starting and ending row coordinates of the MEMS galvanometer in the y-direction are determined based on the row range of the ordered scanning matrix, thus obtaining the working angle range of the MEMS galvanometer in the y-direction. Calculate the working angle interval in the x-direction corresponding to each row in the ordered scanning matrix, and take the working angle intervals in the x-direction and y-direction of all rows as the working angle interval of the MEMS galvanometer.
[0038] Specifically, the ordered scan matrix is used as the direct input for galvanometer path planning. Control information constraining the galvanometer deflection range is obtained based on the row and column boundaries of the ordered scan matrix. Since the ordered scan matrix has been rearranged according to the scanning order of the MEMS galvanometer in the y-direction, the vertical coordinate corresponding to the top row of the ordered scan matrix is the starting point of the y-direction scan, and the vertical coordinate corresponding to the bottom row of the ordered scan matrix is the ending point of the y-direction scan. Both together define the working boundary of the MEMS galvanometer in the y-direction. If the ordered scan matrix is written as a row-expanded sequence of target points, the working angle range in the y-direction can be determined by… It means that, among them This represents the starting row coordinates corresponding to the first valid scan row of the ordered scan matrix. This represents the total number of scan rows covered by the set of points to be tested in the y-direction. The corresponding end position of the last valid scan line; in terms of control implementation, based on the calibration relationship between the camera field of view coordinates and the galvanometer deflection coordinates, the starting line coordinates and the ending line coordinates are converted into the starting deflection angle and the ending deflection angle in the y direction. Then, the main control board writes this pair of boundary angles into the galvanometer control register, so that the MEMS galvanometer only covers the local area where the contour measurement target area is actually located in the longitudinal direction, and no longer performs full-domain scanning on irrelevant fields of view.
[0039] After the y-direction boundary is determined, interval extraction is performed on the horizontal point column corresponding to each row within the ordered scan matrix. That is, the horizontal coordinates corresponding to the leftmost and rightmost valid points in each row are read, and the horizontal valid range of each row is organized as follows: ,in Indicates the row number relative to the starting row. Indicates the first The horizontal starting position of the row. Indicates the first The number of valid points contained in the row, therefore Corresponding to the The horizontal termination position of the row. During processing, the main control board reads the horizontal start and end boundaries of each row sequentially according to the row order, and converts the horizontal pixel interval of each row into the x-direction start deflection angle and x-direction end deflection angle through the field of view calibration relationship. Then, it combines the x-direction working angle interval of all rows with the already obtained y-direction working angle interval to form the complete MEMS galvanometer working angle interval. The formed working angle interval is a combined control structure of "total vertical range plus row-by-row horizontal range", that is, the y-direction gives the overall scanning channel, and the x-direction gives the actual effective deflection boundary inside each row. When the MEMS galvanometer executes, it first enters the y-direction start angle, then completes the horizontal deflection within the x-direction interval of the corresponding row, and then switches to the y-direction position of the next row and reads the x-direction interval of the next row to continue scanning. In this way, the laser spot always falls within the effective contour area covered by the set of points to be measured.
[0040] In one example, such as Figure 5 As shown, the MEMS galvanometer is controlled to deflect within its working angle range, reflecting the laser spot to various target points on the surface of the product under test and calculating the three-dimensional coordinates of each target point. The three-dimensional coordinates of each target point are then summarized to generate a three-dimensional point cloud map of the contour measurement target area, including: S41 controls the MEMS galvanometer to deflect point by point according to the working angle range, reflecting the laser spot to each target point on the surface of the product under test in sequence, and calculates the Z-axis distance of each target point. S42, calculate the X-axis and Y-axis coordinates of each target point based on the deflection angle of the MEMS galvanometer at each target point, and construct the three-dimensional coordinates of each target point based on the combination of the X-axis coordinates, Y-axis coordinates and Z-axis distance; S43, summarize the three-dimensional coordinates of each target point to generate a three-dimensional point cloud map of the contour measurement target area.
[0041] Specifically, the main control board sequentially sends deflection control values corresponding to each target point to the MEMS galvanometer driving circuit according to the row and column order corresponding to the ordered scanning matrix. This causes the MEMS galvanometer to switch the reflection direction point by point within a predetermined working angle range. The light spot emitted by the laser component is deflected by the reflector and falls onto the corresponding target position on the surface of the product under test. Subsequently, the laser receiver component receives the reflected echo from the target position and extracts the center offset information of the light spot from the energy distribution on the light-receiving chip. Then, it calculates the Z-axis distance of the target point according to the laser triangulation distance relationship. To ensure the stability of point-by-point ranging, a short stabilization window is retained after each angle jump of the galvanometer. This allows the reflector attitude, laser landing point, and light reception response to enter a stable state before reading the light reception result. For example, the stabilization window can be set to 0.4 ms to avoid premature sampling before the mirror surface has stabilized, which would introduce depth fluctuations. At the same time, the laser emission drive maintains a controlled output state consistent with the previous reference acquisition stage, ensuring that the depth response conditions in the current contour measurement link remain uniform.
[0042] After obtaining the Z-axis distance of each target point, the deflection state of the MEMS galvanometer at the corresponding moment is combined with the spatial calibration relationship of the device to calculate the spatial position of the point in both the horizontal and vertical directions, obtaining the X-axis and Y-axis coordinates. When controlling the galvanometer to deflect point by point, the main control board simultaneously records the y-axis deflection position corresponding to the current target point and the x-axis deflection position within that row. Combined with the angle-space mapping relationship established during the device assembly and adjustment phase, the deflection amounts in both directions are converted into the horizontal and vertical coordinates of the current target point. Since the Z-axis distance is already given by the ranging result returned by the photodetector, the X-axis and Y-axis coordinates are combined with the corresponding Z-axis distance to construct the three-dimensional coordinates of the target point. Each time the galvanometer points to a target point, the system completes one reflection reception, one distance calculation, and one three-dimensional coordinate writing, directly transforming the discrete scanning action into discrete spatial point coordinates.
[0043] The 3D coordinates of all target points are continuously written to the point cloud buffer in the order of the scanning path. The adjacency order between points is maintained according to the row and column organization of the ordered scanning matrix, ensuring that the generated dataset not only contains the 3D spatial position of each point but also preserves the scanning topology within the target area. During the point-by-point writing process, individual points with abnormal lighting, weak reflection, or excessive light spot offset are marked, and their position indices are retained if adjacent valid points exist, to prevent a single abnormal measurement point from disrupting the sequential structure of the entire contour. For validly measured points, they are directly written to the point cloud result set according to the scanning order. After the point cloud is summarized, the output contour measurement results only cover the pre-marked target area and do not include a large amount of irrelevant background point cloud.
[0044] In one example, the MEMS galvanometer is controlled to deflect point by point within a working angle range, reflecting the laser spot sequentially to each target point on the surface of the product under test, and the Z-axis distance of each target point is calculated, including: The MEMS galvanometer is controlled to deflect point by point according to the working angle range, and the laser spot is reflected to each target point on the surface of the product under test in sequence. The light receiver lens module gathers the reflected light from each target point to the light receiving chip, and the offset of the light spot corresponding to each target point on the light receiving chip relative to the center of the light receiving chip is extracted to obtain the light spot offset of each target point. Based on the spot offset of each target point, the baseline distance between the laser emission center and the center of the receiving chip, the focal length of the receiver lens, and the laser incident angle, the Z-axis distance of each target point is calculated using the laser triangulation method.
[0045] Specifically, the main control board continuously sends point-by-point deflection commands to the MEMS galvanometer drive circuit according to the working angle range and an ordered scanning path. This causes the reflector to switch between rows within the y-axis working range and advance between points within the corresponding x-axis working range, thereby guiding the laser spot emitted by the laser component to each target point on the surface of the product under test. To ensure a stable geometric relationship for the reflected echo corresponding to each target point, after the galvanometer switches to the target deflection angle, the control link waits for the mirror attitude to stabilize before initiating light sampling, ensuring consistency between the laser incident path, the target surface reflection path, and the receiver path. The reflected light generated on the surface of the product under test then enters the receiver lens module, which converges the reflected beam corresponding to the target point onto the photosensitive surface of the photodetector chip. Due to the different spatial positions of the target points, the imaging position of the reflected light on the photodetector chip also shifts accordingly. Therefore, each sampling can form a spot distribution corresponding to the target point on the photodetector chip.
[0046] After the light spot falls onto the light-receiving chip, the signal processing circuit reads the light intensity distribution output by the chip and extracts the center position of the light spot within the effective photosensitive area. This center position is then compared with the geometric center of the chip to obtain the light spot offset corresponding to the current target point. To avoid disturbances caused by reflected speckle, local noise, and weak edge responses in the offset extraction, the processing first performs thresholding and local smoothing on the received signal to separate the actual energy concentration area of the light spot from the background response. Then, the center coordinates of the light spot are calculated, resulting in a more stable offset result.
[0047] The laser spot offset at the current target point, the baseline distance between the laser emission center and the center of the receiving chip, the focal length of the receiver lens, and the laser incident angle are all fed into the laser triangulation calculation link, and the Z-axis distance of the target point is calculated according to the following formula:
[0048] in, This represents the distance of the target point along the Z-axis. This indicates the baseline distance between the laser emission center and the center of the light-receiving chip. Indicates the focal length of the receiver lens. This indicates the physical offset distance of the light spot relative to the center of the light-receiving chip. This represents the laser incident angle. When the spatial depth of the target point changes, the spot offset on the light-receiving chip changes synchronously, and the system uses this correspondence to convert the image plane displacement into depth distance. The main control board associates and stores the Z-axis distance corresponding to each target point with the current galvanometer deflection position, forming a sequence of point-by-point ranging results.
[0049] In one example, the 3D coordinates of each target point are summarized to generate a 3D point cloud map of the contour measurement target area, including: The three-dimensional coordinates of each target point are summarized according to the scanning path sequence corresponding to the working angle interval, resulting in a set of three-dimensional coordinates. The three-dimensional coordinates of each target point in the three-dimensional coordinate set are mapped to the coordinate system of the standard sample to generate a three-dimensional point cloud map of the contour measurement target area.
[0050] Specifically, the 3D coordinate results are written into a continuous buffer according to the scanning path sequence corresponding to the working angle interval. Following the actual row scanning order and intra-row point scanning order during MEMS mirror operation, a correspondence is established between the 3D coordinates of each target point and its scanning sequence number, row sequence number, and intra-row column sequence number. Since the working angle interval has already been generated by an ordered scanning matrix, the 3D coordinates are organized sequentially according to the scanning path, maintaining the original adjacency relationship. This ensures that the 3D coordinates of adjacent target points in the same row are stored continuously in the result set, and the 3D coordinates between adjacent scanning rows are sequentially connected according to a predetermined row switching order. The resulting 3D coordinate set contains the spatial position results of each target point and preserves the structural unfolding relationship within the contour measurement target area. To avoid individual weak reflection points, edge distortion points, or points with abnormal lighting disrupting the overall point structure, the valid status identifier of each target point is recorded simultaneously when writing to the 3D coordinate set. For validly measured target points, the 3D coordinate values are directly written; for temporarily invalid target points, the corresponding scanning index position is retained.
[0051] The target point results in the 3D coordinate set are mapped to the reference coordinate frame corresponding to the standard sample. During mapping, the established point index correspondence between the reference point set and the test point set is invoked. Each reference point in the standard sample image, after coordinate transformation, corresponds to an actual measurement point on the current test product. Therefore, each obtained 3D coordinate result carries the original reference point index. Based on this index relationship, the currently measured 3D coordinate result is linked to the corresponding reference point in the standard sample reference coordinate frame, so that the point cloud results are spatially organized within a unified reference frame. The resulting 3D point cloud map of the contour measurement target area uses the standard sample reference coordinate frame as the unified organizational basis and the measured 3D coordinates of the current test product as the target area point values.
[0052] Reference Figure 6 This embodiment provides a laser three-dimensional contour measurement device, including: Acquisition module 1 is used to acquire the first image of the standard sample, mark the contour measurement target area on the first image, and obtain the reference point matrix set; The coordinate transformation module 2 is used to acquire the second image of the product under test, calculate the affine transformation matrix from the first image to the second image, and transform the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points under test in the second image coordinate system. Angle analysis module 3 is used to determine the working angle range of the MEMS galvanometer based on the set of points to be measured. The coordinate calculation module 4 is used to control the MEMS galvanometer to deflect within the working angle range, reflect the laser spot to each target point on the surface of the product under test and calculate the three-dimensional coordinates of each target point. The three-dimensional coordinates of each target point are summarized to generate a three-dimensional point cloud map of the contour measurement target area.
[0053] Figure 7 This is a schematic diagram of the overall structure of the laser three-dimensional contour measuring device of the present invention. Figure 7 As shown, the device includes a laser component, a MEMS galvanometer component, a light-receiving chip, a lens module, a camera, and a supplementary lighting component. The laser beam emitted by the laser component is projected onto the reflector of the MEMS galvanometer component. After being deflected by the reflector, the laser beam is reflected onto the test point on the target surface. The light reflected back from the target surface is focused onto the light-receiving chip by the lens module, where it receives and acquires the beam position information. The camera, in conjunction with the supplementary lighting component, is used to acquire images of the target product, with the supplementary lighting component providing supplementary lighting for the camera's imaging.
[0054] Figure 8 This is a schematic diagram of the internal structure of the laser component of the present invention. Figure 8As shown, the laser component includes a laser, a lens barrel, a collimating lens, and an aperture. The laser beam emitted by the laser is constrained by the lens barrel and then enters the collimating lens. The collimating lens collimates the laser beam, and the aperture reshapes the collimated beam into a dot-shaped spot. The waist of the dot-shaped spot is located near the center of the device's range, ensuring that the laser spot is projected onto the reflector of the MEMS galvanometer component in a stable dot shape.
[0055] In this embodiment, the specific implementation of each unit in the above device embodiment is described in the above method embodiment, and will not be repeated here.
[0056] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0057] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A laser three-dimensional contour measurement method, characterized in that, include: Acquire the first image of the standard sample, mark the contour measurement target area on the first image, and obtain the reference point set; Acquire a second image of the product to be tested, calculate the affine transformation matrix from the first image to the second image, and transform the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points to be tested in the second image coordinate system. The working angle range of the MEMS galvanometer is determined based on the set of points to be tested. The MEMS galvanometer is controlled to deflect within the working angle range, reflecting the laser spot to each target point on the surface of the product under test and calculating the three-dimensional coordinates of each target point. The three-dimensional coordinates of each target point are then summarized to generate a three-dimensional point cloud map of the contour measurement target area.
2. The laser three-dimensional contour measurement method according to claim 1, characterized in that, The first image of the acquired standard sample is used to mark the contour measurement target area on the first image, thereby obtaining a reference point set, including: Configure the image exposure time and laser emission power parameters, acquire images of the standard sample, and obtain the first image; The contour measurement target area is marked in the pixel coordinate system of the first image to obtain a reference point matrix set.
3. The laser three-dimensional contour measurement method according to claim 1, characterized in that, The process involves acquiring a second image of the product under test, calculating an affine transformation matrix from the first image to the second image, and transforming the pixel coordinates of each reference point in the reference point set using the affine transformation matrix to obtain the set of points under test in the second image coordinate system, including: Perform FAST corner detection on the first image to obtain a first descriptor set, and perform FAST corner detection on the second image to obtain a second descriptor set; The first descriptor subset and the second descriptor subset are matched to obtain matching feature point pairs; The affine transformation matrix is solved based on the matching feature point pairs, and the coordinate transformation is performed on the reference point set based on the affine transformation matrix to obtain the point set to be measured.
4. The laser three-dimensional contour measurement method according to claim 3, characterized in that, The step of solving the affine transformation matrix based on the matched feature point pairs, and performing coordinate transformation on the reference point set based on the affine transformation matrix to obtain the test point set, includes: Three sets of feature point pairs are randomly selected from the matched feature point pairs to solve for the initial transformation matrix; The reprojection error of all the matching feature point pairs is calculated based on the initial transformation matrix. The matching feature point pairs with reprojection errors less than the error threshold are retained as the inlier set, and the affine transformation matrix is solved based on the inlier set. The pixel coordinates of each reference point in the reference point set are transformed according to the affine transformation matrix to obtain the point set to be tested.
5. The laser three-dimensional contour measurement method according to claim 1, characterized in that, The step of determining the working angle range of the MEMS galvanometer based on the set of points to be measured includes: The set of points to be tested is arranged in rows and columns according to the scanning order of the MEMS galvanometer in the y-direction to obtain an ordered scanning matrix; The working angle range of the MEMS galvanometer is determined based on the ordered scanning matrix.
6. The laser three-dimensional contour measurement method according to claim 5, characterized in that, Determining the working angle range of the MEMS galvanometer based on the ordered scanning matrix includes: Based on the row range of the ordered scanning matrix, the starting and ending row coordinates of the MEMS galvanometer in the y direction are determined, and the working angle range of the MEMS galvanometer in the y direction is obtained. Calculate the working angle interval in the x-direction corresponding to each row in the ordered scanning matrix, and take the working angle interval in the x-direction of all rows and the working angle interval in the y-direction as the working angle interval of the MEMS galvanometer.
7. The laser three-dimensional contour measurement method according to claim 1, characterized in that, The process involves controlling the MEMS galvanometer to deflect within the working angle range, reflecting the laser spot to target points on the surface of the product under test, calculating the three-dimensional coordinates of each target point, summarizing the three-dimensional coordinates of each target point, and generating a three-dimensional point cloud map of the contour measurement target area, including: The MEMS galvanometer is controlled to deflect point by point within the working angle range, and the laser spot is reflected sequentially to each target point on the surface of the product under test, and the Z-axis distance of each target point is calculated. Based on the deflection angle of the MEMS galvanometer at each target point, the X-axis and Y-axis coordinates of each target point are calculated, and the three-dimensional coordinates of each target point are constructed by combining the X-axis coordinates, the Y-axis coordinates and the Z-axis distance. The three-dimensional coordinates of each target point are summarized to generate a three-dimensional point cloud map of the contour measurement target area.
8. The laser three-dimensional contour measurement method according to claim 7, characterized in that, The process of controlling the MEMS galvanometer to deflect point by point within the working angle range, reflecting the laser spot sequentially to each target point on the surface of the product under test, and calculating the Z-axis distance of each target point includes: The MEMS galvanometer is controlled to deflect point by point according to the working angle range, and the laser spot is reflected sequentially to each target point on the surface of the product under test. The light receiver lens module gathers the reflected light from each target point to the light receiving chip, and the offset of the light spot corresponding to each target point on the light receiving chip relative to the center of the light receiving chip is extracted to obtain the light spot offset of each target point. Based on the spot offset of each target point, the baseline distance between the laser emission center and the center of the light receiving chip, the focal length of the light receiver lens, and the laser incident angle, the Z-axis distance of each target point is calculated using the laser triangulation method.
9. The laser three-dimensional contour measurement method according to claim 7, characterized in that, The process of summarizing the three-dimensional coordinates of each target point to generate a three-dimensional point cloud map of the contour measurement target area includes: The three-dimensional coordinates of each target point are summarized according to the scanning path sequence corresponding to the working angle interval to obtain a set of three-dimensional coordinates; The three-dimensional coordinates of each target point in the three-dimensional coordinate set are mapped to the coordinate system of the standard sample to generate a three-dimensional point cloud map of the contour measurement target area.
10. A laser three-dimensional contour measuring device, characterized in that, The steps for implementing the laser three-dimensional contour measurement method according to any one of claims 1 to 9 include: The acquisition module is used to acquire the first image of the standard sample, mark the contour measurement target area on the first image, and obtain the reference point matrix set; The coordinate transformation module is used to acquire a second image of the product under test, calculate the affine transformation matrix from the first image to the second image, and transform the pixel coordinates of each reference point in the reference point set through the affine transformation matrix to obtain the set of points under test in the second image coordinate system. Angle analysis module is used to determine the working angle range of the MEMS galvanometer based on the set of points to be measured; The coordinate calculation module is used to control the MEMS galvanometer to deflect within the working angle range, reflect the laser spot to each target point on the surface of the product under test, calculate the three-dimensional coordinates of each target point, summarize the three-dimensional coordinates of each target point, and generate a three-dimensional point cloud map of the contour measurement target area.