A space measurement and image correction method based on laser positioning

By using laser-based multi-feature collaborative recognition and spatial intersection calculation, the problems of high complexity, insufficient accuracy, and poor environmental adaptability in spatial coordinate calculation in existing technologies have been solved. Sub-millimeter level accuracy measurement and image correction have been achieved, expanding the application scope and simplifying the operation process.

CN121346657BActive Publication Date: 2026-03-24CHONGQING UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing spatial coordinate calculation methods suffer from high system complexity, high cost, limited measurement accuracy, insufficient flexibility, and poor environmental adaptability under complex working conditions. They are particularly difficult to deploy in large-scale or severely occluded scenarios, and the laser spot recognition and positioning accuracy is insufficient, making it difficult to meet sub-pixel level positioning requirements.

Method used

A laser-based spatial measurement and image correction method is adopted. By projecting multiple laser positioning points, a multi-feature collaborative recognition algorithm is used to identify the light spot. The sub-pixel-level center coordinates are calculated by combining the gray-scale weighted centroid method. Based on the pre-calibrated system parameters, the coordinates are converted into three-dimensional spatial coordinates. The singular value decomposition algorithm is used to fit the plane equation, and the perspective transformation matrix is ​​calculated to perform image correction, thereby realizing the conversion from pixel size to physical size.

Benefits of technology

It achieves sub-millimeter accuracy measurement in complex environments, eliminates dependence on physical calibration objects, expands the application range, simplifies the operation process, improves measurement accuracy and image correction accuracy, and supports automated processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121346657B_ABST
    Figure CN121346657B_ABST
Patent Text Reader

Abstract

The invention provides a kind of space measurement and image correction method based on laser positioning.The method includes laser projection and image acquisition,light spot identification and coordinate extraction,space coordinate calculation,plane fitting and coordinate correction,perspective transformation and pixel calibration and image geometric correction and other steps.The method establishes a reliable benchmark for geometric correction based on the space coordinates of the positioning points.Through multi-point plane fitting and coordinate projection correction,the influence of perspective distortion and measurement error is effectively eliminated.The innovative perspective transformation matrix calculation method combined with geometric constraint optimization ensures the accuracy and stability of image correction.The established pixel equivalent calculation model realizes the accurate conversion from pixel size to physical size,providing a reliable guarantee for subsequent accurate measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision measurement technology, and in particular to a spatial measurement and image correction method based on laser positioning. Background Technology

[0002] Image-based dimensional measurement and spatial positioning technology, as an efficient and non-contact measurement method, has been widely applied in fields such as industrial product inspection and infrastructure structure monitoring. This technology captures images of target objects using a camera and extracts feature information using image processing algorithms, ultimately calculating the object's geometric dimensions or its precise spatial position. However, existing spatial coordinate calculation methods still face significant technical limitations in practical applications, restricting their further promotion under complex working conditions.

[0003] A. While binocular vision systems can directly acquire 3D information of target points through stereo vision principles, their implementation relies on high-precision dual-camera calibration to determine their relative positions and orientations, and requires strict synchronous acquisition control. This not only leads to high system complexity and high cost, but also severely restricts measurement performance due to limitations imposed by the camera base distance and the overlap area of ​​the field of view. An excessively short base distance limits the accuracy of depth measurements, while an excessively long base distance may reduce the common field of view, making deployment difficult in some large-scale or heavily occluded scenarios.

[0004] B. While monocular vision systems have a relatively simple structure, they heavily rely on known reference objects to establish the mapping between the image pixel coordinate system and the world coordinate system when performing dimensional measurements and spatial positioning. This method lacks flexibility in practical applications. For example, in field or high-altitude work scenarios such as bridge construction and large steel structure installations, setting up calibration plates is not only cumbersome and inefficient but also poses significant safety hazards. Furthermore, even minor changes in camera pose may require recalibration, limiting its practicality in long-term monitoring.

[0005] C. Existing technologies also face bottlenecks in the crucial front-end stage of coordinate calculation: laser spot identification and localization. Current mainstream identification methods are mostly based on single features, resulting in poor environmental adaptability: in outdoor environments, direct sunlight can easily lead to oversaturation of the spot area, while cloudy conditions may cause missed detections due to insufficient brightness. Regarding positioning accuracy, commonly used simple centroid methods or moment calculation methods typically only achieve pixel-level accuracy, which is insufficient to meet the stringent requirements of modern precision measurement for sub-pixel-level positioning accuracy.

[0006] Therefore, developing a laser-based spatial measurement and image correction method has become an urgent need in this field. Summary of the Invention

[0007] The purpose of this invention is to provide a spatial measurement and image correction method based on laser positioning to solve the problems existing in the prior art.

[0008] The technical solution adopted to achieve the purpose of this invention is as follows: a spatial measurement and image correction method based on laser positioning, comprising the following steps:

[0009] S1) Multiple laser positioning points are projected onto the surface of the object being measured using a laser. A digital image containing the laser spots is acquired using an industrial camera.

[0010] S2) A multi-feature collaborative recognition algorithm is used to identify laser spot in the acquired image. After recognition, the sub-pixel-level center image coordinates of the spot are calculated using the gray-level weighted centroid method. The multi-feature collaborative recognition algorithm includes color feature selection, mask optimization, brightness feature selection, and shape feature selection.

[0011] S3) Based on pre-calibrated system parameters, the image coordinates are converted into three-dimensional spatial coordinates. The spatial intersection calculation model models the laser emission path as a first spatial straight line and the camera imaging optical path as a second spatial straight line. By solving for the common perpendicular of the two straight lines, the foot of the perpendicular is used as the three-dimensional coordinate of the laser positioning point.

[0012] S4) Based on the three-dimensional spatial coordinates of multiple positioning points, the singular value decomposition algorithm is used to fit the plane equation of the object under test.

[0013] S5) Calculate the perspective transformation matrix based on the correspondence between the image coordinates and spatial coordinates of the positioning points. Calculate the pixel equivalent to achieve the conversion from pixel size to physical size.

[0014] S6) Apply the perspective transformation matrix to perform geometric correction on the original image and output a scale-accurate corrected image.

[0015] Furthermore, in step S1), a green light source laser is selected as the laser. Laser projection is controlled by a two-dimensional galvanometer system to ensure that the positioning points are evenly distributed according to a preset pattern. The preset pattern includes a rectangular array, a circular array, or a cross-shaped distribution. The industrial camera has a resolution of at least 5 million pixels. The camera's focal length and exposure parameters are adjusted according to the environment.

[0016] Further, in step S2), the color feature selection is based on the HSV color space. A flood filling algorithm is used to fill the mask holes formed by oversaturation at the center of the light spot, obtaining a complete mask of the light spot region. The HSV threshold range for color feature selection is: S∈[50,255], V∈[50,255], and the H value can take any value from [0,180] depending on the color of the laser source.

[0017] Furthermore, in step S2), the shape feature filtering is based on discrete coefficients. The formula for calculating the discrete coefficients of the candidate region is as follows:

[0018]

[0019] In the formula, Dc represents the discrete coefficient of the candidate region. This represents the variance of the distance from each pixel within the candidate region to the region center. N represents the number of pixels in the region. The filtering criteria are set as follows: Candidate regions that meet this condition will be identified and marked as valid laser spots.

[0020] Furthermore, in step S3), the parametric equation of the first spatial line is:

[0021]

[0022] The parametric equation of the second spatial line is:

[0023] .

[0024] The formula for calculating the coordinates of the foot of the common perpendicular on the second spatial line is:

[0025]

[0026] Where t and s represent the parameters of the common perpendicular.

[0027] Furthermore, step S4) specifically includes the following sub-steps:

[0028] S4.1) Calculate the centroid of the point set, construct the covariance matrix and perform SVD decomposition to obtain the normal vector.

[0029] S4.2) Project the coordinates to eliminate measurement errors. Project the point p=(x,y,z) onto the fitting plane and correct the coordinates p′=(x′,y′,z′).

[0030] S4.3) Select a reference point.

[0031] Furthermore, in step S4.2), when performing projection correction, the spatial coordinates calculated from multiple images are fused, and the least squares method is used to fit the expression of the line to improve the calculation accuracy.

[0032] Furthermore, in step S5), two relative positioning points in the fixed image are used as reference points. The image distance and actual spatial distance from the reference points to the other positioning points are used as references. The coordinates of the positioning points after perspective transformation are derived through geometric constraints, thereby solving the perspective transformation matrix.

[0033] This invention also discloses the application of the above method in industrial inspection. The method is used for non-contact dimensional measurement and defect detection of industrial components. By projecting laser positioning points onto the component surface, combined with multi-feature collaborative recognition and spatial intersection calculation, sub-millimeter-level precision geometric parameter quantization is achieved.

[0034] This invention also discloses the application of the above method in engineering structure inspection. The method is used for long-term deformation monitoring or surface defect detection of engineering structures. In the field or high-risk environments, laser positioning points are projected onto the structural surface. Spatial coordinate calculations and plane fitting are used to track structural displacement changes or detect surface defects, and historical data is combined to achieve trend analysis. An image correction step compensates for perspective errors, outputting accurate scale images, supporting automated early warning systems for preventative maintenance and safety assessments.

[0035] The technical effects of this invention are beyond doubt:

[0036] A. In terms of spatial coordinate calculation, this invention employs a multi-feature collaborative recognition algorithm. Through multi-level filtering of color, brightness, and shape, it effectively overcomes interference problems in complex environments, achieving sub-pixel-level precise positioning of the laser spot. Combining pre-calibrated laser ray parameters and a precise spatial intersection calculation model, the measurement accuracy of converting image coordinates into three-dimensional spatial coordinates reaches the sub-millimeter level, laying a solid foundation for precise measurement.

[0037] B. Regarding image correction, this invention establishes a reliable benchmark for geometric correction based on the spatial coordinates of the positioning points. Through multi-point plane fitting and coordinate projection correction, the effects of perspective distortion and measurement errors are effectively eliminated. An innovative perspective transformation matrix calculation method combined with geometric constraint optimization ensures the accuracy and stability of image correction. The established pixel equivalent calculation model achieves accurate conversion from pixel size to physical size, providing a reliable guarantee for subsequent accurate measurements.

[0038] C. This invention improves measurement accuracy under complex working conditions, eliminates reliance on physical calibration objects, achieves non-contact measurement, and greatly expands the application range. Furthermore, it realizes fully automated processing from image acquisition to result output, significantly simplifying the operation process and reducing labor costs and technical barriers. Attached Figure Description

[0039] Figure 1 This is a flowchart of a laser-based spatial measurement method;

[0040] Figure 2 Here is a flowchart of an image correction method based on laser positioning;

[0041] Figure 3 This is a schematic diagram illustrating the principle of spatial coordinate calculation.

[0042] Figure 4 This is a schematic diagram of the image perspective correction process;

[0043] Figure 5 (a) is a schematic diagram of the principle of solving the perspective transformation coordinates of the positioning point; Figure 5(b) is a schematic diagram of the principle of screening the cross product of the perspective transformation solution of the positioning point.

[0044] Figure 6 This is a schematic diagram of the 2×2 grid square target proposed in Embodiment 2 of the present invention;

[0045] Figure 7 This is a schematic diagram of the image processing flow under the oblique measurement condition proposed in Embodiment 2 of the present invention;

[0046] Figure 8 This is a schematic diagram of the image processing flow under vertical measurement conditions proposed in Embodiment 2 of the present invention. Detailed Implementation

[0047] The present invention will be further described below with reference to embodiments, but it should not be construed that the scope of the present invention is limited to the following embodiments. Various substitutions and modifications made based on ordinary technical knowledge and common practices in the art without departing from the above-described technical concept of the present invention should be included within the scope of protection of the present invention.

[0048] Example 1:

[0049] See Figures 1-5 This embodiment provides a spatial measurement and image correction method based on laser positioning, including the following steps:

[0050] S1) Multiple laser positioning points are projected onto the surface of the object being measured using a laser. An industrial camera is used to capture digital images containing the laser spots. In actual production, a specific wavelength laser is used to project multiple laser positioning points onto the surface being measured. By precisely controlling the laser power and projection angle, clear imaging is ensured for surfaces of different distances and materials. A two-dimensional galvanometer system is used to achieve a uniform distribution of positioning points according to a preset deflection sequence. An industrial camera system with at least 5 megapixels is configured to capture digital images containing the laser positioning points.

[0051] S2) A multi-feature collaborative recognition algorithm is used to identify laser spot in the acquired image. After recognition, the sub-pixel-level center image coordinates of the spot are calculated using the gray-level weighted centroid method. The multi-feature collaborative recognition algorithm includes color feature filtering, mask optimization, brightness feature filtering, and shape feature filtering. Specifically:

[0052] Color feature filtering converts the RGB color space to the HSV color space. A hue range is set to cover the laser distribution characteristics. Interference areas are eliminated using saturation and brightness thresholds.

[0053] The mask optimization employs a flood filling algorithm to repair mask holes caused by oversaturation at the center of the light spot. The optimized mask is then used to crop the original image grayscale, preserving effective feature regions.

[0054] Brightness feature filtering sets a grayscale threshold T=200, retaining pixels with grayscale values ​​≥T.

[0055] Shape feature filtering defines the coefficient of variation ,in The variance of the pixel positions in the candidate region. This represents the theoretical variance of an ideal circular region with the same number of pixels. Set a filtering threshold. .

[0056] Subpixel-level center coordinates are calculated using the gray-scale weighted average method.

[0057] S3) Based on pre-calibrated system parameters, the image coordinates are converted into three-dimensional spatial coordinates. The spatial intersection calculation model models the laser emission path as a first spatial straight line and the camera imaging optical path as a second spatial straight line. By solving for the common perpendicular of the two straight lines, the foot of the perpendicular is used as the three-dimensional coordinate of the laser positioning point.

[0058] S4) Based on the three-dimensional spatial coordinates of multiple positioning points, the singular value decomposition (SVD) algorithm is used to fit the plane equation of the measured object. .

[0059] S5) Calculate the perspective transformation matrix based on the correspondence between the image coordinates and spatial coordinates of the positioning points. Calculate the pixel equivalent to achieve the conversion from pixel size to physical size. Perform projection correction on the positioning point coordinates to eliminate measurement errors. Select the optimal combination of reference points based on geometric constraints. Solve for the perspective transformation matrix using the correspondence between the image coordinates and spatial coordinates of the positioning points. A pixel equivalent model is established based on the ratio between the actual distance to the reference point and the pixel distance.

[0060] S6) Apply the perspective transformation matrix to perform geometric correction on the original image and output a scale-accurate corrected image.

[0061] Example 2:

[0062] The main content of this embodiment is the same as that of Embodiment 1, except that in step S1), a green light source laser is selected. Laser projection is controlled by a two-dimensional galvanometer system to ensure that the positioning points are evenly distributed according to a preset pattern. The preset pattern includes a rectangular array, a circular array, or a cross-shaped distribution. The industrial camera has a resolution of at least 5 million pixels. The camera's focal length and exposure parameters are adjusted according to the environment.

[0063] Example 3:

[0064] The main content of this embodiment is the same as that of embodiment 1 or 2. In step S2), the color feature selection is based on the HSV color space. A flood filling algorithm is used to fill the mask holes formed by oversaturation at the center of the light spot, obtaining a complete mask of the light spot area. The HSV threshold range for color feature selection is: S∈[50,255], V∈[50,255], and the H value can take any value from [0,180] depending on the color of the laser source.

[0065] In step S2), the shape feature filtering is based on discrete coefficients. The formula for calculating the discrete coefficients of the candidate region is as follows:

[0066]

[0067] In the formula, Dc represents the discrete coefficient of the candidate region. This represents the variance of the distance from each pixel within the candidate region to the region center. N represents the number of pixels in the region. The filtering criteria are set as follows: Candidate regions that meet this condition will be identified and marked as valid laser spots.

[0068] Example 4:

[0069] The main content of this embodiment is the same as any one of embodiments 1 to 3, wherein, in step S3), the parametric equation of the first spatial line is:

[0070]

[0071] The parametric equation of the second spatial line is:

[0072] .

[0073] The formula for calculating the coordinates of the foot of the common perpendicular on the second spatial line is:

[0074]

[0075] Among them, the first and second spatial linear parametric equations are based on the spatial linear parametric model. The laser emission path and the camera imaging optical path are both straight lines in three-dimensional space, and the motion trajectory of the points can be accurately described by the parametric equations.

[0076] Since the laser path and the camera optical path may be skew lines, their intersection cannot be directly determined. The formula for calculating the coordinates of the foot of the common perpendicular is to locate it by solving for the foot of the common perpendicular of the two lines (i.e., the point of shortest distance). A system of equations is constructed and simplified using the common perpendicular condition in vector geometry (the line connecting the feet of the perpendiculars is perpendicular to both lines).

[0077] p(s) and p(t) represent the coordinate vectors of points on the first spatial line (laser emission path) and the second spatial line (camera imaging path), respectively. p0 is the known starting point coordinate vector on the first spatial line (obtained through laser calibration). v is the direction vector of the first spatial line (representing the laser emission direction). d is the direction vector of the second spatial line (pointing from the camera optical center to the image point). t and s represent the common perpendicular parameters, used to calculate the position of the perpendicular foot point on the two lines.

[0078] Example 5:

[0079] The main content of this embodiment is the same as any one of embodiments 1 to 4, wherein step S4) specifically includes the following sub-steps:

[0080] S4.1) Calculate the centroid of the point set, construct the covariance matrix and perform SVD decomposition to obtain the normal vector.

[0081] S4.2) Projection correction is performed on the coordinates to eliminate measurement errors. The point p=(x,y,z) is projected onto the fitting plane, and the coordinates p′=(x′,y′,z′) are corrected. During projection correction, the spatial coordinates calculated from multiple images are fused, and the least squares method is used to fit the expression of the line to improve the calculation accuracy.

[0082] S4.3) Select a reference point.

[0083] Example 6:

[0084] The main content of this embodiment is the same as any one of embodiments 1 to 5. In step S5), two relative positioning points in the fixed image are used as reference points. The image distance and actual spatial distance from the reference point to the other positioning points are used as references. The coordinates of the positioning points after perspective transformation are derived through geometric constraint relationships, thereby solving the perspective transformation matrix.

[0085] Example 7:

[0086] This embodiment provides an application of the method described in any one of Embodiments 1 to 6 in industrial inspection. The method is used for non-contact dimensional measurement and defect detection of industrial components. By projecting laser positioning points onto the component surface, combined with multi-feature collaborative recognition and spatial intersection calculation, sub-millimeter-level precision geometric parameter quantization is achieved. The specific implementation process is as follows:

[0087] Projected laser positioning point: In this example, using a green light source laser, the laser will form a distinctive light spot structure when it shines on the wall: the outer edge of the light spot shows a distinct green halo, while the central area forms a white high-brightness area due to the high light intensity. This unique appearance feature provides an important visual basis for the rapid selection of light spots.

[0088] Camera image acquisition: The camera acquires images under appropriate focal length and exposure parameters. The image resolution should be adjusted according to the positioning accuracy requirements. The acquired images are transmitted to the data processing module for laser spot recognition.

[0089] Laser spot recognition and localization, specifically including:

[0090] (1) Color Feature Filtering: The image was converted to the HSV color space using OpenCV's cvtColor function. For the green laser source, whose hue value is around 60 and whose laser spot has high saturation and brightness, to fully cover the distribution range of the green laser, the lower limits of saturation and brightness were set to 50 respectively to exclude interference areas with low saturation and low brightness. The HSV threshold range was then set as follows: , , The binarized mask is generated using the inRange function.

[0091] (2) Mask optimization: Detect connected components in the mask and mark the hole areas; use the flood filling algorithm to repair the missing central area.

[0092] (3) Brightness feature filtering: Extract the grayscale image of the area corresponding to the mask; set the grayscale threshold to 200 and filter out the laser center area image with higher brightness.

[0093] (4) Shape feature screening: In image laser spot recognition, the center of the spot is relatively discrete and is related to the variance of the candidate region. Therefore, the two-dimensional center coordinates can be calculated first. :

[0094] (1)

[0095] In the formula: The number of pixels; These are the pixel coordinates of a point.

[0096] Then calculate the distance from each point to the center. Then calculate its variance. :

[0097] (2)

[0098] (3)

[0099] In the formula: The mean of the distances. .

[0100] For light spot areas of different sizes, only from The value of variance is difficult to directly determine the degree of dispersion. Therefore, this invention proposes a method for quantifying dispersion based on the variance ratio, which calculates the variance of the candidate region. variance compared to the standard circular distribution The ratio of the two is defined as the coefficient of variation. As a quantitative evaluation index of the degree of dispersion. It is assumed that the points are uniformly distributed within a radius of... Inside the disk, at the center point of the disk For a uniformly distributed disk, the position of a point can be represented using polar coordinates. It means that, among them Let be the distance from the point to the center of the circle. Let be the angle. Then the probability density function of the distance and the mean distance are:

[0101] (4)

[0102] (5)

[0103] Then distance variance for:

[0104] (6)

[0105] But the radius of the region to be selected in the image It cannot be directly determined; this invention is derived based on the assumption that pixels are squares with dimensions of 1. With the number of pixels The mathematical relationship between them:

[0106] (7)

[0107] For a certain number of pixels The variance of the corresponding circular distribution of the candidate region is:

[0108] (8)

[0109] Then the corresponding discrete coefficients for:

[0110] (9)

[0111] For the selected candidate region pixels, the centroid is accurately calculated using the gray-scale weighted average method, thereby determining the coordinates of the center point of the light spot. .

[0112] (10)

[0113] In the formula: For point The grayscale value.

[0114] Obtaining the coordinates of the light spot image: In this example, during the system pre-calibration stage, a 2×2 calibration board containing four corner points is used. The camera's pose parameters can be obtained using the calibration board, but no physical calibration object is needed during the actual measurement process.

[0115] Combination Figure 3 The principle diagram for spatial coordinate calculation is as follows: First, the image coordinates of the corner points on the 2×2 calibration board are identified and distortion correction is performed. Then, using the relative positional relationship between the corner points of the calibration board, the PnP (Perspective n Point) algorithm is used to solve for the camera's pose parameters (i.e., the rotation matrix). Translation vector First, the spatial relationship between the camera and the calibration board is established. Finally, by coordinate projection, the coordinates of the corner points on the 2×2 calibration board are mapped to the camera coordinate system to determine the spatial coordinates of the corner points. Then, the spatial coordinates of the calibration board origin can be obtained. and the normal vector of its plane This allows for the targeting of any positioning point on the calibration plate plane. Combining the relationship that the vector from the origin to this point is perpendicular to the normal vector, we can obtain... Furthermore, the spatial coordinates of the positioning point can also be represented by the two-dimensional coordinates after distortion correction on the image. Finally, the spatial coordinates of the positioning point can be obtained by solving the two equations:

[0116] (11)

[0117] The formula for representing the two-dimensional coordinates after image distortion correction is based on the camera pinhole model and perspective projection principles. (u,v) are the image pixel coordinates. (x... c ,y c ,z c () represents the 3D spatial coordinates in the camera coordinate system. u0, v0 are the coordinates of the camera principal point. kx, ky are the pixel equivalents corresponding to the camera focal length. a x ,a y ,a z It is the normal vector component of the plane of the object being measured. p x ,p y ,p z These are the spatial coordinates of the origin of the calibration plate.

[0118] Spatial intersection calculation: The calculation of the spatial coordinates of the positioning point can essentially be reduced to solving the problem of finding the intersection of two spatial straight lines: the laser emission path (i.e., the outgoing ray) and the receiving path (i.e., the incident ray).

[0119] Since the origin of the laser beam has no effect on the calculation of the positioning point coordinates, its expression can be simplified to a straight line when deriving it. For any straight line in space, its expression can be determined by knowing two points on it. Therefore, it is only necessary to take two images of the positioning point at different locations and calculate the spatial coordinates using the aforementioned method to determine the expression of the straight line.

[0120] Considering the potential for errors during measurement, this invention fuses the spatial coordinates calculated from multiple images and uses the least squares method to fit the expression of the straight line:

[0121] (1) First calculate the centroid of all positioning points: Suppose there are n three-dimensional points with coordinates as Its centroid .

[0122] (2) Centralized positioning point: Translate each point to a coordinate system with the centroid as the origin. .

[0123] (3) Construct the covariance matrix: Construct the matrix using the centered points. (dimension is) ), calculate the covariance matrix .

[0124] (4) Solving for the principal direction: The eigenvector corresponding to the largest eigenvalue of the covariance matrix is ​​the optimal direction of the line (maximizing the variance of the data projection while minimizing the sum of squared distances from points to the line). For the covariance matrix... Perform eigenvalue decomposition ,in: The feature vector is the direction vector of the fitted line; The corresponding eigenvalue represents the variance of the data in that direction.

[0125] (5) Then the parametric equation of the incident line can be determined: .

[0126] In the camera coordinate system, all incident rays converge at the optical center. Therefore, the starting point in the parametric equation of the incident ray is the optical center. Since the camera coordinate system is established with the optical center as the origin, and The optical axis coincides with the camera's optical axis, therefore the coordinates of the optical center are: Points on the normalized plane Corresponding to a three-dimensional point in the camera coordinate system, the direction vector originating from the optical center (origin) is the coordinate of that point. Then the parametric equation of the outgoing ray can be expressed as: ,in: For parameters; Direction vector.

[0127] Output the 3D coordinates of the positioning point: Calculate the shortest distance line between two straight lines and take the projection point of this line onto the outgoing ray as the spatial coordinates of the positioning point. For two skew lines, the incident ray and the outgoing ray: .set up , Let be the feet of the perpendiculars to the incident and outgoing rays on the common perpendicular line, respectively. According to the condition for the common perpendicular: Solving the two equations simultaneously, we can find the solution:

[0128] (12)

[0129] parameters Substitute the value Then, the approximate spatial coordinates of the positioning point can be solved, realizing accurate spatial positioning of the laser point at any distance.

[0130] like Figure 2 As shown, the laser-based image correction method proposed in this invention, further illustrated by an example of measuring the size of wall defects, includes:

[0131] Input positioning point spatial coordinates: Calculate the spatial coordinates of any positioning point obtained by the laser positioning spatial measurement method, and execute the calculation in conjunction with the three-dimensional coordinates of the positioning point output by this method.

[0132] Determine the plane equation of the object being measured: Treat the wall surface where the defect is located as a plane, and its plane equation generally takes the form of: In the formula: It is the normal vector of the plane. This is a constant term.

[0133] Coordinate Correction: This study projects at least four positioning points during spatial positioning. Due to potential errors in point measurement or unevenness of the actual wall surface, these positioning points may not be coplanar. Therefore, this invention employs a minimum projection distance condition to perform plane fitting on these points to obtain the optimal plane.

[0134] Assuming a total of Given a set of spatial points, first calculate the centroid coordinates of these points. The coordinates of these points are centered, and a matrix is ​​constructed. (dimension is) The normal vector of the fitted plane is calculated using singular value decomposition. In the formula: for An orthogonal matrix is ​​called a left singular vector matrix; for A diagonal matrix, the diagonal elements are called singular values; for An orthogonal matrix is ​​called a right singular vector matrix. The right singular vector matrix... The last column is the normal vector of the plane. Substitute the centroid coordinates This yields a solvable expression for the fitted plane. After determining the expression for the wall surface, the coordinates of the positioning points need to be corrected, i.e., the spatial positioning points... The corrected coordinates of the positioning point when projected onto a plane. calculate:

[0135] (13)

[0136] (14)

[0137] Calculate the perspective transformation matrix: Combine with the appendix Figure 4 This invention proposes a perspective correction method based on fixed reference points: First, an image of the positioning points is acquired; then, two positioning points with relative positions in the image are fixed (e.g., ...). Figure 4 The red dot in and Finally, perspective transformation is performed using these two points as reference points to minimize the distortion of the images before and after the transformation. Based on the actual spatial distance between the positioning points, the coordinates of these transformed images can be calculated using geometric constraints.

[0138] For the location points on the image and Its image distance :

[0139] (15)

[0140] Corresponding spatial coordinates and actual distance :

[0141] (16)

[0142] Assume the numbers of these four positioning points The benchmark point is and The image distance between these two points and actual distance Using this as a reference, calculate the image distance between the positioning points after perspective transformation: .

[0143] Combination Figure 5 Schematic diagram illustrating the principle of calculating the coordinates of a positioning point image. (See diagram for example.) Figure 5 As shown in (a), with points For example, the distance between the point and the reference point after perspective transformation is calculated. and By combining the image coordinates of the two reference points, the coordinates after perspective transformation can be accurately solved. .like Figure 5 As shown in (b), if its There are two possible solutions, located on the line connecting the reference points. On both sides, we can determine the vectors before and after the transformation by judging their positions. and The selection is based on whether the signs of the cross product results are consistent.

[0144] After determining the transformation and Then, using the positional relationship between the four positioning points in the image, the perspective transformation matrix is ​​obtained through the perspective transformation relationship of the image. :

[0145] (17)

[0146] The perspective transformation matrix calculation formula is based on the homography model and is used to correct geometric distortions caused by camera tilt. (u,v) are the pixel coordinates of the original image. (u′,v′) are the coordinates of the image after perspective transformation. h 11 to h 32 The parameters of the perspective transformation matrix Hp are obtained by fitting using the least squares method.

[0147] Pixel to Physical Size Conversion: After image correction, to establish the conversion relationship between pixel size and actual physical size, pixel equivalents need to be calculated. Using... and The pixel equivalent is calculated by the ratio of the pixel distance to the spatial distance between two reference points. The image distance between the reference points is then calculated. and compare it with the actual physical distance Divide to calculate the pixel equivalent of the corrected image. .

[0148] (18)

[0149] Image correction complete: The obtained image transformation parameters are used to perform geometric correction on the original image, preserving its image details and texture features, and generating an image containing accurate geometric information.

[0150] Example 8:

[0151] This embodiment provides an application of the method described in any one of Embodiments 1-6 in engineering structure inspection. The method is used for long-term deformation monitoring or surface defect detection of engineering structures. In the field or high-risk environments, laser positioning points are projected onto the structural surface. Spatial coordinate calculations and plane fitting are used to track structural displacement changes or detect surface defects, and historical data is combined to achieve trend analysis. An image correction step compensates for perspective errors, outputting accurate scale images to support automated early warning systems for preventative maintenance and safety assessments. The specific implementation process is as follows:

[0152] The measurement method proposed in this invention is applied to the measurement of crack size in engineering structures. An experiment is designed, using a 2×2 grid square target, which is widely used in traditional measurements, as a reference (e.g., Figure 6 As shown), the accuracy of the laser-based spatial measurement and image correction method proposed in this invention is quantitatively evaluated. The target is composed of a standard square unit with a side length of 150 mm, and its theoretical geometric characteristics are as follows: adjacent sides AB and AC are both 150 mm in length, and the diagonal AD is 212.1 mm in length (i.e., ...). The experiment used a SONY Alpha 6700 camera as the imaging device, with a sensor size of [mm]. The effective pixels are The camera lens was a SONY SEL55210, and the experiment was conducted with a fixed focal length of 55 mm.

[0153] The experiment set up two typical measurement scenarios to verify the robustness of the method:

[0154] Oblique measurement condition: Collect target plane data under the conditions of 2 m measurement distance and 45° measurement angle;

[0155] Vertical measurement conditions: Data is collected at a measurement distance of 4 m and a measurement angle of 90°.

[0156] After correcting the perspective distortion of the original data under two working conditions using the method proposed in this invention, the key geometric parameters of the target (measured values ​​of the side lengths of AB, AC, and AD) are extracted and compared with the theoretical values.

[0157] The accuracy evaluation index adopts a dual perspective of absolute error and relative error:

[0158] Absolute error:

[0159] Relative error:

[0160] The formulas for calculating absolute and relative errors are the same as those for evaluating standard errors, derived from metrological principles. Lmeasured is the measured length value. Ltheoretical is the theoretical length value. ΔL is the absolute error, representing the deviation between the measured and theoretical values. δ is the relative error, expressed as a percentage of accuracy.

[0161] Based on the above, the experimental procedure specifically includes:

[0162] Experimental Procedure 1: Oblique Measurement Condition

[0163] S1: Attach the target to the experimental wall and place the measuring device 2 m away from the wall at a 45° angle.

[0164] S2: Turn on the laser and project four laser positioning points onto the structural cracks on the wall. Use a camera to capture images of the target (e.g., ...). Figure 7 (a) shows that a multi-feature collaborative recognition algorithm is used to find the coordinates of the laser positioning point in the image (e.g., as shown in (a)). Figure 7 (b) is shown.

[0165] S3: Using the calibrated laser ray spatial equation and camera intrinsic parameters, calculate the spatial coordinates of each positioning point (e.g., ...). Figure 7 (c)).

[0166] S4: Calculate the coordinates of each positioning point after perspective correction by utilizing the correspondence between the actual physical distance of the positioning points and the pixel distance in the image, and calculate the perspective transformation matrix. Applying the perspective transformation matrix to the image yields the corrected image (e.g., ...). Figure 7 (d)).

[0167] S5: Divide the image distance between the corrected positioning points 0 and 3 by the spatial distance to obtain the pixel equivalent of the corrected image, s = 0.1861 mm / pixel.

[0168] S6: Identify the coordinates of the target center in the corrected image ( Figure 7 (e)), and calculate the pixel lengths of the three line segments AB, AC, and AD, such as Figure 7 As shown in (f).

[0169] S7: Calculate the measured length of each side by combining the pixel equivalent, compare it with the actual length, and calculate the absolute error and relative error respectively, as shown in Table 1.

[0170] Table 1 Comparison of Measurement Results

[0171] line segment Actual length (mm) Pixel length Measure the length (mm) Absolute error (mm) Relative error (%) AB 150.0 804.6 149.7 0.3 0.2 AC 150.0 795.3 148.0 2.0 1.3 AD 212.1 1191.7 221.7 9.6 4.5

[0172] Experimental Procedure 2: Vertical Measurement Condition

[0173] S1: Attach the target to the experimental wall and place the measuring device at a distance of 4 m from the wall and at a 90° angle.

[0174] S2: Turn on the laser and project four laser positioning points onto the structural cracks on the wall. Use a camera to capture images of the target (e.g., ...). Figure 8 (a) Using a multi-feature collaborative recognition algorithm, the coordinates of the laser positioning point (e.g., ...) are found in the image. Figure 8 (b)).

[0175] S3: Using the calibrated laser ray spatial equation and camera intrinsic parameters, calculate the spatial coordinates of each positioning point (e.g., ...). Figure 8 (c)).

[0176] S4: Calculate the coordinates of each positioning point after perspective correction by utilizing the correspondence between the actual physical distance of the positioning points and the pixel distance in the image, and calculate the perspective transformation matrix. Applying the perspective transformation matrix to the image yields the corrected image (e.g., ...). Figure 8 (d)).

[0177] S5: Divide the image distance between the corrected positioning points 0 and 3 by the spatial distance to obtain the pixel equivalent of the corrected image, s = 0.2611 mm / pixel.

[0178] S6: Identify the coordinates of the target center in the corrected image ( Figure 8 (e)), and calculate the pixel lengths of the three line segments AB, AC, and AD, such as Figure 8 As shown in (f).

[0179] S7: Calculate the measured length of each side by combining the pixel equivalent, compare it with the actual length, and calculate the absolute error and relative error respectively, as shown in Table 2.

[0180] Table 2 Comparison of Measurement Results

[0181] line segment Actual length (mm) Pixel length Measure the length (mm) Absolute error (mm) Relative error (%) AB 150.0 548.0 143.0 7.0 4.7 AC 150.0 547.0 142.8 7.2 4.8 AD 212.1 790.1 206.3 5.7 2.7

[0182] The above experiments verified the measurement reliability of the method proposed in this invention under conditions without a physical target, and compared the deviations between the measurement results and actual values ​​under different distances and angles. The results show that: for the oblique measurement condition (2 m distance, 45° angle), the maximum relative error is 4.5%; for the vertical measurement condition (4 m distance, 90° angle), the maximum relative error is 4.8%. The error distribution indicates that the method proposed in this invention has consistent measurement accuracy (relative error <5%) under the two typical conditions, meeting the needs of measuring wall crack defects in practical engineering.

Claims

1. A spatial measurement and image correction method based on laser positioning, characterized in that: Includes the following steps: S1) Project multiple laser positioning points onto the surface of the object being measured using a laser; use an industrial camera to acquire digital images containing the laser spots; S2) A multi-feature collaborative recognition algorithm is used to identify laser spot in the acquired image; after recognition, the sub-pixel-level center image coordinates of the spot are calculated using the gray-level weighted centroid method; the multi-feature collaborative recognition algorithm includes color feature selection, mask optimization, brightness feature selection, and shape feature selection; the shape feature selection is based on the discrete coefficient; the formula for calculating the discrete coefficient of the candidate region is as follows: In the formula, Dc represents the discrete coefficient of the candidate region; The variance of the distance from each pixel within the candidate region to the region center is represented by N; N represents the number of pixels in the region; the filtering criteria are set as follows. Candidate regions that meet this condition will be identified and marked as valid laser spots; S3) Based on the pre-calibrated system parameters, the image coordinates are converted into three-dimensional spatial coordinates; the spatial intersection calculation model models the laser emission path as a first spatial straight line and the camera imaging optical path as a second spatial straight line; by solving the common perpendicular of the two straight lines, the foot of the perpendicular is used as the three-dimensional coordinate of the laser positioning point; S4) Based on the three-dimensional spatial coordinates of multiple positioning points, the singular value decomposition algorithm is used to fit the plane equation of the object under test; S5) Based on the correspondence between the image coordinates and spatial coordinates of the positioning points, calculate the perspective transformation matrix; calculate the pixel equivalent to realize the conversion from pixel size to physical size; S6) Apply the perspective transformation matrix to perform geometric correction on the original image and output a scale-accurate corrected image.

2. The spatial measurement and image correction method based on laser positioning according to claim 1, characterized in that: In step S1), the laser is a green light source laser; the laser projection is controlled by a two-dimensional galvanometer system to make the positioning points evenly distributed according to a preset pattern; the preset pattern includes a rectangular array, a circular array, or a cross-shaped distribution; the industrial camera has a pixel count of no less than 5 million; the camera's focal length and exposure parameters are adjusted according to the environment.

3. The spatial measurement and image correction method based on laser positioning according to claim 1, characterized in that: In step S2), the color feature selection is based on the HSV color space; the flood filling algorithm is used to fill the mask holes formed by the oversaturation of the spot center to obtain a complete spot area mask; the HSV threshold range for color feature selection is: S∈[50,255], V∈[50,255], and the H value takes any value of [0,180] depending on the color of the laser source.

4. The spatial measurement and image correction method based on laser positioning according to claim 1, characterized in that: In step S3), the parametric equation of the first spatial line is: The parametric equation of the second spatial line is: ; The formula for calculating the coordinates of the foot of the common perpendicular on the second spatial line is: Where p(s) and p(t) represent the coordinate vectors of points on the first spatial line and the second spatial line, respectively; p0 is the known starting point coordinate vector on the first spatial line; v is the direction vector of the first spatial line; d is the direction vector of the second spatial line; t and s represent the common perpendicular parameters, used to calculate the position of the perpendicular foot point on the two lines.

5. The spatial measurement and image correction method based on laser positioning according to claim 1, characterized in that, Step S4) specifically includes the following sub-steps: S4.1) Calculate the centroid of the point set, construct the covariance matrix and perform SVD decomposition to obtain the normal vector; S4.2) Perform projection correction on the coordinates to eliminate measurement errors; project the point p=(x,y,z) onto the fitting plane and correct the coordinates p′=(x′,y′,z′); S4.3) Select a reference point.

6. The spatial measurement and image correction method based on laser positioning according to claim 5, characterized in that: In step S4.2), when performing projection correction, the spatial coordinates calculated from multiple images are fused, and the least squares method is used to fit the expression of the line to improve the calculation accuracy.

7. The spatial measurement and image correction method based on laser positioning according to claim 1, characterized in that: In step S5), two relative positioning points in the fixed image are used as reference points. The image distance and actual spatial distance from the reference points to the other positioning points are used as references. The coordinates of the positioning points after perspective transformation are derived through geometric constraints, thereby solving the perspective transformation matrix.

8. An application of the method as described in any one of claims 1 to 7 in industrial testing, characterized in that: The method is used for non-contact dimensional measurement and defect detection of industrial parts; by projecting laser positioning points onto the surface of the parts, combined with multi-feature collaborative recognition and spatial intersection calculation, it achieves sub-millimeter level precision geometric parameter quantization.

9. An application of the method described in any one of claims 1 to 7 in engineering structure inspection, characterized in that: The method is used for long-term deformation monitoring or surface defect detection of engineering structures; in the field or high-risk environment, laser positioning points are projected onto the surface of the structure; spatial coordinate calculation and plane fitting are used to track structural displacement changes or detect surface defects, and trend analysis is achieved by combining historical data; The image correction step compensates for perspective errors, outputs accurate scale images, and supports automated early warning systems for preventative maintenance and safety assessments.

Citation Information

Patent Citations

  • Scale factor determination method in monocular vision reconstruction based on dot structured optical ranging

    CN105184857A