Measurement and detection method for conduit or lead with quasi-rectangular cross section
By collecting multi-angle images through a multi-camera vision system and optimizing the axis vector and normal vector, a three-dimensional model of a catheter with a rectangular cross-section can be reconstructed. This solves the problems of complex detection process and missing information in existing technologies, and achieves efficient and accurate catheter detection.
Patent Information
- Application Number
- CN202511179288.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-08-22
AI Technical Summary
The existing technology has complex structural image acquisition in the detection of rectangular cross-section ducts, which is prone to information loss or confusion, resulting in distorted three-dimensional reconstruction. In addition, the detection process is highly complex and difficult to adapt to the rapid detection needs of industrial sites.
A multi-viewing system is used to capture multi-angle images. By optimizing the axis and normal vectors and combining them with the reconstruction of the end, torsion angle, and circular hole, a complete 3D model is output, reducing the need for surface pre-processing.
It achieves high-precision and rapid detection of rectangular cross-section ducts, reduces the complexity of the detection process, enhances the ability to resist environmental interference, and adapts to the rapid detection needs of industrial sites.
Smart Images

Figure CN120672971A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of optical measurement, and in particular relates to a method for measuring and detecting a conduit or wire with a quasi-rectangular cross-section. Background Art
[0002] Quasi-rectangular cross-section ducts, with their advantages of lightweight, high torsional rigidity, and strong process adaptability, are increasingly being used in high-end manufacturing fields such as new energy vehicles, aerospace, and marine applications. In the new energy vehicle sector, they can form cage-like protective structures for battery packs, improving collision safety. In aerospace, weldless extruded rectangular ducts can significantly extend fatigue life. In the marine sector, aluminum alloy rectangular tubes can reduce hull weight by over 30%, improving navigation efficiency. The structural accuracy of these ducts directly impacts the safety and reliability of equipment, making efficient and accurate detection of their geometric dimensions and characteristic defects a critical component of industrial manufacturing.
[0003] Existing inspection technologies for rectangular cross-section ducts mainly include four categories: the first is manual inspection, which uses general measuring tools to measure dimensions and visually determine defects. It is suitable for simple scenarios such as on-site maintenance, but relies on the operator's skills, is extremely inefficient, and is difficult to adapt to mass production; the second is fixture inspection, which uses physical limits to quickly determine the tube shape's acceptability. It is suitable for large-scale scenarios, but the accuracy of the fixture depends on the processing cost, and can only qualitatively judge deviations, cannot quantify data, and is not compatible with multi-specification ducts; the third is sensor detection, which can realize local feature measurement, but the technology is not mature enough and cannot complete three-dimensional reconstruction of the entire tube, making it difficult to meet the needs of automated production; the fourth is point cloud detection of a general vision system, which reconstructs the tube shape through non-contact acquisition of three-dimensional point clouds. It covers a wide range of scenarios, but there are blind spots in viewing angles, and high-precision measurement requires spraying matte paint on the surface of the rectangular cross-section duct and arranging feature marking points, which significantly prolongs the measurement cycle, especially for long tubes or complex structures.
[0004] Despite their respective strengths, existing technologies still face significant bottlenecks in achieving comprehensive, efficient, and high-precision inspection of quasi-rectangular cross-section ducts. Image acquisition of complex structures is prone to information loss or confusion, leading to distorted 3D reconstructions. Surface pretreatment requirements complicate the inspection process, making it difficult to adapt to the rapid inspection demands of industrial sites. Furthermore, existing technologies are weakly resistant to interference from ambient light and vibration, resulting in insufficient stability. Therefore, developing a comprehensive, high-precision, and efficient measurement and inspection method for quasi-rectangular cross-section ducts has become a pressing technical challenge. Summary of the Invention
[0005] The purpose of the present invention is to overcome the defects in the prior art and provide a method for measuring and detecting a conduit or wire with a rectangular cross-section.
[0006] The present invention provides a method for measuring and detecting a conduit or wire with a quasi-rectangular cross-section, comprising the following steps: (1) Collect multi-angle images of the rectangular cross-section catheter to be tested through a multi-viewing system; (2) Based on the multi-angle image, the initial value of the axis vector of the spatial rectangular body representing the rectangular cross-section catheter body is solved. ; (3) Based on the initial value of the axis vector , solve the initial value of the normal vector of the space rectangle ; (4) Optimize the initial value of the axis vector of the spatial rectangular body , get the optimized axis vector ; (5) Based on the optimized axis vector , determine the normal vector of the optimized space rectangle ; (6) Reconstructing the special structure of the rectangular cross-section catheter based on the modeled tube body, the special structure including the end, torsion angle and circular hole; (7) The measurement data of the pipe body and special structures are integrated to output a complete three-dimensional model of the rectangular cross-section pipe to complete the inspection.
[0007] A further solution is that in step (1), the multi-camera vision system needs to be calibrated before collecting images. After the calibration is completed, a quasi-rectangular cross-section catheter to be measured is placed in the measurement area, and the calibrated multi-camera vision system is used to shoot the quasi-rectangular cross-section catheter to obtain images of the quasi-rectangular cross-section catheter under all camera viewing angles. The calibration process of the multi-camera vision system is as follows: Use a calibration plate with regularly arranged circular coded markers and non-coded markers, and photograph the calibration plate at different positions of the multi-camera vision system; Solve the intrinsic parameter matrix of each camera based on the principle of close-range photogrammetry and the extrinsic parameter rotation matrix , and establish a measurement coordinate system at the center of the calibration plate; The Z axis of the measurement coordinate system is perpendicular to the measurement plane and points to the top camera. The X and Y axes are perpendicular to each other and located in the measurement plane. The coordinate origin is located at the geometric center of the measurement plane.
[0008] A further solution is that the step (2) of solving the axis vector includes: Denoising and grayscale threshold extraction are performed on the camera image to obtain the boundary line of the rectangular cross-section catheter; Connect the camera optical center and the boundary line to form a boundary plane; Apply the small angle approximation principle to find the image points with equal distances to the straight lines on both sides of the image to form the axis to be determined; Connect the optical center of the camera and the undetermined axis to form an undetermined axis plane, and solve the intersection line of the undetermined axis planes of two adjacent cameras as the proposed axis; Perform average processing on the proposed axis of all adjacent cameras to obtain the initial value of the axis vector .
[0009] A further solution is to solve the initial value of the normal vector in step (3) include: Initial value of axis vector and the unit normal vector Represents the four edges of a spatial rectangular body; A sampling ray is formed by connecting the points on the boundary line of the quasi-rectangular cross-section catheter and the optical center of the camera; Calculate the non-planar straight-line distance vector between the sampling ray and the axis of the spatial rectangular body And the non-plane straight line distance vector between the sampling light and the edge of the spatial rectangular body ; Determine the same-direction distance vectors by using the cosine of the included angle and select the minimum distance value; The minimum distance from all sampling rays to the edge is used as the objective function, with a fixed step size. Rotate the normal vector: ; Traversal ∈[0°,360°) to get the optimal initial value of the normal vector .
[0010] A further solution is that in step (4), the initial value of the axis vector The optimization process is: Based on the initial value of the axis vector and the initial value of the normal vector , calculate the four vertices of the end face of the spatial rectangular body and the two intersection points of the axis; Project the vertices and intersection points onto the camera image to obtain the projection points, vertex projection points and intersection projection points; Calculate the length of the perpendicular line from each projection point to the axis projection line; Filter the longest vertical line and the second longest vertical line and calculate the scale factor; Correct the axis point according to the coordinates of the image boundary points and the scale factor; Fit the corrected axis point to obtain the optimized axis vector .
[0011] A further solution is that in step (5), the normal vector is determined The process is: Based on the optimized axis vector , repeat the solution of the initial value of the normal vector described in claim 4 Steps to output the final normal vector .
[0012] A further solution is that the step (6) of rebuilding the end head includes: Taking the spatial rectangular body as the reconstruction unit, the pipe body data is obtained by diffusing along the pipe body direction; At a position close to the end, filter the light that passes through the central axis of the height section of the rectangular body and has two intersections with the section, and solve the intersection point of the light and the rectangular body; Based on the scale factor and geometric length of the intersection point and the central axis point, the position of the axis point near the end face in the camera image is determined, and the coordinates of the end face axis point are obtained by three-dimensional reconstruction.
[0013] A further solution is that the step (6) of reconstructing the torsion angle includes: Analyze the digital model of the rectangular cross-section catheter to obtain a standard point cloud of the torsion angle, and convert the standard point cloud from the digital model coordinate system to the measurement coordinate system; Select a camera, project the standard point cloud into the two-dimensional image coordinate system, and iteratively adjust the position of the standard point cloud using the minimum gradient of the projection area as the objective function; Determine the matrix transformation relationship from the digital-analog coordinate system to the measurement coordinate system to complete the three-dimensional reconstruction of the torsion angle.
[0014] A further solution is that the step (6) of reconstructing the circular hole includes: Convert the circular hole from the digital model coordinate system to the measurement coordinate system; Based on the normal vector of the spatial rectangular body of the tube body near the circular hole, a constraint plane passing through the center of the circular ring at the center of the circular hole is established; For camera images that meet the requirements, an objective function relationship between the image and the center ring of the circular hole in the measurement coordinate system is established. The center coordinates of the center ring of the circular hole are solved in combination with the constraint plane to complete the reconstruction.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention uses a multi-angle vision system to collect multi-angle images, combines the solution and optimization of axis vectors and normal vectors to achieve pipe body modeling, and integrates the measurement data of special structures such as ends, torsion angles, and circular holes to output a complete three-dimensional model. This can solve the problem of information loss or confusion in complex structure image acquisition in the existing technology, which leads to distortion of three-dimensional reconstruction. There is no need for pre-processing such as matte paint spraying or arranging feature marking points on the surface of rectangular cross-section catheters, which reduces the complexity of the detection process and adapts to the needs of rapid detection in industrial sites.
[0016] The multi-camera vision system of the present invention is calibrated using a calibration plate with regularly arranged circular coded markers and non-coded markers. Based on the principle of close-range photogrammetry, the camera's internal and external parameters are solved and a clear measurement coordinate system is established. This provides a precise coordinate reference and parameter basis for subsequent multi-angle image acquisition and three-dimensional reconstruction, thereby improving the consistency and accuracy of the system's measurements.
[0017] The present invention denoises the camera image, extracts boundary lines, and combines the spatial geometric relationship of the multi-eye vision system to obtain the initial value of the axis vector through solving and averaging the boundary plane, the undetermined axis, and the proposed axis. It uses multi-view data fusion to reduce the single-view error and provide a reliable initial basis for subsequent calculations. Based on the initial value of the axis vector, the optimal initial value of the normal vector is determined by calculating the non-planar straight-line distance between the sampling light and the edge line and the axis, combined with the angle traversal search, and accurately capturing the normal characteristics of the spatial rectangular body. The initial value of the axis vector is optimized by analyzing the length of the perpendicular line of the projection point and correcting the scale factor to make it more consistent with the actual shape of the rectangular cross-section catheter. The normal vector is re-solved based on the optimized axis vector to further improve the accuracy of the normal vector. Finally, through the coordinated optimization of the axis vector and the normal vector, the accuracy of the spatial rectangle in representing the rectangular cross-section catheter body is significantly improved, laying a solid foundation for the subsequent reconstruction of special structures, effectively solving the three-dimensional reconstruction distortion problem caused by missing or confused information in the image acquisition of complex structures, reducing the surface preprocessing requirements, and enhancing the ability to resist environmental interference. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The following drawings are merely provided for illustrative purposes only and are not intended to limit the scope of the present invention. Figure 1 : Overall flow chart of the measurement and detection method of quasi-rectangular cross-section catheters; Figure 2 : Solve the proposed axis schematic diagram; Figure 3 : Schematic diagram for determining the distance and direction of different-plane straight lines; Figure 4 : Schematic diagram of the projection of the end vertices and axis correction of the spatial rectangular body; Figure 5 : Schematic diagram of the cross section and intersection points in the reconstruction of the catheter tip with a quasi-rectangular cross section; Figure 6 : Schematic diagram of torsion angle measurement and camera projection of a catheter with a quasi-rectangular cross section; Figure 7 : Schematic diagram of circular hole center ring measurement and camera light. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution, design method and advantages of the present invention more clear, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0020] The present invention provides a method for measuring and detecting a conduit or wire with a quasi-rectangular cross-section, comprising the following steps: (1) Capturing multi-angle images of the rectangular cross-section conduit to be tested through a multi-camera vision system, wherein the multi-camera vision system is composed of at least two industrial cameras, which are fixed around the conduit to be tested by a bracket to form a multi-view observation network; (2) Based on the multi-angle image, the initial value of the axis vector of the spatial rectangular body representing the rectangular cross-section catheter body is solved. ; (3) Based on the initial value of the axis vector , solve the initial value of the normal vector of the space rectangle ; (4) Optimize the initial value of the axis vector of the spatial rectangular body , get the optimized axis vector ; (5) Based on the optimized axis vector , determine the normal vector of the optimized space rectangle ; (6) Reconstructing the special structure of the rectangular cross-section catheter based on the modeled tube body, the special structure including the end, torsion angle and circular hole; (7) The measurement data of the pipe body and special structures are integrated to output a complete three-dimensional model of the rectangular cross-section pipe to complete the inspection.
[0021] In step (1), the multi-camera vision system needs to be calibrated before collecting images. After the calibration is completed, a quasi-rectangular cross-section catheter to be measured is placed in the measurement area, and the calibrated multi-camera vision system is used to shoot the quasi-rectangular cross-section catheter to obtain the image of the quasi-rectangular cross-section catheter under all camera viewing angles; the calibration process of the multi-camera vision system is as follows: a calibration plate with regularly arranged circular coding markers and non-coding markers is used, and the calibration plate is photographed at different positions of the multi-camera vision system; the intrinsic parameter matrix of each camera is solved based on the principle of close-range photogrammetry. and the extrinsic parameter rotation matrix , and establish a measurement coordinate system at the center of the calibration plate; wherein the Z axis of the measurement coordinate system is perpendicular to the measurement plane and points to the top camera, the X and Y axes are perpendicular to each other and located in the measurement plane, and the coordinate origin is located at the geometric center of the measurement plane.
[0022] In step (2), solve the initial value of the axis vector of the spatial rectangular body representing the rectangular cross-section catheter body The method is based on the geometric characteristics of the rectangular cross-section of the quasi-rectangular cross-section catheter, and is derived from the image data and spatial geometric relationship of the multi-eye vision system using the two-dimensional camera image as the benchmark. The specific steps are as follows: Preprocessing is performed on the camera images of the quasi-rectangular cross-section catheter acquired by the multi-camera vision system, including environmental denoising and grayscale threshold extraction, so as to accurately identify and confirm the boundary lines of the quasi-rectangular cross-section catheter image, that is, the edge contour lines of the quasi-rectangular cross-section catheter in the two-dimensional image; Connect the optical center of each camera to the boundary lines of the rectangular-section catheter in the 2D image to form a set of spatial planes, defined as boundary planes. Each boundary plane contains the lines connecting all image points on the corresponding boundary line with the optical center of the camera, reflecting the projection relationship of the edge of the rectangular-section catheter in 3D space. Based on the symmetry of the quasi-rectangular cross-section catheter, the principle of small-angle approximation is applied to find all image points in the two-dimensional image that are equidistant from the upper and lower boundary lines. The line formed by these image points is the axis to be determined (theoretical projection of the axis of the quasi-rectangular cross-section catheter in the two-dimensional image). Connect the undetermined axis in the 2D image with the optical center of the corresponding camera to form a plane of undetermined axis (a spatial plane containing the undetermined axis and the camera's optical center). For each pair of cameras in the multi-camera vision system, find the intersection line of their undetermined axis planes. This intersection line is the proposed axis (a candidate value for the 3D axis from the perspective of a single camera group). The proposed axes solved by all camera combinations in the multi-camera vision system are averaged to eliminate the error interference of a single camera group. The final set of axis data obtained is the initial value of the axis vector of the spatial rectangle. .like Figure 2 As shown, the axis solution diagram includes: Represents the two-dimensional images of two adjacent cameras, Represents the optical center of the two cameras. Represents the undetermined axis plane of the two cameras obtained by solution; Represents a proposed axis obtained by solving.
[0023] In step (3), solve the initial value of the normal vector of the spatial rectangle The process is: Using known initial axis vectors , the normal vector to be found Represents the four edges parallel to the axis in a spatial rectangular body, then: ; in, Indicates from the 1st to the The direction vector of the edge line, ; Indicates a known point on the axis; Represent the axis vector, normal vector and line vector of the space rectangle respectively, ; Respectively represent the height and width of the spatial rectangle; represents the length vectors of four parallel and equal-length edges in the measurement coordinate system, and , is a known quantity; The normal vector is perpendicular to the axis vector and is on the axis As the starting point, the normal vector can be solved based on the perpendicular relationship. This solution method will obtain several normal vectors, that is, their directions will rotate around the axis vector direction in the height section of the spatial rectangle and cannot be fixed. First, according to the normal vector being perpendicular to the axis vector, the starting point of the normal vector is a point on the axis vector, and a set of unit normal vectors are solved. ; The unit normal vector It represents a vector perpendicular to the cross section of the spatial rectangular solid with a modulus of 1, and is used to represent the cross-sectional direction of the spatial rectangular solid.
[0024] The points on the boundary line of the rectangular cross-section catheter of the camera image and the corresponding camera optical center form sampling rays. The distance vectors of the skew lines parallel to the axis of the spatial rectangular body and the axis are solved. Since the skew line distance in space has a direction, such as Figure 3 As shown, the definition of the non-planar straight line distance from a sampling ray to the axis of the spatial rectangular body is positive; if the direction of the non-planar straight lines from the same sampling ray to the edges of the spatial rectangular body is the same as the direction of the non-planar straight line pointing to the axis, then the straight line distance from the ray to the edge of the spatial rectangular body is positive, and the straight line distance from the ray to the edge is compared with the straight line distance from the ray to the axis, and the modulus length of the smallest straight line distance is taken; otherwise, the straight line distance from the ray to the edge of the spatial rectangular body is negative, and the modulus length of the largest straight line distance is taken. Given a sampling ray in a camera image and the axis of the spatial rectangle , a set of unit normal vectors , whose angle is defined as 0°: Sampling Rays : Through the camera optical center The direction vector is represented by the vector from the boundary line of the rectangular cross-section catheter to the optical center of the camera. , is the equation coefficient, and the parametric equation is: ; ; Axis of a spatial rectangular body: passing through a point on the axis , the direction vector of the axis , is the coefficient of the equation, and its parametric equation is: ; ; , is a nonzero direction vector, and and Not parallel ( ), to ensure that the two lines are not in the same plane. Therefore, the distance vector of the two lines between the sampling ray and the axis of the spatial rectangular body can be expressed as: ; in: Indicates the point on the axis from the optical center of the sampling light The vector of , referred to as the connection vector; Represents the product of the direction vectors of two lines; Represents the modulus of the product of the direction vectors of two straight lines; Represents the projection of the connection vector in the product direction, and its length is the projection length of the connection vector in the product direction.
[0025] Represents the distance vector of the non-planar straight line Three-dimensional coordinates in the measurement coordinate system; Similarly, we can find the distance vector between the sampling ray and the edge of the spatial rectangle. :Through a point on the edge , whose direction vector is expressed as , is the coefficient of the equation, and its parametric equation is: ; ; , is a nonzero direction vector, and and Not parallel ( ), to ensure that the two lines are not in the same plane. Therefore, the distance vector of the two lines between the sampling ray and the edge of the spatial rectangular body can be expressed as: ; in: Indicates from the axis Start and move forward along the normal vector direction , continue to move in the positive direction along the line vector , you can determine a point on the edge ; It is based on the normal vector of the space rectangle being perpendicular to the axis vector and As the starting point, the set of normal vector values obtained by solving is is a known quantity.
[0026] Indicates the direction from the optical center of the sampling ray to the point on the edge The vector of , referred to as the connection vector; Represents the product of the direction vectors of two lines; Represents the modulus of the product of the direction vectors of two straight lines; Represents the projection of the connection vector in the product direction, and its length is the projection length of the connection vector in the product direction.
[0027] Represents the distance vector of the non-planar straight line The three-dimensional coordinates in the measurement coordinate system.
[0028] Reference sampling rays The edge of the spatial rectangle The process of solving the distance vector of the non-planar straight line, solving the sampling line The non-planar straight-line distance vectors from the other three edges of the spatial rectangular body are: 、 、 .
[0029] Get the distance vectors of different planes, and use the geometric judgment method to determine whether the distance vectors of different planes are in the same direction. 、 For example: ; in, is a vector 、 The angle of ≥0, the two vectors are in the same direction, and the smaller vector modulus is taken as the minimum distance reference value; otherwise, <0, the two vectors are in opposite directions, and the modulus of the larger vector is taken as the minimum distance reference value. respectively and 、 、 、 The minimum distance reference value to be solved, among which the smallest value is the sampling line of this group The minimum distance value.
[0030] Finally, the objective function is to minimize the distances of all sampling rays of all camera images to the edges and axes of the spatial rectangle, that is, the sum of the minimum distances of all sampling rays of all cameras is minimized. Since the normal vector direction will rotate around the axis vector direction in the height section of the spatial rectangle and cannot be fixed, the unit normal vector is set As a starting point, Perpendicular to the axis vector, its angle is defined as 0°, with a fixed step size (usually set to 0.5°~1°), rotate around the axis vector direction within the height boundary section of the space rectangle; traverse all , through the angle exhaustive search method, all possible angle values of the discretized normal vector are traversed with a fixed step size. , calculate the objective function value corresponding to each angle and select the optimal solution. Rotation Get the new normal vector , apply the Rodrigues rotation formula to solve the new normal vector , the specific formula is expressed as: ; Calculate repeatedly until all the The sum of the minimum distances of all sampling rays of all corresponding camera images to the edges and axes of the spatial rectangular body. Compare all the minimum distance sums and determine the smallest one that satisfies the objective function. The corresponding normal vector is the initial value of the normal vector of the spatial rectangular body to be solved. .
[0031] In step (4), the axis vector of the spatial rectangular body is optimized The process is: like Figure 4 As shown, based on the existing spatial rectangular body, determine the midpoints of the two end faces of the spatial rectangular body (the end faces are perpendicular to the axis direction) 、 , which is also the intersection of the axis of the spatial rectangular body and the two side end faces 、 , solve point 、 midpoint ; Combined with the normal vector and line vector of the existing space rectangle, the point The four vertices of the end face of the spatial rectangular body Since in a space rectangular solid, the opposite end face is a face parallel to the end face and the distance is equal to the length of the corresponding edge. Given the midpoint of one end face To the opposite midpoint The vector is the axis vector perpendicular to the given end face. Specifically: ; in, is the direction vector of the axis vector. Continue to solve the point 、 midpoint ,but: ; Further confirm The four vertices of the end face of the spatial rectangular body , expressed as: ; in, is the initial value of the normal vector of the spatial rectangle obtained by the above solution; is the initial value of the known spatial rectangular body axis vector , initial value of normal vector The line vector obtained by solving is, ; Respectively represent the height and width of the spatial rectangle.
[0032] Four end face vertices and the center points of both sides 、 Project the two-dimensional image onto a certain camera to obtain the corresponding end face vertex projection point And the projection points of the two end face center points 、 . Take the end face vertex Projection to camera For example, the formula expresses the projection point of each spatial point on the two-dimensional image: ; in: Represents the projection point The two-dimensional image coordinates of the camera; the coordinates of the camera optical center in the measurement coordinate system ; End face vertex The three-dimensional coordinates in the measurement coordinate system are ; System calibration determines the internal parameter matrix of each camera and the extrinsic parameter rotation matrix . Specifically including: 1) , Indicates the focal length in the two-dimensional image coordinate system Axis component, ( ) represents the two-dimensional image coordinates of the camera's principal point; 2) Camera's extrinsic parameter matrix , represents the rotation matrix from the measurement coordinate system to the camera coordinate system, so the camera coordinate system The point coordinates can be expressed as .in, Respectively represent In the camera coordinate system Axis coordinates.
[0033] connect 、 It is the two-dimensional projection line of the axis of the spatial rectangular body in the camera image; in the camera image, there are four projection points Two-dimensional projection lines to the axis Draw perpendicular lines. Based on the lengths of the four existing perpendicular lines, determine the longest perpendicular line and the second longest perpendicular line; establish the proportional relationship of the length of the second longest perpendicular line as a correction factor. To the 2D projection line Taking the length of the perpendicular line as an example, the formula is expressed as: ; in: Represents the projection point The two-dimensional image coordinates of It is based on the known two-dimensional projection points and , solve for the straight line where the two projection points lie.
[0034] According to the vertical line expression formula, four projection points are obtained by solving them in sequence. To the 2D projection line The perpendicular line of Compare and confirm the longest and second longest vertical lines. longest, For example, the corresponding two-dimensional projection point , the correction factor formula is expressed as: ; Solve the correction factor of the spatial rectangular body in all camera images. Based on the existing two-dimensional image of the rectangular cross-section catheter, the two two-dimensional projection points of the correction factor can be determined. It should be the boundary point of the quasi-rectangular cross-section catheter. Therefore, according to the coordinates of the boundary points on both sides of the quasi-rectangular cross-section catheter 2D image, the correction factor of the corresponding camera image is applied to adjust the central axis points corresponding to the boundary points on both sides. Then the axis vector of the reconstructed spatial rectangular body is optimized. Taking the correction factor solved by the previous projection as an example, the camera In the two-dimensional image, grayscale extraction obtains a set of upper and lower boundary points ; The formula for the axis point is: ; Apply the least squares method to all axis points in the corrected camera two-dimensional image to obtain the expression of the axis in the camera two-dimensional image; continue to solve the expression of the corrected axis in all camera two-dimensional images, apply the corrected axis in all camera two-dimensional images, and reconstruct the optimized axis vector in the measurement coordinate system in three dimensions. .
[0035] Determine the normal vector of the optimized spatial rectangle The methods include: According to the optimization axis vector , optimize the normal vector of the space rectangle The specific method is the same as the initial value of the normal vector of the first solution of the space rectangle The reason for repeating the solution process is that the axis vector of the spatial rectangle was corrected in the previous step, and the axis vector is an important known condition for solving the normal vector. Therefore, the normal vector needs to be solved again to obtain the normal vector of the spatial rectangle in the measurement coordinate system that meets the actual measurement requirements. .
[0036] Methods for reconstructing the end of a quasi-rectangular cross-section catheter using geometric relationships include: Given the feature vectors of a spatial rectangular body (including axis vectors, normal vectors, and line vectors), the spatial rectangular body is used as a reconstruction unit. A fixed search step is set, and the pipe body data of the pipe with a quasi-rectangular cross-section is diffused and reconstructed along the pipe body direction of the pipe with a quasi-rectangular cross-section. Since the end face position of the quasi-rectangular cross-section catheter is difficult to determine by diffusing the spatial rectangular body, the spatial rectangular body is used as the measurement object when the end face position of the quasi-rectangular cross-section catheter is close to the end face position of the quasi-rectangular cross-section catheter, such as Figure 5 As shown, a measurement camera that participates in the reconstruction of a rectangular cross-section catheter is selected, and the central axis point of the height cross-section of the measured rectangular body is screened. , and there are two rays with intersection points other than the central axis point with the height section, solve the intersection position of the ray and the rectangular body ; Solve the intersection of the height ridges far away from the camera optical center The scaling factor , intersection The center axis point of the cross section The geometric length value of , and the intersection Pointing to the starting point Vector The position of the end boundary of the quasi-rectangular cross-section catheter in the camera image is determined by applying the geometric length ratio and geometric length value obtained by the solution to determine the position of the axis point near the end surface of the quasi-rectangular cross-section catheter in the camera image; The above algorithm process is executed for all cameras involved in the end reconstruction to determine the location of the central axis point of the end face in each camera image. The coordinates of the end face axis point of the quasi-rectangular cross-section catheter in the measurement coordinate system are obtained through 3D reconstruction, thus completing the end measurement of the quasi-rectangular cross-section catheter. ; ; In the camera image, the endpoints of the height ridges of the rectangular cross-section catheter end face away from the camera optical center are 、 .
[0037] endpoint , apply the scaling factor , determine the intersection : ; Intersection Applying a length value , determine the center axis point of the end face : ; in, is a vector The 2D projection coordinates in the camera image.
[0038] All camera rays that meet the above conditions are calculated to determine the end face center axis points in several camera images, and three-dimensional reconstruction is performed to obtain the three-dimensional coordinates of the end face center axis points that conform to the actual measurement scene.
[0039] Methods for restoring torsion angle based on digital-analog features include: Figure 6 As shown in the figure, the torsion angle is one of the important characteristics of the rectangular cross-section catheter. Accurately measuring the torsion angle is an essential step in measuring the rectangular cross-section catheter. Specifically, it includes: The mathematical model of the quasi-rectangular cross-section catheter is analyzed to obtain the standard point cloud data of the torsion angle of the quasi-rectangular cross-section catheter. This data is then converted from the mathematical model coordinate system of the standard point cloud to the measurement coordinate system of the system, and a set of matrix transformation relationships is determined. Since the quasi-rectangular cross-section catheter can be represented by a spatial rectangular body diffusion, the normal vector of the torsion angle in the measurement coordinate system can be represented by the normal vectors of the spatial rectangular bodies near the torsion angle on both sides. Since the analytical mathematical model determines the normal vector of the torsion angle in the mathematical model coordinate system, the following equation is obtained: ; in, 、 are the coordinate data of the normal vector of the torsion angle in the measurement coordinate system and the digital-analog coordinate system respectively; 、 The normal vector correspondence is applied to solve the rotation matrix relationship and translation matrix relationship from the digital model coordinate system to the measurement coordinate system. 、 The relationship between the two sets of coordinate matrices is solved by SVD (singular value) decomposition method. 、 . Apply matrix transformation relationship , transform the standard point cloud of the torsion angle into the measurement coordinate system, that is: ; in, is the standard point cloud of torsion angle in the digital-analog coordinate system; Apply matrix transformation relationships 、 Will Convert to the measurement coordinate system and obtain the standard point cloud corresponding to the torsion angle.
[0040] Then, a camera is selected and the relationship between the camera's intrinsic and extrinsic parameters determined by calibration is applied to transform the standard point cloud of the torsion angle from the measurement coordinate system to the camera's image coordinate system. The expression formula is as follows: ; in, is the standard point cloud of the torsion angle Any point in is projected back to the two-dimensional image coordinates in the image coordinate system; is the coordinate of the standard point cloud of the torsion angle in the measurement coordinate system; is the coordinate of the camera's projection center point in the measurement coordinate system; is the principal point deviation, is the focal length of the camera lens, It is the image point deviation caused by lens distortion. The principal point deviation, lens focal length and image point deviation caused by distortion are collectively called the intrinsic parameters of the camera. 、 The rotation matrix and translation matrix relationships between the measurement coordinate system and the camera coordinate system are collectively called the camera's extrinsic parameters. They include: ; ; Standard point cloud of torsion angle , after converting from the measurement coordinate system to the image coordinate system, the projection point coordinate set of the standard point cloud is obtained .
[0041] Finally, given that the direction of the torsion angle remains unchanged and consistent with the normal vector in actual measurement, we can therefore: ; In the actual measurement process, the rotation matrix relationship of the standard point cloud of the torsion angle from the digital model coordinate system to the measurement coordinate system; in addition, In the actual measurement process, the translation matrix relationship of the standard point cloud of the torsion angle from the digital-analog coordinate system to the measurement coordinate system is represented. Therefore, the minimum point gradient and the minimum point gradient of the projection area of the standard point cloud are used as the objective function, and an iterative solution is performed on all camera images to determine the translation matrix transformation relationship from the digital-analog coordinate system to the measurement coordinate system. The specific formula is as follows: ; in, is the coordinate set of all projection points of the standard point cloud Gradient and minimum function in image coordinates; Indicates a point Image gradient magnitude in the image coordinate system; A point in the standard point cloud representing the torsion angle , projected from the digital-analog coordinate system to the image coordinate system, the corresponding image coordinates are . Indicates the number of projection points of the standard point cloud, For the projection point coordinate set of the standard point cloud Any two-dimensional image point in , its image gradient can be expressed as: ; ;
[0042] Apply matrix transformation relationship to the torsion angle standard point cloud in the logarithmic coordinate system 、 , the specific expression formula is as follows: ; in, 、 They are the standard point cloud data of the torsion angle in the measurement coordinate system and the digital model coordinate system respectively; 、 They are the rotation matrix relationship and translation matrix relationship from the digital-analog coordinate system to the measurement coordinate system respectively; is the matrix transformation relationship from the digital-analog coordinate system to the measurement coordinate system. At this point, the measurement of the torsion angle is completed.
[0043] Methods for reconstructing a circular hole in a quasi-rectangular cross-section conduit include: Based on the hole image captured by the camera, determine the center positions of the upper and lower circles of the hole. Combined with the known hole radius, determine the upper and lower circle ranges. The midpoint of the line connecting the centers of the upper and lower circles is the proposed center point of the three-dimensional hole. If this center point is within the range of the upper or lower circle, the camera image meets the measurement requirements; otherwise, the camera image does not meet the measurement requirements.
[0044] Since the normal vector of the circular hole can be represented by the normal vector of the rectangular body of the quasi-rectangular cross-section conduit space near it, the SVD (singular value) decomposition method is applied to determine the matrix transformation relationship from the digital-analog coordinate system to the measurement coordinate system, as shown in the following example: Figure 7 As shown in the figure, the normal vector and the center point of the circular hole are converted from the digital model coordinate system to the measurement coordinate system, and a constraint plane is established with the center point of the circular hole and its normal vector as the normal vector of the circular hole. , the normal vector , so the constraint plane can be expressed as: ; Select a filtered measurement camera image, and the image point of the circular ring boundary of the circular hole passes through the optical center of the camera, forming a ray that intersects with the plane of the circular ring of the circular hole in the measurement coordinate system. , establish the objective function: ; Center of circle , intersection are all within the constraint plane, that is, the plane of the circular ring at the center of the hole is the constraint plane. To be solved and formulated To solve the initial value, substitute the above objective function and solve it. Infinitely close to zero, and with the constraint plane as the constraint condition, the center of the circle ring of the circular hole is finally solved. Finally, for all camera images that meet the measurement requirements, the above objective function is executed to reconstruct the center of the circular ring of the circular hole that meets the actual measurement requirements. , and the normal vector of the central ring of the circular hole is .
[0045] At this point, the present invention has completed the corresponding measurement scheme for the tube body, end cap, torsion angle, and circular hole of the quasi-rectangular cross-section catheter; combined with the measured standard digital model data corresponding to the quasi-rectangular cross-section catheter, the tube type detection can be completed. First, the measured tube body, end cap, torsion angle, and circular hole measurement data are combined to output a complete quasi-rectangular cross-section catheter model; then, the measured quasi-rectangular cross-section catheter body model is aligned with its standard digital model for the bending points, and the measurement deviation of each bending point is confirmed; then, the measured quasi-rectangular cross-section catheter torsion angle is aligned with its standard digital model for the torsion angle, and the measurement deviation of each torsion angle is determined. Similarly, the measurement deviation of each circular hole can be obtained. Finally, the bending point deviation, torsion angle deviation, and circular hole measurement deviation are combined to complete the tube type detection.
[0046] While various embodiments of the present invention have been described above, the above descriptions are intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for measuring and detecting a conduit or wire with a rectangular cross section, characterized in that: The following steps are involved: (1) Collect multi-angle images of the rectangular cross-section catheter to be tested through a multi-viewing system; (2) Based on the multi-angle image, the initial value of the axis vector of the spatial rectangular body representing the rectangular cross-section catheter body is solved. ; (3) Based on the initial value of the axis vector , solve the initial value of the normal vector of the space rectangle ; (4) Optimize the initial value of the axis vector of the spatial rectangular body , get the optimized axis vector ; (5) Based on the optimized axis vector , determine the normal vector of the optimized spatial rectangle ; (6) Reconstructing the special structure of the rectangular cross-section catheter based on the modeled tube body, the special structure including the end, torsion angle and circular hole; (7) The measurement data of the pipe body and special structures are integrated to output a complete three-dimensional model of the rectangular cross-section pipe to complete the inspection.
2. A method for measuring and detecting a quasi-rectangular cross-section conduit or wire according to claim 1, characterized in that: In step (1), the multi-camera vision system needs to be calibrated before collecting images. After the calibration is completed, a quasi-rectangular cross-section catheter to be measured is placed in the measurement area, and the calibrated multi-camera vision system is used to shoot the quasi-rectangular cross-section catheter to obtain images of the quasi-rectangular cross-section catheter under all camera viewing angles. The calibration process of the multi-camera vision system is as follows: Use a calibration plate with regularly arranged circular coded markers and non-coded markers, and photograph the calibration plate at different positions of the multi-camera vision system; Solve the intrinsic parameter matrix of each camera based on the principle of close-range photogrammetry and the extrinsic parameter rotation matrix , and establish a measurement coordinate system at the center of the calibration plate; The Z axis of the measurement coordinate system is perpendicular to the measurement plane and points to the top camera. The X and Y axes are perpendicular to each other and located in the measurement plane. The coordinate origin is located at the geometric center of the measurement plane.
3. The method for measuring and detecting a quasi-rectangular cross-section conduit or wire according to claim 1, characterized in that: Solving the axis vector in step (2) includes: Denoising and grayscale threshold extraction are performed on the camera image to obtain the boundary line of the rectangular cross-section catheter; Connect the camera optical center and the boundary line to form a boundary plane; Apply the small angle approximation principle to find the image points with equal distances to the straight lines on both sides of the image to form the axis to be determined; Connect the optical center of the camera and the undetermined axis to form an undetermined axis plane, and solve the intersection line of the undetermined axis planes of two adjacent cameras as the proposed axis; Perform average processing on the proposed axis of all adjacent cameras to obtain the initial value of the axis vector .
4. A method for measuring and detecting a quasi-rectangular cross-section conduit or wire according to claim 3, characterized in that: Solve the initial value of the normal vector in step (3) include: Initial value of axis vector and the unit normal vector Represents the four edges of a spatial rectangular body; A sampling ray is formed by connecting the points on the boundary line of the quasi-rectangular cross-section catheter and the optical center of the camera; Calculate the non-planar straight-line distance vector between the sampling ray and the axis of the spatial rectangular body And the non-plane straight line distance vector between the sampling light and the edge of the spatial rectangular body ; Determine the same-direction distance vectors by using the cosine of the included angle and select the minimum distance value; The minimum distance from all sampling rays to the edge is used as the objective function, with a fixed step size. Rotate the normal vector: ; Traversal ∈[0°,360°) to get the optimal initial value of the normal vector .
5. The method for measuring and detecting a quasi-rectangular cross-section conduit or wire according to claim 4, characterized in that: In step (4), the initial value of the axis vector The optimization process is: Based on axis vector and the initial value of the normal vector , calculate the four vertices of the end face of the spatial rectangular body and the two intersection points of the axis; Project the vertices and intersection points onto the camera image to obtain the projection points, vertex projection points and intersection projection points; Calculate the length of the perpendicular line from each projection point to the axis projection line; Filter the longest vertical line and the second longest vertical line and calculate the scale factor; Correct the axis point according to the coordinates of the image boundary points and the scale factor; Fit the corrected axis point to obtain the optimized axis vector .
6. The method for measuring and detecting a quasi-rectangular cross-section conduit or wire according to claim 5, characterized in that: In step (5), the normal vector is determined The process is: Based on the optimized axis vector , repeat the solution of the initial value of the normal vector described in claim 4 Steps to output the final normal vector .
7. A method for measuring and detecting a quasi-rectangular cross-section conduit or conductor according to claim 6, characterized in that: Rebuilding the end head in step (6) includes: Taking the spatial rectangular body as the reconstruction unit, the pipe body data is obtained by diffusing along the pipe body direction; At a position close to the end, filter the light that passes through the central axis of the height section of the rectangular body and has two intersections with the section, and solve the intersection point of the light and the rectangular body; Based on the scale factor and geometric length of the intersection point and the central axis point, the position of the axis point near the end face in the camera image is determined, and the coordinates of the end face axis point are obtained by three-dimensional reconstruction.
8. The method for measuring and detecting a quasi-rectangular cross-section conduit or wire according to claim 7, characterized in that: The step (6) of reconstructing the torsion angle comprises: Analyze the digital model of the rectangular cross-section catheter to obtain a standard point cloud of the torsion angle, and convert the standard point cloud from the digital model coordinate system to the measurement coordinate system; Select a camera, project the standard point cloud into the two-dimensional image coordinate system, and iteratively adjust the position of the standard point cloud using the minimum gradient of the projection area as the objective function; Determine the matrix transformation relationship from the digital-analog coordinate system to the measurement coordinate system to complete the three-dimensional reconstruction of the torsion angle.
9. The method for measuring and detecting a conduit or wire with a rectangular cross section according to claim 8, wherein: The step (6) of reconstructing the circular hole comprises: Convert the circular hole from the digital model coordinate system to the measurement coordinate system; Based on the normal vector of the rectangular volume of the pipe body near the circular hole, a constraint plane passing through the center of the circular ring at the center of the circular hole is established; For camera images that meet the requirements, an objective function relationship between the image and the center ring of the circular hole in the measurement coordinate system is established. The center coordinates of the center ring of the circular hole are solved in combination with the constraint plane to complete the reconstruction.
Citation Information
Patent Citations
Three-dimensional variable section bent runner design method and device based on geometrical mergence
CN108999845A
High-precision catheter end detecting and positioning method
CN113409395A
Visual field non-overlapping three-dimensional point cloud splicing method and system based on calibration plate
CN116485647A
Drill bit three-dimensional reconstruction and measurement method based on multiple exposure
CN118799504A