A component size measurement method and system based on three-dimensional reconstruction
By processing 3D point cloud data and performing iterative calculations, and simulating rigid contact, the problem of the reference surface being pulled down by the concave area in 3D measurement technology was solved, thus achieving accuracy and stability in component size measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHAANXI NITYA NEW MATERIALS TECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-16
AI Technical Summary
Existing 3D measurement technology cannot accurately simulate physical rigid contact when dealing with components with rough surfaces, leading to measurement deviations. In particular, the reference plane is pulled down by the recessed area, affecting the accuracy of component dimensions, flatness, and perpendicularity.
By acquiring three-dimensional point cloud data of the component surface, calculating local neighborhood index and local protrusion value, updating the reference surface parameters using iterative calculation and fitting weights, simulating rigid contact, distinguishing effective support points from invalid interference points, and ensuring that the reference surface accurately fits the component surface contour.
It improves the accuracy and stability of component size measurement, eliminates the influence of recessed areas on measurement, and ensures the objectivity and consistency of length, width, flatness, and perpendicularity.
Smart Images

Figure CN121937511B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology. More specifically, this invention relates to a method and system for measuring component dimensions based on three-dimensional reconstruction. Background Technology
[0002] In the fields of prefabricated buildings and industrial manufacturing, the dimensional accuracy of precast concrete components, large castings and forgings, and other components directly determines the assembly quality and structural safety. With the popularization of 3D laser scanning and photogrammetry technology, non-contact automatic measurement based on 3D point clouds has gradually replaced traditional tape measure and straightedge measurement, becoming the mainstream trend in the industry. This technology collects high-density point cloud data of the component surface, uses fitting algorithms to reconstruct the geometric surface of the component, and then calculates key indicators such as length, width, flatness, and perpendicularity.
[0003] However, existing 3D measurement technologies have significant fundamental flaws when dealing with components with rough surfaces. Taking precast concrete components as an example, their surface micromorphology has typical binary characteristics: on the one hand, there are protrusions of hard aggregates that form the skeleton, and on the other hand, there are depressions caused by the rupture of air bubbles. Traditional point cloud processing algorithms usually use the least squares method to fit the reference surface. The core logic of this algorithm is to minimize the sum of the squares of the distances from all data points to the fitting plane. This mathematical processing implies an assumption that all deviations are regarded as random noise that follows a Gaussian distribution, and that positive deviations representing protrusions and negative deviations representing depressions are given equal weight.
[0004] In actual physical testing scenarios, quality inspectors use rigid rulers or inspection platforms to measure components. Rigid measuring tools follow the physical law of non-penetration, meaning that the tool can only contact the highest point of the component surface, i.e., the aggregate protrusion, while it can be suspended over the low-lying areas, i.e., the pore depressions. In contrast, the reference surface fitted by the least squares method is actually a flexible average surface. It will be pulled into the interior of the component by the data of the pore depressions, causing the fitted plane to be lower than the actual physical contact boundary.
[0005] The discrepancy between the mathematical average and the physical contact leads to serious measurement biases. First, the indentation of the reference surface causes the measured length and width dimensions of the component to be smaller. Second, for flatness testing, including pores and depressions in the error range leads to inflated flatness values, which cannot reflect the true installation flatness of the component. Finally, the attitude deflection of the reference surface directly affects the determination of verticality. Although existing point cloud filtering algorithms can remove some outliers, they are difficult to distinguish between effective support protrusions and invalid surface depressions in principle, and cannot accurately simulate the unidirectional bonding process of rigid planes under the action of gravity or adsorption force. Therefore, there is an urgent need for a component size measurement method that can simulate physical rigid contact and has the ability to resist depression interference. Summary of the Invention
[0006] To address the technical problem that existing measurement techniques are affected by surface depressions, which cause the fitting reference surface to deviate from the physical rigid contact state and thus affect measurement accuracy, the present invention provides solutions in the following aspects.
[0007] In a first aspect, the present invention provides a method for measuring the dimensions of a component based on three-dimensional reconstruction, comprising: acquiring three-dimensional point cloud data of the component surface and performing centroidalization preprocessing; acquiring a local neighborhood index based on the preprocessed data; retrieving a set of neighboring points for each data point in the three-dimensional point cloud data based on the local neighborhood index; calculating a local convexity value for each data point based on the set of neighboring points; acquiring a fitting function based on the local convexity value and the directed distance from the data point to the target reference surface; solving the fitting function using an iterative calculation method, determining the fitting weight of each data point based on the directed distance from the data point to the current reference surface and the local convexity value during the iteration process; updating the reference surface parameters using the fitting weights until convergence to obtain an optimal reference surface; projecting all data points along the normal direction of the optimal reference surface onto the optimal reference surface to obtain the geometric projection of the component; and completing the component dimension measurement based on the optimal reference surface and the geometric projection.
[0008] This invention acquires three-dimensional point cloud data of the component surface and calculates local protrusion values. It obtains a fitting function that includes blocking coefficient and fitting coefficient, and uses an iterative calculation method to determine the fitting weight of data points and update the reference surface parameters. This simulates the characteristic of a physical rigid plane only contacting but not penetrating the component surface at the numerical calculation level, avoiding the surface depression area from pulling the reference surface into the component. This improves the consistency between the component size measurement results based on three-dimensional reconstruction and the physical contact measurement results.
[0009] Preferably, the local protrusion value satisfies the expression: In the formula, Indicates the first Local bulge values for each data point; Represents the neighborhood point set The normal vector of the local fitting plane points outward from the component; Indicates the first The coordinate vector of each data point; Represents the neighborhood point set The geometric center coordinate vector; Represents the neighborhood point set The residual variance relative to its local fitting plane; This represents the roughness attenuation parameter; Represents the dot product operation of vectors; This represents the function that takes the maximum value. This represents an exponential function with the natural constant e as its base.
[0010] This invention evaluates the degree of local protrusion based on the residual variance and normal vector direction of the neighborhood point set relative to the local fitting plane. It uses roughness attenuation parameters to suppress the influence of high-frequency noise and surface burrs, thereby distinguishing aggregate protrusions and pore depressions on the component surface. This ensures that only data points with physical support characteristics participate in the reference plane fitting, improving the accuracy of micro-morphological feature identification in component size measurement.
[0011] Preferably, the fitting function satisfies the expression: In the formula, Representing the reference plane The total fit deviation; Indicates the blocking coefficient; Indicates the fit coefficient; Represents the unit step function; Indicates the first Data points to the reference plane The directed distance is defined as negative on the solid side of the component and positive on the outside; Indicates the first Local bulge values for each data point; This represents the roughness attenuation parameter.
[0012] Preferably, updating the reference surface parameters using the fitting weights includes: performing weighted statistics on the three-dimensional point cloud data using the fitting weights to construct a weighted covariance matrix; solving the weighted covariance matrix to obtain the updated reference surface normal vector; and calculating the updated reference surface position in combination with the fitting weights.
[0013] Preferably, the fitting weights satisfy the expression: In the formula, Indicates the first In the nth iteration Fitting weights for each data point; Indicates the first In the nth iteration Data points to the reference plane The directed distance; Indicates the blocking coefficient; Indicates the fit coefficient; Indicates the first Local bulge values for each data point; The roughness attenuation parameter is represented; the reciprocal of the depth measurement error variance of the 3D scanning equipment during the calibration stage is extracted, and the reciprocal is multiplied by the diagonal length of the geometric bounding box of the 3D point cloud data of the component as the blocking coefficient; the fitting coefficient is obtained by: statistically analyzing the ratio of the number of data points with local convexity values greater than 0 in the 3D point cloud data to the total number of data points, and using an exponential function with the natural constant as the base to calculate the fitting coefficient.
[0014] This invention assigns differentiated fitting weights based on the positional relationship of data points relative to the current reference plane during the iteration process. Points located inside the reference plane are given a blocking coefficient to generate an extrapolation effect, points located in the depression are given zero weight to eliminate the pull-down effect, and aggregate protrusions are given a weight including a fitting coefficient to maintain contact. Thus, the simulation of the rigid ruler fitting process is achieved through weight adjustment, ensuring that the optimal reference plane accurately falls on the solid contour of the component surface.
[0015] Preferably, obtaining the updated reference surface normal vector and calculating the updated reference surface position using the fitting weights includes: using the fitting weights to perform a weighted average of the coordinate vectors of all data points to obtain a weighted centroid, and using the weighted centroid as the updated reference surface position; performing eigenvalue decomposition on the weighted covariance matrix, selecting the eigenvector corresponding to the smallest eigenvalue, and determining the eigenvector that satisfies the constraint condition as the updated reference surface normal vector, wherein the constraint condition is: ;in, Indicates the first In the nth iteration Fitting weights for each data point; Indicates the first The coordinate vector of each data point; Indicates the first The reference plane normal vector for the next iteration; Indicates the first The weighted centroid of the next iteration.
[0016] This invention introduces constraints during the update of reference surface parameters, so that the algebraic sum of the moments of all data points involved in the support relative to the weighted centroid approaches a state of equilibrium. This prevents the reference surface from tilting or flipping unexpectedly due to local extreme convex data points, ensuring the stability of the optimal reference surface in space and the objectivity of subsequent verticality and flatness error assessments.
[0017] Preferably, the component size measurement is completed based on the optimal reference plane and geometric projection, including: calculating the minimum bounding rectangle for the geometric projection of the component, and using the length of the long side and the length of the short side of the minimum bounding rectangle as the length and width of the component; calculating the flatness error and perpendicularity error of the component surface, and completing the component size measurement.
[0018] Preferably, the calculation of the flatness error and perpendicularity error of the component surface includes: calculating the directed distances from all data points to the optimal reference plane, selecting the sum of the absolute values of the maximum positive deviation and the maximum negative deviation as the flatness error of the component surface; extracting the point cloud data of the side of the component and fitting the side plane, calculating the angle between the normal vector of the side plane and the normal vector of the optimal reference plane, and using the difference between the angle and 90 degrees as the perpendicularity error of the component surface.
[0019] Preferably, obtaining the local neighborhood index includes: obtaining a kd-tree index as a local neighborhood index based on the preprocessed data.
[0020] This invention uses a kd-tree index to obtain data after centroidal preprocessing, providing a fast access path for neighborhood search of any data point in massive 3D point cloud data, reducing computational redundancy caused by global traversal, and improving the data processing speed of the entire component size measurement process while ensuring the coverage of local neighborhood feature calculation.
[0021] Secondly, the present invention provides a component size measurement system based on three-dimensional reconstruction, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned component size measurement method based on three-dimensional reconstruction is implemented.
[0022] By adopting the above technical solution, a computer program for measuring component dimensions based on three-dimensional reconstruction is generated and stored in a memory so that it can be loaded and executed by a processor. This allows for the creation of a terminal device based on the memory and processor, making it convenient to use.
[0023] The beneficial effects of this invention are as follows:
[0024] This invention distinguishes effective support points from invalid interference points based on the local convexity values of three-dimensional point cloud data. It uses a fitting function that includes blocking coefficients and fitting coefficients to simulate the physical characteristics of one-way contact of a rigid plane. In the iterative calculation, it assigns high weight to the penetration points and ignores surface depression points, thereby avoiding the reference surface from sinking into the pore depression area inside the component and improving the consistency between the component size measurement reference and the physical rigid contact state.
[0025] This invention combines the residual variance of the neighborhood point set with the roughness attenuation parameter to evaluate the degree of local protrusion. In the process of solving the optimal reference surface, a virtual moment balance constraint is introduced. The constraint is used to limit the fluctuation of the reference surface attitude with local noise, thereby preventing the reference surface from tilting unexpectedly due to individual extreme aggregate protrusions or uneven data distribution, and ensuring the objectivity and stability of the component size measurement results.
[0026] This invention obtains the geometric projection of a component based on the optimal reference plane that simulates rigid contact. It uses the minimum bounding rectangle of the geometric projection to evaluate the length and width dimensions, and evaluates the flatness and perpendicularity based on the extreme value of the directed distance from the data point to the reference plane and the angle between the normal vector and the extreme value. This eliminates the influence of invalid surface depressions in the measurement results and solves the problems of smaller length and width dimensions and artificially high flatness errors caused by the indentation of the reference plane in traditional methods. Attached Figure Description
[0027] Figure 1This is a flowchart illustrating a component size measurement method based on three-dimensional reconstruction according to the present invention;
[0028] Figure 2 This is a schematic diagram illustrating the local distribution of protrusion values of data points on the surface of a component;
[0029] Figure 3 This is a schematic diagram of a two-dimensional cross-section showing the fitting of a reference plane on the surface of a component. Detailed Implementation
[0030] 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, not all, of the embodiments of the present invention. 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.
[0031] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0032] This invention discloses a method for measuring component dimensions based on three-dimensional reconstruction, referring to... Figure 1 This includes steps S1-S5:
[0033] S1. Obtain the three-dimensional point cloud data of the component surface and perform centroidal preprocessing. Obtain the local neighborhood index based on the preprocessed data.
[0034] It should be noted that when measuring large precast concrete components in industrial settings, the original 3D point cloud data coordinates are typically large. Directly performing high-order calculations can easily introduce floating-point truncation errors, affecting measurement accuracy. To eliminate these numerical errors and establish a unified computational reference system, this invention establishes a local coordinate system with the component's geometric centroid as the origin. Since this invention requires frequent queries of the microscopic geometric features surrounding each data point, obtaining a kd-tree index provides an efficient spatial access mechanism, avoiding the enormous time consumption caused by brute-force searches.
[0035] Specifically, the present invention acquires three-dimensional point cloud data of the component surface using a high-precision three-dimensional scanning device; calculates the geometric centroid of the three-dimensional point cloud data, subtracts the coordinates of the geometric centroid from the coordinates of all data points to achieve a centralized translation of the local coordinate system; and obtains a kd-tree index based on the translated three-dimensional point cloud data.
[0036] S2. Based on the local neighborhood index, retrieve the neighborhood point set of each data point in the 3D point cloud data, and calculate the local convexity value of each data point according to the neighborhood point set.
[0037] It should be noted that the surface micromorphology of precast concrete components exhibits a significant duality: one type consists of aggregate protrusions formed by rigid aggregates, which act as physical support points during component storage or installation; the other type consists of pore depressions formed by the rupture of surface air bubbles, which remain suspended during physical contact. Traditional planar fitting algorithms do not distinguish between these two types of features, causing the fitted reference plane to be lowered by the pore depression data, thus becoming embedded within the component. This invention identifies the protruding effective support points through geometric analysis and assigns them higher computational weights, while forcibly ignoring the recessed invalid points.
[0038] Specifically, for the third point cloud data For each data point, its radius is retrieved using a kd-tree index. Neighborhood point set within the range ; Calculate the neighborhood point set The local fitting plane and geometric center are obtained, and then the local convexity value is obtained.
[0039] It should be noted that the radius... The preferred value range is 5mm to 10mm. This value is based on the typical particle size of coarse aggregate on the surface of concrete components, ensuring... Slightly larger than the average radius of the aggregate, this effectively captures the complete geometric features of the aggregate, avoiding interference from microscopic noise due to an excessively small radius, or ignoring local undulations due to an excessively large radius. This embodiment... If 8mm is selected, the implementer can choose the radius according to the actual situation. The value of .
[0040] More specifically, the local protrusion value satisfies the expression:
[0041]
[0042] In the formula, Indicates the first Local bulge values for each data point; Represents the neighborhood point set The normal vector of the local fitting plane points outward from the component; Indicates the first The coordinate vector of each data point; Represents the neighborhood point set The geometric center coordinate vector is obtained by the arithmetic mean of the coordinate vectors of all data points in the neighborhood point set; Represents the neighborhood point set The residual variance relative to its local fitting plane; This represents the roughness attenuation parameter, set to twice the standard deviation of scanner measurement noise; Represents the dot product operation of vectors; This represents the function that takes the maximum value. This represents an exponential function with the natural constant e as its base.
[0043] In the formula, the projection term Calculated data points The distance beyond the neighborhood average height in the normal direction. A positive value if the data point is an aggregate protrusion; a negative value if the data point is located in a pore depression; cutoff function. A crucial one-way screening was performed: any data point with a negative calculation result, i.e., a stomatal depression below the surrounding average height, had its local convexity value forcibly set to 0. This means that in subsequent datum fitting, data points at these stomatal depressions will be completely ignored and will no longer have the ability to lower the datum; smoothing term A judgment on surface quality was introduced. If a local area is very rough and messy, then... If the value is large, it indicates that the aggregate protrusion may be measurement noise, and the function value approaches 0, thus reducing its weight; if the surface of the aggregate protrusion is smooth and rounded, which is consistent with the characteristics of aggregate, then its high weight is retained. Roughness attenuation parameter used to suppress high-frequency measurement noise and the effects of surface instability and burrs. This serves as a soft threshold for noise. In this embodiment, when the local neighborhood residual variance of a certain convex point... much smaller When the surface is smooth and stable, this term approaches 1, retaining its high weight as a support point; when Approaching or exceeding At that time, there were violent noise fluctuations on the surface, and this item quickly approached 0, thus eliminating the false high point.
[0044] For example, Figure 2 This is a schematic diagram of the local protrusion value distribution of data points on the component surface. The color bars represent the magnitude of the local protrusion values. The red areas represent effective support points with high protrusion values, and the blue areas represent invalid interference points with protrusion values of zero. This distribution shows that the algorithm successfully identified aggregate areas capable of withstanding physical contact.
[0045] S3. Based on the local convexity value and the directed distance from the data point to the reference surface to be determined, obtain the fitting function.
[0046] It should be noted that in real-world physical testing scenarios, the measurement reference surface is typically a rigid testing platform or ruler. When the component surface contacts the rigid platform, the principle of physical non-penetration applies: the component body can never penetrate into the platform, meaning the penetrating side should experience significant resistance; however, the component surface can be suspended above the platform, meaning the suspended side experiences almost no force. Traditional least squares methods treat positive and negative deviations equally, which actually simulates the process of a flexible membrane bonding to a surface, rather than the process of a rigid plate contacting a surface. This step obtains a fitting function to simulate the physical process of a rigid plane bonding to the component surface under the influence of weak gravity or adsorption forces.
[0047] Specifically, let the parameters of the reference surface to be solved be... , including normal vector and distance Define data points The directed distance to the reference plane is The component's solid side is defined as negative, and its exterior side as positive; the fitting function is then obtained.
[0048] More specifically, the fitting function satisfies the expression:
[0049]
[0050] In the formula, Representing the reference plane The total fit deviation; Indicates the blocking coefficient; Indicates the fit coefficient; Represents the unit step function; Indicates the first Data points to the reference plane The directed distance is defined as negative on the solid side of the component and positive on the outside; Indicates the first Local bulge values for each data point; This represents the roughness attenuation parameter.
[0051] In the formula, The rigid body blocking effect was simulated. When When this happens, it means the data point has penetrated to the inside of the reference plane, at which point the unit step function... Activate, triggering a very high blocking coefficient. This incurs a huge mathematical error cost, forcing the optimization algorithm to shift the baseline outward until all penetration is eliminated. The contact adhesion effect was simulated. When This means that the data points are suspended above the reference plane, at which point a smaller fitting coefficient is introduced. and local bulge value A weak pulling force determined by both factors. For data points at the pore depression, due to... The data points have been set to 0, so even if these data points are suspended, there will be no error cost. This ensures that the reference surface will only be attracted by the aggregate protrusions, while ignoring the existence of pores and depressions, thus correctly simulating the physical contact state.
[0052] It should be noted that the blocking coefficient It is recommended to set in to Between these two values, if the value is too small, insufficient rigidity will cause the reference surface to sink; if it is too large, it will easily lead to divergence in numerical calculations. In this embodiment, the value is... Balancing rigid constraints with computational stability; fit coefficient It is recommended to set in to Between these two values, if the value is too large, it can easily lead to instability in the attitude of the reference plane; if it is too small, the convergence speed is slow. In this embodiment, the value is chosen as follows: To simulate a moderate gravity-based fit.
[0053] S4. Solve the fitting function using an iterative calculation method. During the iteration process, determine the fitting weight of each data point based on the directed distance from the data point to the current reference surface and the local convexity value. Update the reference surface parameters using the fitting weights until convergence to obtain the optimal reference surface.
[0054] It should be noted that finding the extreme value of the fitted function is a nonlinear process, and the result is difficult to obtain in one step. During the fitting process, if there are individual extreme aggregate protrusions on the surface of the component, they may act like the fulcrum of a seesaw, causing the reference plane to tilt unstablely. To solve this problem, this invention adopts an iterative weighted calculation method and introduces virtual moment balance constraints in the iteration to ensure that the fitted reference plane not only fits the aggregate protrusions but is also mechanically stable and will not be skewed by individual noise points at the edges.
[0055] Specifically, the initial fitting plane of the point cloud is calculated using the least squares method and used as the reference plane parameter for the 0th iteration to prevent the iteration from getting trapped in a local optimum; the reference plane parameter is updated iteratively, and the iteration is repeated in the 0th iteration. In each iteration, the fitting weight for each data point is calculated. The weighted covariance matrix is obtained using the fitted weights, and the updated reference surface normal vector is then solved. and location During the solution process, constraints are introduced, and the iterative process is repeated until the angle between the normal vectors of two consecutive iterations is less than a preset angle threshold (e.g., ...). (rad), and the change in position is less than a preset distance threshold (e.g., 1 d). (mm), stop iteration and output the optimal reference plane. Project all data points onto the optimal reference plane. Calculate the length and width dimensions of the projected profile; calculate the maximum deviation of the data points from the optimal reference plane as the flatness error; calculate the angle between the fitted plane of the adjacent side and the optimal reference plane as the perpendicularity.
[0056] More specifically, the fitting weights satisfy the expression:
[0057]
[0058] In the formula, Indicates the first In the nth iteration Fitting weights for each data point; Indicates the first In the nth iteration Data points to the reference plane The directed distance; Indicates the blocking coefficient; Indicates the fit coefficient; Indicates the first Local bulge values for each data point; This represents the roughness attenuation parameter.
[0059] In the formula, Indicates the first In the nth iteration The degree of protrusion of each data point is how many times the roughness attenuation parameter; if the data point is located inside the reference surface, it indicates penetration, giving it a very high blocking coefficient. As a fitting weight, it dominates the weighted calculation, forcibly pushing the reference plane outward. If the data point is located outside the reference plane and is a valid aggregate protrusion, it is assigned the product of a moderately sized fitting coefficient and the local protrusion value. As a fitting weight, the reference plane is guided to align with the data point. If the data point is located outside the reference plane but belongs to a pore depression... By assigning it zero fitting weight, it is made completely independent of the position update of the reference surface, thus eliminating the interference of pore depressions on the measurement reference.
[0060] It should be further added that the constraints are: ;in, Indicates the first In the nth iteration Fitting weights for each data point; Indicates the first The coordinate vector of each data point; Indicates the first The reference plane normal vector for the next iteration; Indicates the first The weighted centroid of the next iteration. The constraints ensure that the algebraic sum of the virtual moments generated by all valid data points participating in the support relative to the centroid of the component approaches zero, thereby guaranteeing that the reference surface is horizontally stable and reducing reference surface deflection caused by uneven local data distribution.
[0061] For example, Figure 3 This is a two-dimensional cross-sectional schematic diagram of the fitting of the reference plane on the component surface. The red solid line represents the optimal reference plane obtained by fitting using the method of this invention, and the blue dashed line represents the plane obtained by fitting using the traditional least squares method. As shown in the figure, the method of this invention can effectively avoid pore depressions and closely fit the aggregate protrusions.
[0062] S5. Project all data points onto the optimal reference plane along the normal direction of the optimal reference plane to obtain the geometric projection of the component; complete the component size measurement based on the optimal reference plane and the geometric projection.
[0063] It should be noted that after obtaining the optimal reference plane, all geometric dimension measurements of the component must be taken with this as the reference frame. For length and width dimensions, the influence of the component's placement posture needs to be eliminated, and the true contour needs to be obtained through projection; for flatness, the range of undulation of all points relative to the reference plane needs to be evaluated; for perpendicularity, the angle between the side surface and the normal to the reference plane needs to be evaluated.
[0064] Specifically, all 3D point cloud data are aligned along the optimal reference plane. The normal direction is projected onto the reference plane to obtain a two-dimensional projection point set; the minimum bounding rectangle is calculated for the two-dimensional projection point set, and the length of the long side and the length of the short side of the minimum bounding rectangle are used as the length and width of the component, respectively; the projection of all data points onto the optimal reference plane is calculated. The directed distances are calculated, and the maximum positive and negative deviations are selected. The sum of these two deviations is taken as the flatness error of the component surface. Point cloud data of the component's side surface is extracted and fitted to the side surface plane. The normal vector of the side surface plane and the optimal reference plane are calculated. The angle between the normal vectors is used as the perpendicularity error of the component, and the difference between this angle and 90 degrees is taken as the perpendicularity error of the component.
[0065] This completes the component size measurement.
[0066] This invention also discloses a component size measurement system based on three-dimensional reconstruction, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a component size measurement method based on three-dimensional reconstruction according to the present invention.
[0067] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
Claims
1. A method for measuring component dimensions based on three-dimensional reconstruction, characterized in that, include: The three-dimensional point cloud data of the component surface is acquired and centroidal preprocessing is performed. The local neighborhood index is obtained based on the preprocessed data. The local neighborhood index is used to retrieve the neighborhood point set of each data point in the 3D point cloud data, and the local convexity value of each data point is calculated based on the neighborhood point set. ; In the formula, Indicates the first Local bulge values for each data point; Represents the neighborhood point set The normal vector of the local fitting plane points outward from the component; Indicates the first The coordinate vector of each data point; Represents the neighborhood point set The geometric center coordinate vector; Represents the neighborhood point set The residual variance relative to its local fitting plane; This represents the roughness attenuation parameter; Represents the dot product operation of vectors; This represents the function that takes the maximum value. This represents an exponential function with the natural constant e as its base. The fitting function is obtained based on the local convexity values and the directed distance from the data points to the reference surface to be determined; The fitting function is solved by iterative calculation. During the iteration process, the fitting weight of each data point is determined based on the directed distance from the data point to the current reference surface and the local convexity value. The reference surface parameters are updated using the fitting weights until convergence is obtained to obtain the optimal reference surface. Project all data points onto the optimal reference plane along the normal direction of the optimal reference plane to obtain the geometric projection of the component; The component dimensions are measured based on the optimal reference plane and geometric projection, including: Calculate the minimum bounding rectangle for the geometric projection of the component, and use the length of the long side and the length of the short side of the minimum bounding rectangle as the length and width of the component; The calculation of the flatness and perpendicularity errors of the component surface includes: calculating the directed distances from all data points to the optimal reference plane, selecting the sum of the absolute values of the maximum positive deviation and the maximum negative deviation as the flatness error of the component surface; extracting the point cloud data of the component side and fitting the side plane, calculating the angle between the normal vector of the side plane and the normal vector of the optimal reference plane, and using the difference between this angle and 90 degrees as the perpendicularity error of the component surface; and completing the component dimension measurement.
2. The component size measurement method based on three-dimensional reconstruction according to claim 1, characterized in that, The fitting function satisfies the expression: ; In the formula, Representing the reference plane The total fit deviation; Indicates the blocking coefficient; Indicates the fit coefficient; Represents the unit step function; Indicates the first Data points to the reference plane The directed distance is defined as negative on the solid side of the component and positive on the outside; Indicates the first Local bulge values for each data point; This represents the roughness attenuation parameter.
3. The component size measurement method based on three-dimensional reconstruction according to claim 1, characterized in that, Updating the reference surface parameters using the fitted weights includes: We use fitted weights to perform weighted statistics on the 3D point cloud data and construct a weighted covariance matrix. We solve the weighted covariance matrix to obtain the updated reference surface normal vector and calculate the updated reference surface position by combining the fitted weights.
4. The component size measurement method based on three-dimensional reconstruction according to claim 3, characterized in that, The fitting weights satisfy the expression: In the formula, Indicates the first In the nth iteration Fitting weights for each data point; Indicates the first In the nth iteration Data points to the reference plane The directed distance; Indicates the blocking coefficient; Indicates the fit coefficient; Indicates the first Local bulge values for each data point; The roughness attenuation parameter is represented; the reciprocal of the depth measurement error variance of the 3D scanning equipment during the calibration stage is extracted, and the reciprocal is multiplied by the diagonal length of the geometric bounding box of the 3D point cloud data of the component as the blocking coefficient; the fitting coefficient is obtained by: statistically analyzing the ratio of the number of data points with local convexity values greater than 0 in the 3D point cloud data to the total number of data points, and using an exponential function with the natural constant as the base to calculate the fitting coefficient.
5. The component size measurement method based on three-dimensional reconstruction according to claim 3, characterized in that, The step of obtaining the updated reference plane normal vector and calculating the updated reference plane position by combining it with the fitting weights includes: The weighted centroid is obtained by averaging the coordinate vectors of all data points using fitted weights, and is used as the updated reference surface location. Eigenvalue decomposition is performed on the weighted covariance matrix, and the eigenvector corresponding to the smallest eigenvalue is selected. The eigenvector satisfying the constraint condition is determined as the updated reference surface normal vector. The constraint condition is: ;in, Indicates the first In the nth iteration Fitting weights for each data point; Indicates the first The coordinate vector of each data point; Indicates the first The reference plane normal vector for the next iteration; Indicates the first The weighted centroid of the next iteration.
6. The component size measurement method based on three-dimensional reconstruction according to claim 1, characterized in that, The process of obtaining the local neighborhood index includes: The kd-tree index is obtained based on the preprocessed data and used as a local neighborhood index.
7. A component dimension measurement system based on three-dimensional reconstruction, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a component size measurement method based on three-dimensional reconstruction according to any one of claims 1-6.