A gap surface difference measurement method and system based on a binocular double laser reconstruction mechanism
By employing a binocular dual-laser reconstruction mechanism, high-precision and stable detection of gap differences is achieved, solving the problems of low efficiency and insufficient stability in existing technologies. This technology is suitable for online inspection in automobile manufacturing, rail transportation, and precision equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING YUNTONG TECH CO LTD
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-19
Smart Images

Figure CN121855406B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional measurement technology, specifically to a gap surface difference measurement method and system based on a binocular dual-laser reconstruction mechanism. Background Technology
[0002] In industrial fields such as automobile manufacturing, rail transportation, precision equipment, and sheet metal assembly, the gap dimensions and surface difference parameters between workpieces are important indicators for evaluating assembly quality and appearance consistency, directly affecting the sealing performance, safety, and aesthetics of products. Existing gap and surface difference detection methods mainly include contact measurement methods and non-contact optical measurement methods.
[0003] Gap and flush measurement is a geometric parameter detection method for the fit between assemblies. It is mainly used to evaluate the matching quality and appearance consistency of adjacent workpieces after assembly. Among them, gap refers to the minimum vertical distance between the edges of two adjacent workpieces, which is used to reflect whether the opening width after assembly meets the design requirements. Flush refers to the height difference between two adjacent workpieces in a preset reference direction (usually the workpiece normal direction or the vehicle body reference direction), which is used to evaluate the flatness of the two side surfaces. Gap reflects the "opening size", and flush reflects the "surface flatness".
[0004] Existing contact measurement methods are inefficient and easily damage the workpiece surface, making it difficult to meet the online inspection requirements of automated production lines;
[0005] Monocular or single-laser structured light methods are susceptible to occlusion, reflection, and stripe interruption in the gap region, resulting in incomplete acquisition of three-dimensional information and insufficient measurement stability. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a gap surface difference measurement method and system based on a binocular dual-laser reconstruction mechanism.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method and system for measuring gap surface difference based on a binocular dual-laser reconstruction mechanism, comprising:
[0008] Spatial calibration of the gap surface difference measurement system is performed, and the intrinsic and extrinsic parameter matrices of the first and second cameras are solved. Based on the correspondence between standard geometry and laser stripes, the equations of the first and second laser projection planes are calculated.
[0009] To measure the workpiece, the first laser projector and the second laser projector respectively project laser stripes to cover the surfaces on both sides of the gap, and the first camera and the second camera acquire images from the first camera and the second camera respectively.
[0010] Stripe features are extracted from the first camera image and the second camera image to obtain the first two-dimensional feature point set and the second two-dimensional feature point set on both sides of the workpiece to be tested.
[0011] Based on the intrinsic and extrinsic parameter matrices of the first and second cameras, the three-dimensional coordinates of the first two-dimensional feature point set and the second two-dimensional feature point set are solved to obtain the first three-dimensional point set and the second three-dimensional point set on both sides of the workpiece to be measured.
[0012] Point cloud optimization and mathematical model fitting are performed on the first and second 3D point sets; the gap size and surface difference are calculated and output based on the mathematical model.
[0013] Preferably, spatial calibration of the binocular dual-laser measurement system includes:
[0014] S21. Using a calibration board as a spatial calibration reference, multiple sets of binocular synchronous images are acquired under different spatial postures. Two-dimensional pixel coordinates are extracted from the binocular synchronous images and a correspondence is established with the known three-dimensional coordinates of the calibration board. A reprojection error function is constructed, and least squares iterative optimization is performed based on Zhang Zhengyou's calibration algorithm to solve the intrinsic and extrinsic parameter matrices of the first and second cameras.
[0015] S22. Place the calibration rod in the measurement area, acquire binocular images and extract the fringe center feature points. Project the fringe feature points back onto the spatial ray through the camera intrinsic and extrinsic matrix, establish a geometric constraint relationship with the known spatial coordinates of the calibration rod, and solve the equations of the first and second laser projection planes using the plane least squares fitting method based on multiple sets of three-dimensional fringe point sets.
[0016] Preferably, stripe features are extracted from the first camera image and the second camera image to obtain a first two-dimensional feature point set and a second two-dimensional feature point set on both sides of the workpiece to be tested, including:
[0017] S31. Perform distortion correction processing on the first camera image and the second camera image, wherein the image is back-projected based on the camera intrinsic parameter matrix and the corrected image is output.
[0018] S32. Perform stripe enhancement and noise suppression processing on the corrected image. The stripe enhancement uses a gray-level linear mapping function.
[0019] ;
[0020] Where L(u,v) represents the gray value at pixel coordinates (u,v) after enhancement, I(u,v) is the original gray value, α is the contrast gain coefficient, and β is the brightness offset; Gaussian filtering is performed on the enhanced image L(u,v) to obtain a smoothed image.
[0021] S33. Based on local statistical features, threshold segmentation is performed on the smoothed image to obtain stripe candidate regions, wherein the threshold function satisfies:
[0022] ;
[0023] Where T(u,v) is the segmentation threshold; μ(u,v) is the mean gray value of the neighborhood of pixel (u,v); σ(u,v) is the standard deviation of the neighborhood gray value; and k is the threshold adjustment coefficient.
[0024] Preferably, stripe feature extraction is performed on the first camera image and the second camera image to obtain a first two-dimensional feature point set and a second two-dimensional feature point set on both sides of the workpiece to be tested, and the method further includes:
[0025] Gradient operator edge detection is performed within the stripe candidate region to determine the stripe boundary. Based on the stripe boundary, a stripe grayscale profile is constructed for each row or column of pixels, and the sub-pixel centerline localization model is used to solve the stripe center coordinates.
[0026] The center coordinates of the subpixel stripes are processed by connectivity constraint filtering and morphological closing operation to obtain the center lines of continuous stripes; the center lines of continuous stripes are assigned to stripes, and the center line points assigned to the first laser stripe are output as the first two-dimensional feature point set, and the center line points assigned to the second laser stripe are output as the second two-dimensional feature point set.
[0027] Preferably, the three-dimensional coordinates of the first two-dimensional feature point set and the second two-dimensional feature point set are solved, including:
[0028] S41. Perform epipolar correction processing on the first camera image based on the extrinsic parameter matrix to obtain an epipolar aligned image; in the epipolar aligned image, establish a one-dimensional matching search window along the corresponding epipolar direction, using feature points in the first camera image as reference points; construct a matching cost function based on gray-level correlation within the matching search window, evaluate the similarity of candidate matching points, and select the candidate point with the best score as the initial matching point pair; perform random sampling consensus algorithm processing on the initial matching point pair set to verify the geometric consistency of the matching point pairs and eliminate mismatched points; output the first matching point pair set that passes the consistency verification.
[0029] S42. Perform three-dimensional coordinate solving for each pair of pixel coordinates in the first set of matching point pairs, including:
[0030] Based on the camera intrinsic parameter matrix, the pixel coordinates are converted into imaging coordinates respectively, and spatial rays in the first camera coordinate system and the second camera coordinate system are constructed. Based on the extrinsic parameter matrix, the spatial rays in the second camera coordinate system are transformed to the first camera coordinate system, and the spatial relative pose relationship of the two spatial rays in a unified coordinate system is established.
[0031] An equation for the first laser projection plane is introduced as an additional geometric constraint to ensure that the three-dimensional point to be determined satisfies both the binocular line-of-sight constraint and the laser plane constraint. Under the joint geometric constraint, the least squares optimization method is used to solve for the three-dimensional coordinates (x, y, z) of the spatial point. The three-dimensional coordinates (x, y, z) are accumulated sequentially to form the first three-dimensional point set on the corresponding side.
[0032] S43. The second two-dimensional feature point set is solved using the same solution process as S41 and S42, combined with the equation of the second laser projection plane, to form the second three-dimensional point set corresponding to the other side surface.
[0033] S44. Perform point cloud optimization processing on the first three-dimensional point set and the second three-dimensional point set respectively, construct a local neighborhood point set and calculate its mean and standard deviation, and remove discrete outliers that deviate from the mean by more than a preset multiple; apply spatial range constraint filtering to remove invalid points that exceed the measurement area, and output the first optimized three-dimensional point set and the second optimized three-dimensional point set.
[0034] Preferably, the calculation of the gap size parameter Gap and the surface difference parameter Flush includes:
[0035] For the first optimized 3D point set and the point sets on both sides of the second optimized 3D point set, candidate gap edges are extracted according to the preset edge neighborhood width, and connectivity constraints are applied to obtain edge point bands. Based on the edge point bands, robust plane fitting is performed on the point sets on both sides to obtain a mathematical model. The robust plane fitting includes: using iterative reweighted least squares to assign decay weights to outlying points, where the outlying points are 3D points whose residuals to the current fitted model exceed a preset residual threshold. The fitting residual convergence threshold is used as the termination condition, and the unit normal vector and intercept parameters of the mathematical model are output.
[0036] Preferably, the calculation of the gap size parameter Gap and the surface difference parameter Flush further includes:
[0037] The measurement reference direction is established based on the unit normal vector of the mathematical model. A set of normal projection rays is constructed in the gap region. The distance between the intersection point of each projection ray and the first mathematical model and the second mathematical model is calculated. The difference between the two intersection points is taken as the single-point gap value. The median of the single-point gap value is taken as the gap size Gap.
[0038] Multiple pairs of corresponding points are selected at equal intervals along the rotation direction on the edge point band. The edge point band is a strip-shaped set of three-dimensional points extracted from the first optimized three-dimensional point set and the second optimized three-dimensional point set along the gap opening boundary direction and within the preset normal neighborhood width. The corresponding point pairs are subjected to dual constraint verification of epipolar consistency and spatial nearest neighbor consistency. The projection distance difference of the corresponding point pairs that pass the verification is calculated in the measurement reference direction. The mean and variance of the projection distance difference are statistically analyzed, and the mean of the remaining projection distance difference is used as the surface difference Flush.
[0039] A gap difference measurement system based on a binocular dual-laser reconstruction mechanism includes:
[0040] A binocular imaging unit is used to acquire binocular image data containing a first laser stripe and a second laser stripe, and transmit it to the calibration and reconstruction unit;
[0041] The dual laser projection unit includes a first laser projector and a second laser projector, used to project line laser stripes onto the surfaces on both sides of the gap to be measured.
[0042] The calibration and reconstruction unit is connected to the binocular imaging unit and the dual laser projection unit. It is used to perform camera extrinsic calibration and laser plane calibration, and to solve the three-dimensional coordinates of the stripe feature points based on the binocular line-of-sight constraints and laser plane constraints, and output the first three-dimensional point set and the second three-dimensional point set.
[0043] The gap and surface difference calculation unit is connected to the calibration and reconstruction unit. It performs point cloud optimization and mathematical model fitting on the first three-dimensional point set and the second three-dimensional point set, and calculates the gap size and surface difference based on the mathematical model.
[0044] This invention provides a gap difference measurement method and system based on a binocular dual-laser reconstruction mechanism, which has the following advantages compared with the prior art:
[0045] This invention acquires independent laser stripe features on both sides of the gap by coordinating a binocular imaging unit and a dual laser projection unit. The calibration and reconstruction unit constructs dual constraints based on the camera intrinsic and extrinsic parameter matrices and the laser projection plane equation to achieve three-dimensional reconstruction of the two sides of the gap. This avoids the modeling confusion caused by occlusion, reflection and stripe aliasing in the monocular reconstruction method, improves the stability and integrity of the three-dimensional point set, improves the calculation accuracy of gap size and surface difference parameters, and enhances the system's adaptability in weak texture and high reflectivity industrial scenarios.
[0046] This invention performs edge point extraction and robust plane fitting on the optimized 3D point set through a gap and surface difference calculation unit, and establishes a measurement reference direction based on the unit normal vector. It solves the gap value of a single point and the projection distance difference of the corresponding point pair by normal projection ray, realizing the statistically stable calculation of gap size and surface difference parameters. When abnormal discrete points appear, they are suppressed by iterative reweighted least squares, thereby improving the anti-interference ability and repeatability stability of parameter solution, which can meet the requirements of high-precision assembly online inspection. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the principle framework of the present invention;
[0048] Figure 2 This is a schematic diagram of the system structure of the present invention;
[0049] Figure 3 This is a schematic diagram of the binocular dual-laser gap surface difference measurement system of the present invention;
[0050] Figure 4 This is a schematic diagram of the projection of the dual lasers in the workpiece gap region according to the present invention;
[0051] Figure 5 This is a schematic diagram illustrating the calculation principle of the gap and surface difference parameters of the present invention. Detailed Implementation
[0052] 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.
[0053] Please see Figure 1 This application provides a method and system for measuring gap surface difference based on a binocular dual-laser reconstruction mechanism, including:
[0054] Spatial calibration of the gap surface difference measurement system is performed, and the intrinsic and extrinsic parameter matrices of the first and second cameras are solved. Based on the correspondence between standard geometry and laser stripes, the equations of the first and second laser projection planes are calculated.
[0055] To measure the workpiece, such as... Figure 4 As shown, laser stripes are projected by the first laser projector and the second laser projector to cover the two sides of the gap, and images from the first camera and the second camera are captured by the first camera and the second camera, respectively.
[0056] Stripe features are extracted from the first camera image and the second camera image to obtain the first two-dimensional feature point set and the second two-dimensional feature point set on both sides of the workpiece to be tested.
[0057] Based on the intrinsic and extrinsic parameter matrices of the first and second cameras, the three-dimensional coordinates of the first two-dimensional feature point set and the second two-dimensional feature point set are solved to obtain the first three-dimensional point set and the second three-dimensional point set on both sides of the workpiece to be measured.
[0058] Point cloud optimization and mathematical model fitting are performed on the first and second 3D point sets; the gap size and surface difference are calculated and output based on the mathematical model.
[0059] Spatial calibration of the binocular dual-laser measurement system includes:
[0060] S21. Using a calibration board as a spatial calibration reference, multiple sets of binocular synchronous images are acquired under different spatial postures. Two-dimensional pixel coordinates are extracted from the binocular synchronous images and a correspondence is established with the known three-dimensional coordinates of the calibration board. A reprojection error function is constructed, and least squares iterative optimization is performed based on Zhang Zhengyou's calibration algorithm to solve the intrinsic and extrinsic parameter matrices of the first and second cameras.
[0061] Specifically, the calibration plate selection and arrangement are as follows: a high-precision checkerboard calibration plate with a 12×9 specification is selected, with a grid side length error of ≤±0.01mm to ensure the accuracy of the calibration benchmark; the calibration plate is fixed to an adjustable precision gimbal, and moved along the X, Y, and Z axes within the measurement area, while rotating at different angles within ±30° around each axis, acquiring a total of 25 sets of binocular synchronous images, covering different imaging angles of the camera's full field of view, to avoid local field of view calibration deviations.
[0062] Camera parameter calibration: Based on the acquired calibration board images, the intrinsic and extrinsic parameters of the two cameras are solved using Zhang Zhengyou's calibration algorithm. The intrinsic parameters include focal length, principal point coordinates, and distortion coefficients. Through iterative optimization, the calibration reprojection error is controlled within 0.1 pixels to ensure the accuracy of the camera imaging model. The extrinsic parameters include the translation vector and rotation matrix between the two cameras.
[0063] S22. Place the calibration rod in the measurement area, acquire binocular images and extract the fringe center feature points. Project the fringe feature points back onto the spatial ray through the camera intrinsic and extrinsic matrix, establish a geometric constraint relationship with the known spatial coordinates of the calibration rod, and solve the equations of the first and second laser projection planes using the plane least squares fitting method based on multiple sets of three-dimensional fringe point sets.
[0064] Specifically, the laser projection plane calibration involves using a 50mm long, IT01-grade standard ceramic calibration rod with uniformly distributed feature markers on its surface. The calibration rod is fixed to the measurement station and adjusted to different orientations, such as horizontal, 30° tilt, and 60° tilt. Dual laser projectors are activated, projecting two laser stripes onto the calibration rod surface. Binocular images are simultaneously acquired, and the correspondence between the stripes and the feature markers is extracted. Based on the camera's intrinsic and extrinsic parameters and the actual dimensions of the calibration rod, spatial geometric calculations are used to solve the equation parameters of the laser projection plane in the camera coordinate system, establishing a rigid constraint relationship between the laser plane and the camera. To eliminate random errors, this calibration process is repeated three times, and the average value of the plane equation parameters obtained from each calibration is taken as the final result, ensuring that the laser plane modeling error is ≤0.02mm.
[0065] Specifically, the laser projection parameters are set as follows: the first and second laser projectors are started simultaneously, the laser power is adjusted to 100mW, the laser stripe width is controlled at 0.08mm, and the projection angle is adjusted to 45° to ensure that the two laser stripes closely adhere to the sheet metal surfaces on both sides of the gap without any omissions, and completely cover the edge contour of the area being measured.
[0066] Image acquisition parameter configuration: Set the camera frame rate to 30fps and the exposure time to 300μs. The settings can be dynamically adjusted according to the ambient light intensity to avoid overexposure or underexposure. Enable the camera's synchronization trigger function to control two cameras to acquire images simultaneously through hardware synchronization signals. The time synchronization error is ≤1μs to ensure the time consistency of binocular images and avoid feature point misalignment caused by acquisition delay. Continuously acquire multiple sets of valid image data and remove blurry or striped distortion images caused by environmental interference such as dust or sudden changes in light to retain clear and complete valid samples.
[0067] Stripe features are extracted from the first camera image and the second camera image to obtain the first two-dimensional feature point set and the second two-dimensional feature point set on both sides of the workpiece to be measured, including:
[0068] S31. Perform distortion correction processing on the first camera image and the second camera image, wherein the image is back-projected based on the camera intrinsic parameter matrix and the corrected image is output.
[0069] S32. Perform stripe enhancement and noise suppression processing on the corrected image. The stripe enhancement uses a gray-level linear mapping function.
[0070] ;
[0071] Where L(u,v) represents the gray value at pixel coordinates (u,v) after enhancement, I(u,v) is the original gray value, α is the contrast gain coefficient, and β is the brightness offset; Gaussian filtering is performed on the enhanced image L(u,v) to obtain a smoothed image.
[0072] S33. Based on local statistical features, threshold segmentation is performed on the smoothed image to obtain stripe candidate regions, wherein the threshold function satisfies:
[0073] ;
[0074] Where T(u,v) is the segmentation threshold; μ(u,v) is the mean gray value of the neighborhood of pixel (u,v); σ(u,v) is the standard deviation of the neighborhood gray value; and k is the threshold adjustment coefficient.
[0075] In this embodiment, to improve the stability and accuracy of laser stripe feature extraction, grayscale enhancement, noise suppression, and adaptive segmentation processing are performed on the acquired binocular images. The specific implementation process is as follows:
[0076] The acquired binocular images are subjected to grayscale enhancement processing using a linear stretching formula:
[0077] ;
[0078] in, To enhance the grayscale values of the processed image, The original image grayscale value is 1.3, the contrast gain is 1.3, and the brightness offset is 10. This enhances the grayscale difference between the laser stripes and the background of the sheet metal surface, making the stripe outline clearer. Subsequently, a 5×5 Gaussian filter kernel is used for smoothing. The standard deviation of the Gaussian function σ=1.2 effectively suppresses ambient light noise and image sensor noise, reducing the interference of noise on stripe extraction.
[0079] Stripe region segmentation: An adaptive threshold segmentation algorithm is used, which dynamically adjusts the segmentation threshold based on the gray-level mean and variance of local image regions. The formula is as follows:
[0080] ;
[0081] in for The average gray value of the 3×3 neighborhood around the pixel. The neighborhood grayscale variance is denoted by k, which is an adjustment coefficient with a value of 1.5. This algorithm accurately separates the laser stripe region from the background region, obtains a binarized image, and initially locates the approximate position of the stripes.
[0082] Stripe feature extraction is performed on the first camera image and the second camera image to obtain the first two-dimensional feature point set and the second two-dimensional feature point set on both sides of the workpiece to be measured, and also includes:
[0083] Gradient operator edge detection is performed within the stripe candidate region to determine the stripe boundary. Based on the stripe boundary, a stripe grayscale profile is constructed for each row or column of pixels, and the sub-pixel centerline localization model is used to solve the stripe center coordinates.
[0084] The center coordinates of the subpixel stripes are processed by connectivity constraint filtering and morphological closing operation to obtain the center lines of continuous stripes; the center lines of continuous stripes are assigned to stripes, and the center line points assigned to the first laser stripe are output as the first two-dimensional feature point set, and the center line points assigned to the second laser stripe are output as the second two-dimensional feature point set.
[0085] Specifically, the Sobel operator is used to perform edge detection on the binarized image, and the gradient values in the x and y directions are calculated respectively. The pixel position of the stripe edge is determined by the gradient magnitude and direction. In order to improve the accuracy of feature point localization, sub-pixel interpolation is used to refine the edge pixels, so that the feature point coordinate accuracy reaches 0.01 pixels.
[0086] Solving for the three-dimensional coordinates of the first and second two-dimensional feature point sets includes:
[0087] S41. Perform epipolar correction processing on the first camera image based on the extrinsic parameter matrix to obtain an epipolar aligned image; in the epipolar aligned image, establish a one-dimensional matching search window along the corresponding epipolar direction, using feature points in the first camera image as reference points; construct a matching cost function based on gray-level correlation within the matching search window, evaluate the similarity of candidate matching points, and select the candidate point with the best score as the initial matching point pair; perform random sampling consensus algorithm processing on the initial matching point pair set to verify the geometric consistency of the matching point pairs and eliminate mismatched points; output the first matching point pair set that passes the consistency verification.
[0088] S42. Perform 3D coordinate solving for each pair of pixel coordinates in the first set of matching point pairs, including:
[0089] Based on the camera intrinsic parameter matrix, the pixel coordinates are converted into imaging coordinates respectively, and spatial rays in the first camera coordinate system and the second camera coordinate system are constructed. Based on the extrinsic parameter matrix, the spatial rays in the second camera coordinate system are transformed to the first camera coordinate system, and the spatial relative pose relationship of the two spatial rays in a unified coordinate system is established.
[0090] An equation for the first laser projection plane is introduced as an additional geometric constraint to ensure that the three-dimensional point to be determined satisfies both the binocular line-of-sight constraint and the laser plane constraint. Under the joint geometric constraint, the least squares optimization method is used to solve for the three-dimensional coordinates (x, y, z) of the spatial point. The three-dimensional coordinates (x, y, z) are accumulated sequentially to form the first three-dimensional point set on the corresponding side.
[0091] S43. The second two-dimensional feature point set is solved using the same solution process as S41 and S42, combined with the equation of the second laser projection plane, to form the second three-dimensional point set corresponding to the other side surface.
[0092] S44. Perform point cloud optimization processing on the first three-dimensional point set and the second three-dimensional point set respectively, construct a local neighborhood point set and calculate its mean and standard deviation, and remove discrete outliers that deviate from the mean by more than a preset multiple; apply spatial range constraint filtering to remove invalid points that exceed the measurement area, and output the first optimized three-dimensional point set and the second optimized three-dimensional point set.
[0093] Specifically, for each successfully matched feature point, its three-dimensional coordinates are solved using triangulation principles, combining the camera's intrinsic and extrinsic parameters with the laser projection plane equation. Taking the first laser stripe feature point as an example, let its coordinates in the left camera image be (u1, v1) and its coordinates in the right camera image be (u2, v2). Based on the camera imaging model, the coordinates are converted into ray equations in the camera coordinate system. Combined with the laser projection plane constraint, the intersection of the two rays with the laser plane is solved, which is the three-dimensional coordinates (x, y, z) of the feature point. This process is repeated to obtain the first three-dimensional point set on one side of the corresponding gap surface and the second three-dimensional point set on the other side surface. The point set density is ≥100 points / mm², ensuring that the three-dimensional morphology of the measured surface can be completely characterized.
[0094] Statistical filtering was performed on the two 3D point sets respectively. The filter window size was set to 50. The mean and standard deviation of the coordinates of the points within the window were calculated. Outliers that deviated from the mean by more than 3 times the standard deviation were removed, such as discrete points caused by false matching and noisy points corresponding to impurities on the workpiece surface. Then, pass-through filtering was used to remove invalid points that were outside the measurement range, further optimizing the point cloud quality and ensuring the integrity and accuracy of the 3D point set.
[0095] The calculation of the gap size parameter Gap and the surface difference parameter Flush includes:
[0096] For the first optimized 3D point set and the point sets on both sides of the second optimized 3D point set, candidate gap edges are extracted according to the preset edge neighborhood width, and connectivity constraints are applied to obtain edge point bands. Based on the edge point bands, robust plane fitting is performed on the point sets on both sides to obtain a mathematical model. The robust plane fitting includes: using iterative reweighted least squares to assign decay weights to outlying points, where the outlying points are 3D points whose residuals to the current fitted model exceed a preset residual threshold. The fitting residual convergence threshold is used as the termination condition, and the unit normal vector and intercept parameters of the mathematical model are output.
[0097] The calculation of the gap size parameter Gap and the surface difference parameter Flush also includes:
[0098] The measurement reference direction is established based on the unit normal vector of the mathematical model. A set of normal projection rays is constructed in the gap region. The distance between the intersection point of each projection ray and the first mathematical model and the second mathematical model is calculated. The difference between the two intersection points is taken as the single-point gap value. The median of the single-point gap value is taken as the gap size Gap.
[0099] Multiple pairs of corresponding points are selected at equal intervals along the rotation direction on the edge point band. The edge point band is a strip-shaped set of three-dimensional points extracted from the first optimized three-dimensional point set and the second optimized three-dimensional point set along the gap opening boundary direction and within the preset normal neighborhood width. The corresponding point pairs are subjected to dual constraint verification of epipolar consistency and spatial nearest neighbor consistency. The projection distance difference of the corresponding point pairs that pass the verification is calculated in the measurement reference direction. The mean and variance of the projection distance difference are statistically analyzed, and the mean of the remaining projection distance difference is used as the surface difference Flush.
[0100] In this embodiment, as Figure 5 As shown, a high-precision calculation method for gaps and surface differences in sheet metal parts based on geometric feature fitting is proposed. First, the acquired edge pixel point cloud is clustered to obtain independent point sets on both sides of the gap (cluster 1 and cluster 2). Then, piecewise geometric modeling is performed on each point set: the plane equation is obtained by fitting its linear portion using the least squares method. Simultaneously, the coordinates of the center of the circle are obtained by fitting its circular arc transition portion. and radius Then, the tangent point (i.e. the edge boundary point) between the straight line and the arc is calculated through geometric constraints. Based on this, the flush calculation adopts a "single-sided reference, opposite-sided feature point" strategy, that is, using the fitted line of one side (such as cluster 1) as the theoretical reference plane, and calculating the edge boundary points of the other side (cluster 2). The vertical distance to the reference plane is calculated using the formula: This is used to characterize the step height difference between the two surfaces at the transition start point. In this embodiment, the calculated surface difference parameter is 0.05mm, which meets the design requirements (≤0.1mm).
[0101] The gap calculation employs a "double-center Euclidean distance" strategy, which calculates the Euclidean distance between the centers of the fitted arcs on both sides. After deducting the sum of the radii of the two arcs, the final gap formula is: This method obtains the net gap width after excluding rounded corner interference. In this embodiment, the calculated gap size is 2.98mm, which deviates from the design value of 3mm by 0.02mm, meeting the assembly accuracy requirements. This method effectively overcomes the influence of local noise and data loss by extracting geometric features (tangent point and center of circle) with clear physical meaning to replace the traditional discrete point statistical averaging, thus achieving a robust quantitative assessment of sheet metal assembly accuracy.
[0102] Repeatability verification: The same assembly part was measured five times consecutively, and the gap size and surface difference parameters were recorded each time. The standard deviation of the measurement results was calculated. The gap size measurements were 2.98mm, 2.99mm, 2.97mm, 2.98mm, and 2.99mm, with a standard deviation of 0.008mm and a measurement error ≤ ±0.02mm. The surface difference parameters were 0.05mm, 0.04mm, 0.05mm, 0.06mm, and 0.05mm, with a standard deviation of 0.007mm and a measurement error ≤ ±0.01mm, meeting the high-precision inspection requirements of automotive sheet metal assembly.
[0103] Accuracy verification: A high-precision contact measuring instrument (measurement accuracy ±0.005mm) was used to compare the measurements of the same gap area. The standard value of the gap size was 2.985mm and the standard value of the surface difference parameter was 0.048mm. The deviations of the measurement results of this invention from the standard values were within the allowable range, thus verifying the accuracy of the measurement method.
[0104] Stability verification: Measurements were taken under different environmental conditions (ambient temperature 20℃±5℃, humidity 40%-60%), and the fluctuation of the measurement results was recorded. The gap size fluctuation was ≤±0.015mm, and the surface difference parameter fluctuation was ≤±0.008mm, indicating that the system has good stability and anti-interference ability in complex industrial environments.
[0105] like Figure 2 As shown, a gap difference measurement system based on a binocular dual-laser reconstruction mechanism includes:
[0106] A binocular imaging unit is used to acquire binocular image data containing a first laser stripe and a second laser stripe, and transmit it to the calibration and reconstruction unit;
[0107] The dual laser projection unit includes a first laser projector and a second laser projector, used to project line laser stripes onto the surfaces on both sides of the gap to be measured.
[0108] Specifically, such as Figure 3As shown, the binocular imaging unit consists of two high-definition industrial cameras with a resolution ≥1920×1080, a frame rate ≥30fps, and a lens focal length selectable at 12mm or 25mm to adapt to different measurement distance requirements. It is used to simultaneously acquire binocular image data containing laser stripes. The dual laser projection unit contains two line laser projectors with wavelengths selectable at 650nm or 532nm, laser power adjustable from 0-500mW, laser stripe width ≤0.1mm, and projection angle adjustable from 30° to 60°. It is used to project independent and clear laser stripes to both sides of the gap.
[0109] The calibration and reconstruction unit is connected to the binocular imaging unit and the dual laser projection unit. It is used to perform camera extrinsic parameter calibration and laser plane calibration, solve the three-dimensional coordinates of the stripe feature points based on the binocular line-of-sight constraints and laser plane constraints, and output the first three-dimensional point set and the second three-dimensional point set.
[0110] The gap and surface difference calculation unit is connected to the calibration and reconstruction unit. It performs point cloud optimization and mathematical model fitting on the first three-dimensional point set and the second three-dimensional point set, and calculates the gap size and surface difference based on the mathematical model.
[0111] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired or wireless network. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0112] Some of the data in the above formulas are numerical calculations with dimensions removed, and the contents not described in detail in this specification are all prior art known to those skilled in the art.
[0113] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. A method for measuring gap surface difference based on a binocular dual-laser reconstruction mechanism, characterized in that, include: Spatial calibration of the gap surface difference measurement system is performed, and the intrinsic and extrinsic parameter matrices of the first and second cameras are solved. Based on the correspondence between standard geometry and laser stripes, the equations of the first and second laser projection planes are calculated. To measure the workpiece, laser stripes are projected by the first laser projector and the second laser projector to cover the surfaces on both sides of the gap, and images from the first camera and the second camera are acquired by the first camera and the second camera, respectively. Stripe features are extracted from the first camera image and the second camera image to obtain the first two-dimensional feature point set and the second two-dimensional feature point set on both sides of the workpiece to be tested. Based on the intrinsic and extrinsic parameter matrices of the first and second cameras, the three-dimensional coordinates of the first two-dimensional feature point set and the second two-dimensional feature point set are solved to obtain the first three-dimensional point set and the second three-dimensional point set on both sides of the workpiece to be measured. Solving for the three-dimensional coordinates of the first and second two-dimensional feature point sets includes: S41. Perform epipolar correction processing on the first camera image based on the extrinsic parameter matrix to obtain an epipolar aligned image; in the epipolar aligned image, establish a one-dimensional matching search window along the corresponding epipolar direction, using feature points in the first camera image as reference points; construct a matching cost function based on gray-level correlation within the matching search window, evaluate the similarity of candidate matching points, and select the candidate point with the best score as the initial matching point pair; perform random sampling consensus algorithm processing on the initial matching point pair set to verify the geometric consistency of the matching point pairs and eliminate mismatched points; output the first matching point pair set that passes the consistency verification. S42. Perform three-dimensional coordinate solving for each pair of pixel coordinates in the first set of matching point pairs, including: Based on the camera intrinsic parameter matrix, the pixel coordinates are converted into imaging coordinates respectively, and spatial rays in the first camera coordinate system and the second camera coordinate system are constructed. Based on the extrinsic parameter matrix, the spatial rays in the second camera coordinate system are transformed to the first camera coordinate system, and the spatial relative pose relationship of the two spatial rays in a unified coordinate system is established. An equation for the first laser projection plane is introduced as an additional geometric constraint to ensure that the three-dimensional point to be determined satisfies both the binocular line-of-sight constraint and the laser plane constraint. Under the joint geometric constraint, the least squares optimization method is used to solve for the three-dimensional coordinates (x, y, z) of the spatial point. The three-dimensional coordinates (x, y, z) are accumulated sequentially to form the first three-dimensional point set on the corresponding side. S43. The second two-dimensional feature point set is solved using the same solution process as S41 and S42, combined with the equation of the second laser projection plane, to form the second three-dimensional point set corresponding to the other side surface. S44. Perform point cloud optimization processing on the first three-dimensional point set and the second three-dimensional point set respectively, construct a local neighborhood point set and calculate its mean and standard deviation, and remove discrete outliers that deviate from the mean by more than a preset multiple; apply spatial range constraint filtering to remove invalid points that exceed the measurement area, and output the first optimized three-dimensional point set and the second optimized three-dimensional point set. Point cloud optimization and mathematical model fitting are performed on the first and second 3D point sets; the gap size and surface difference are calculated and output based on the mathematical model.
2. The gap difference measurement method based on binocular dual-laser reconstruction mechanism according to claim 1, characterized in that, Spatial calibration of the binocular dual-laser measurement system includes: S21. Using a calibration board as a spatial calibration reference, multiple sets of binocular synchronous images are acquired under different spatial postures. Two-dimensional pixel coordinates are extracted from the binocular synchronous images and a correspondence is established with the known three-dimensional coordinates of the calibration board. A reprojection error function is constructed, and least squares iterative optimization is performed based on Zhang Zhengyou's calibration algorithm to solve the intrinsic and extrinsic parameter matrices of the first and second cameras. S22. Place the calibration rod in the measurement area, acquire binocular images and extract the fringe center feature points. Project the fringe feature points back onto the spatial ray through the camera intrinsic and extrinsic matrix, establish a geometric constraint relationship with the known spatial coordinates of the calibration rod, and solve the equations of the first and second laser projection planes using the plane least squares fitting method based on multiple sets of three-dimensional fringe point sets.
3. The gap difference measurement method based on binocular dual-laser reconstruction mechanism according to claim 1, characterized in that, Stripe feature extraction is performed on the first camera image and the second camera image to obtain a first two-dimensional feature point set and a second two-dimensional feature point set on both sides of the workpiece to be tested, including: S31. Perform distortion correction processing on the first camera image and the second camera image, wherein the image is back-projected based on the camera intrinsic parameter matrix and the corrected image is output. S32. Perform stripe enhancement and noise suppression processing on the corrected image. The stripe enhancement uses a gray-level linear mapping function. ; Where L(u,v) represents the gray value at pixel coordinates (u,v) after enhancement, I(u,v) is the original gray value, α is the contrast gain coefficient, and β is the brightness offset; Gaussian filtering is performed on the enhanced image L(u,v) to obtain a smoothed image. S33. Based on local statistical features, threshold segmentation is performed on the smoothed image to obtain stripe candidate regions, where the threshold function satisfies: ; Where T(u,v) is the segmentation threshold; μ(u,v) is the mean gray value of the neighborhood of pixel (u,v); σ(u,v) is the standard deviation of the neighborhood gray value; and k is the threshold adjustment coefficient.
4. The gap difference measurement method based on binocular dual-laser reconstruction mechanism according to claim 1, characterized in that, Stripe feature extraction is performed on the first camera image and the second camera image to obtain a first two-dimensional feature point set and a second two-dimensional feature point set on both sides of the workpiece to be tested, and the method further includes: Gradient operator edge detection is performed within the stripe candidate region to determine the stripe boundary. Based on the stripe boundary, a stripe grayscale profile is constructed for each row or column of pixels, and the sub-pixel centerline localization model is used to solve the stripe center coordinates. The center coordinates of the stripes are subjected to connectivity constraint filtering and morphological closing operation to obtain the center lines of continuous stripes; the center lines of continuous stripes are assigned to stripes, and the center line points assigned to the first laser stripe are output as the first two-dimensional feature point set, and the center line points assigned to the second laser stripe are output as the second two-dimensional feature point set.
5. The gap difference measurement method based on binocular dual-laser reconstruction mechanism according to claim 1, characterized in that, The calculation of the gap size and surface difference includes: For the first optimized 3D point set and the point sets on both sides of the second optimized 3D point set, candidate gap edges are extracted according to the preset edge neighborhood width, and connectivity constraints are applied to obtain edge point bands. Based on the edge point bands, robust plane fitting is performed on the point sets on both sides to obtain a mathematical model. The robust plane fitting includes: using iterative reweighted least squares to assign decay weights to outlying points, where the outlying points are 3D points whose residuals to the current fitted model exceed a preset residual threshold. The fitting residual convergence threshold is used as the termination condition, and the unit normal vector and intercept parameters of the mathematical model are output.
6. The gap difference measurement method based on binocular dual-laser reconstruction mechanism according to claim 1, characterized in that, The calculation of the gap size and surface difference also includes: The measurement reference direction is established based on the unit normal vector of the mathematical model. A set of normal projection rays is constructed in the gap region. The distance between the intersection point of each projection ray and the first mathematical model and the second mathematical model is calculated. The difference between the two intersection points is taken as the single-point gap value. The median of the single-point gap value is taken as the gap size Gap. Multiple pairs of corresponding points are selected at equal intervals along the rotation direction on the edge point strip. The edge point strip is a strip-shaped set of three-dimensional points extracted from the first optimized three-dimensional point set and the second optimized three-dimensional point set along the gap opening boundary direction and within the preset normal neighborhood width. The corresponding point pairs are subjected to dual constraint verification of epipolar consistency and spatial nearest neighbor consistency. The projection distance difference of the corresponding point pairs that pass the verification is calculated in the measurement reference direction. The mean and variance of the projection distance difference are statistically analyzed, and the mean of the remaining projection distance difference is used as the surface difference Flush.
7. A system applied to the gap difference measurement method based on binocular dual-laser reconstruction mechanism as described in any one of claims 1 to 6, characterized in that, include: A binocular imaging unit is used to acquire binocular image data containing a first laser stripe and a second laser stripe, and transmit it to the calibration and reconstruction unit; The dual laser projection unit includes a first laser projector and a second laser projector, used to project line laser stripes onto the surfaces on both sides of the gap to be measured. The calibration and reconstruction unit is connected to the binocular imaging unit and the dual laser projection unit. It is used to perform camera extrinsic calibration and laser plane calibration, and to solve the three-dimensional coordinates of the stripe feature points based on the binocular line-of-sight constraints and laser plane constraints, and output the first three-dimensional point set and the second three-dimensional point set. The gap and surface difference calculation unit is connected to the calibration and reconstruction unit. It performs point cloud optimization and mathematical model fitting on the first three-dimensional point set and the second three-dimensional point set, and calculates the gap size and surface difference based on the mathematical model.
Citation Information
Patent Citations
Gap and surface difference vision measuring device used in match with robot and method
CN107843202A
Binocular stereo vision three-dimensional measurement method based on line structured light scanning
CN107907048A