Methods for determining capillary outer diameter, electronic equipment, storage media and detection systems

By using a strip-structured laser and camera system on the capillary production line, combined with image coordinate transformation and ellipse fitting technology, the error problem of machine vision inspection method when the capillary is tilted is solved, and more accurate outer diameter measurement is achieved.

CN120212892BActive Publication Date: 2025-11-14CHENGDE JIANLONG SPECIAL STEEL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510550134.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-11-14
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

Existing machine vision inspection methods produce unstable results during the capillary production process, especially when the capillary is tilted, resulting in significant errors.

Method used

A two-line laser and camera system is used to project images onto the capillary surface using laser lines. The inclination of the capillary is determined and a circle is fitted to accurately measure the outer diameter using image coordinate transformation and ellipse fitting techniques.

Benefits of technology

This improves the accuracy of capillary outer diameter detection, reduces errors caused by tilting, and achieves more precise diameter measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120212892B_ABST
    Figure CN120212892B_ABST
Patent Text Reader

Abstract

This invention relates to the field of online capillary diameter detection technology based on images, and particularly to a method, electronic device, storage medium, and detection system for determining the outer diameter of a capillary. The invention first acquires a first image and a second image; then, it extracts the image coordinate information of the laser lines in the images from the first and second images respectively, and performs coordinate transformation on the two image coordinate information to obtain two world coordinate information; next, based on the two world coordinate information, it determines the coordinates of two positioning centers, and determines the inclination of the capillary based on the two center coordinates; finally, it performs circular fitting based on the inclination and the two world coordinate information to obtain the outer diameter of the capillary. This invention transforms the coordinates of the two laser lines on the capillary in the image to world coordinates, then determines the inclination of the capillary using the world coordinates, and determines the diameter of the capillary based on the inclination. Compared with current technologies, the diameter detection result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image-based online capillary diameter detection technology, and in particular to a method for determining the outer diameter of a capillary, an electronic device, a storage medium, and a detection system. Background Technology

[0002] Steel pipe rough tubes refer to hollow, elongated semi-finished products with specific dimensions and surface quality, produced during the steel pipe manufacturing process by processing steel ingots or billets through processes such as piercing. They serve as the foundation for further processing into steel pipes of various specifications and applications. The primary use of steel pipe rough tubes is as intermediate raw materials for further steel pipe processing. Through subsequent processes such as hot rolling, cold rolling, and cold drawing, rough tubes can be processed into finished steel pipes of various specifications and applications, widely used in construction, machinery, petrochemicals, shipbuilding, aerospace, and many other fields.

[0003] Online inspection in capillary tube production refers to the real-time monitoring of multiple parameters, including the outer diameter of the capillary tube, during the capillary tube production process, so as to adjust the production equipment in a timely manner to meet the quality requirements of the capillary tube.

[0004] Currently, the mainstream technologies for online detection of capillary tube outer diameter include machine vision inspection, photoelectric online diameter measuring instrument inspection, and ultrasonic inspection. Among these, machine vision inspection is highly regarded due to its high environmental adaptability. However, the main problem with machine vision inspection is that it is affected by the production environment, resulting in unstable detection results, especially when tilting occurs during capillary tube production, which can lead to significant errors.

[0005] Therefore, it is necessary to develop a method for determining the outer diameter of the capillary tube. Summary of the Invention

[0006] The present invention provides a method for determining the outer diameter of a capillary tube, an electronic device, a storage medium, and a detection system, which solves the problem of inaccurate results in the detection of the outer diameter of a capillary tube using machine vision detection methods in the prior art.

[0007] In a first aspect, embodiments of the present invention provide a capillary outer diameter detection system, comprising: two strip-structured lasers, two cameras, and a processor;

[0008] The two strip-structured lasers and the two cameras are respectively electrically connected to the processor;

[0009] The two strip-structured lasers emit laser wavelengths that are different.

[0010] When the capillary tube is located in the laser projection area of ​​the two strip-structured lasers, the two strip-structured lasers project two laser lines on the outer contour of the capillary tube.

[0011] The two cameras are each equipped with a filtering device, and the wavelengths corresponding to the filtering devices of the two cameras correspond one-to-one with the emission wavelengths of the two strip-structure lasers.

[0012] When the two cameras respectively acquire images containing laser lines, the processor determines the capillary surface contour by the position of the laser lines in the two images, and determines the outer diameter of the capillary based on the surface contour.

[0013] In one possible implementation, the two strip-structured lasers and the two cameras are all located at the same height, and the horizontal spacing between the two strip-structured lasers is the same as the horizontal spacing between the two cameras.

[0014] Secondly, embodiments of the present invention provide a method for determining the outer diameter of a capillary tube, comprising:

[0015] Acquire a first image and a second image, wherein the first image and the second image respectively include laser lines generated on the capillary by a stripe structure laser;

[0016] The image coordinate information of the laser line in the images is extracted from the first image and the second image respectively, and the two image coordinate information are transformed to obtain two world coordinate information, wherein the world coordinate information is the coordinate information of the laser line in the world coordinate system;

[0017] Based on the two world coordinates, two positioning center coordinates are determined, and the inclination of the capillary is determined based on the two center coordinates, wherein the positioning center coordinates are the center coordinates of the capillary cross-section where the laser line is located;

[0018] The outer diameter of the capillary tube is obtained by performing a circular fit based on the tilt and the two world coordinate information.

[0019] In one possible implementation, the coordinate transformation of the two image coordinate information to obtain two world coordinate information includes:

[0020] The image coordinate information includes multiple pixel coordinates of the laser line image. For each set of image coordinate information, the following steps are performed:

[0021] Acquire depth information, camera intrinsic parameter matrix, and camera extrinsic parameter matrix, wherein the intrinsic parameter matrix reflects the relationship between pixel coordinates on the camera imaging plane and coordinates in the camera coordinate system, the camera extrinsic parameter matrix reflects the relationship between the camera coordinate system and the world coordinate system, and the depth information reflects the distance from a point in the image to the camera.

[0022] The image coordinate information is transformed according to the camera intrinsic parameter matrix and the depth information to obtain intermediate coordinate information, wherein the intermediate coordinate information represents the coordinates of each point of the laser line in the coordinate system with the camera optical center as the origin.

[0023] The intermediate coordinate information is transformed based on the camera extrinsic matrix to obtain world coordinate information, where the world coordinate information represents the coordinates of each point of the laser line in the world coordinate system.

[0024] In one possible implementation, the step of transforming the image coordinate information based on the camera intrinsic parameter matrix and the depth information to obtain intermediate coordinate information includes:

[0025] The image coordinate information is transformed according to the first formula, the camera intrinsic parameter matrix, and the depth information to obtain intermediate coordinate information, wherein the first formula is:

[0026]

[0027] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the intermediate coordinate system, respectively. For depth information, This is the intrinsic parameter matrix. The focal length is the x-axis. The focal length is the y-axis. as well as These are the x-axis and y-axis coordinates of the intersection point of the optical axis and the image plane, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the image coordinate system, respectively.

[0028] The step of transforming the intermediate coordinate information based on the camera extrinsic matrix to obtain world coordinate information includes:

[0029] The intermediate coordinate information is transformed according to the second formula and the camera extrinsic parameter matrix to obtain world coordinate information, wherein the second formula is:

[0030]

[0031] In the formula, The rotation matrix describes the rotation of the camera in the world coordinate system. A vector describing the translation of the camera in the world coordinate system. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system.

[0032] In one possible implementation, determining the coordinates of two positioning centers based on the two world coordinates, and determining the inclination of the capillary tube based on the two center coordinates, includes:

[0033] Construct the first ellipse equation based on the focus;

[0034] Based on the two world coordinate information, the first ellipse equation is fitted using the least squares method or the random sampling consensus algorithm to obtain the second and third ellipse equations.

[0035] Based on the second ellipse equation and the third ellipse equation, a first focus pair and a second focus pair are determined respectively, wherein the first focus pair and the second focus pair each include two foci extracted based on the second ellipse equation and the third ellipse equation;

[0036] Based on the first focus pair and the second focus pair, determine the coordinates of the first positioning center and the coordinates of the second positioning center;

[0037] Calculate the difference between the coordinates of the first positioning center and the coordinates of the second positioning center to obtain the coordinate difference;

[0038] The inclination of the capillary tube is determined based on the coordinate difference and the laser line spacing length, wherein the laser line spacing is the distance between two laser lines on the capillary tube.

[0039] In one possible implementation, the equation of the first ellipse is:

[0040]

[0041] In the formula, Let be the distance from the laser point to the first focal point. Let be the distance from the laser point to the second focal point. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the first focus of the ellipse in the world coordinate system. , as well as These are the coordinates of the second focus of the ellipse along the x-axis, y-axis, and z-axis in the world coordinate system. For sum constants;

[0042] The step of determining the capillary tilt angle based on the coordinate difference and the laser line spacing length includes:

[0043] The inclination of the capillary tube is determined based on the third formula, the coordinate difference, and the laser line spacing length, wherein the third formula is:

[0044]

[0045] In the formula, , as well as These represent the differences between the x-axis, y-axis, and z-axis coordinates, respectively. Let be the angle between the capillary tube and the x-axis in the xy-plane. Let be the angle between the capillary tube and the x-axis in the xz plane. To take into account the tilt, The length of the laser line spacing. It is an arcsine function.

[0046] In one possible implementation, one of the two world coordinate information is used as the outer diameter estimation coordinate information. The step of performing circular fitting based on the inclination and the two world coordinate information to obtain the capillary outer diameter includes:

[0047] Based on the stated inclination, a fourth ellipse equation is constructed using the major and minor axes, wherein the fourth ellipse equation is:

[0048]

[0049] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as The rotation of the laser point in the xz coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. , as well as The rotation of the laser point in the xy coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. For the long axis, For the short axis, Where is the radius of the capillary tube. Let be the angle between the capillary tube and the x-axis in the xy-plane. The angle between the capillary tube and the x-axis in the xz plane;

[0050] Based on the estimated coordinate information of the outer diameter, the fourth ellipse equation is fitted using the least squares method or the random sampling consensus algorithm to obtain the fifth ellipse equation;

[0051] The capillary diameter is determined based on the capillary radius in the fifth ellipse equation.

[0052] Thirdly, embodiments of the present invention provide a capillary outer diameter determining device for implementing the capillary outer diameter determining method as described in the second aspect or any possible implementation thereof, the capillary outer diameter determining device comprising:

[0053] An image acquisition module is used to acquire a first image and a second image, wherein the first image and the second image respectively include a laser line generated on a capillary by a strip-structured laser;

[0054] The coordinate transformation module is used to extract the image coordinate information of the laser line in the images from the first image and the second image respectively, and to perform coordinate transformation on the two image coordinate information to obtain two world coordinate information, wherein the world coordinate information is the coordinate information of the laser line in the world coordinate system;

[0055] The capillary tilt determination module is used to determine two positioning center coordinates based on the two world coordinate information, and to determine the tilt of the capillary based on the two center coordinates, wherein the positioning center coordinates are the center coordinates of the capillary cross section where the laser line is located;

[0056] as well as,

[0057] The capillary outer diameter determination module is used to perform circular fitting based on the inclination and the two world coordinate information to obtain the capillary outer diameter.

[0058] Fourthly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the method as described in the second aspect above or any possible implementation of the second aspect.

[0059] Fifthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the second aspect or any possible implementation thereof.

[0060] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:

[0061] This invention discloses a method for determining the outer diameter of a capillary tube. First, it acquires a first image and a second image, each including a laser line generated on the capillary tube by a linear laser. Then, it extracts the image coordinates of the laser lines from the first and second images, and performs coordinate transformation on these two image coordinates to obtain two world coordinates, where the world coordinates are the coordinates of the laser lines in the world coordinate system. Next, based on the two world coordinates, it determines two positioning center coordinates and the capillary tube's inclination, where the positioning center coordinates are the center coordinates of the capillary tube's cross-section where the laser lines are located. Finally, it performs circular fitting based on the inclination and the two world coordinates to obtain the capillary tube's outer diameter. This invention first generates two laser lines on the capillary tube using a laser, then transforms the laser line coordinates in the image to world coordinates, then determines the capillary tube's inclination using the world coordinates, and finally determines the capillary tube's diameter based on the inclination. Because it considers the influence of inclination on capillary tube diameter detection, the diameter detection result is more accurate compared to current technologies. Attached Figure Description

[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0063] Figure 1 This is a schematic diagram of the capillary outer diameter detection system provided in an embodiment of the present invention;

[0064] Figure 2 This is a flowchart of the capillary outer diameter determination method provided by the embodiments of the present invention;

[0065] Figure 3 This is a functional block diagram of the capillary outer diameter determination device provided in the embodiments of the present invention;

[0066] Figure 4 This is a functional block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0067] In the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0068] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0069] The embodiments of the present invention will be described in detail below. This example is implemented based on the technical solution of the present invention, and provides detailed implementation methods and specific operation processes. However, the protection scope of the present invention is not limited to the following embodiments.

[0070] Figure 1 A schematic diagram of a capillary outer diameter detection system provided in the first aspect of an embodiment of the present invention.

[0071] This invention provides a capillary outer diameter detection system, comprising: two strip-structured lasers, two cameras, and a processor;

[0072] The two strip-structured lasers and the two cameras are respectively electrically connected to the processor;

[0073] The two strip-structured lasers emit laser wavelengths that are different.

[0074] When the capillary tube is located in the laser projection area of ​​the two strip-structured lasers, the two strip-structured lasers project two laser lines on the outer contour of the capillary tube.

[0075] The two cameras are each equipped with a filtering device, and the wavelengths corresponding to the filtering devices of the two cameras correspond one-to-one with the emission wavelengths of the two strip-structure lasers.

[0076] When the two cameras respectively acquire images containing laser lines, the processor determines the capillary surface contour by the position of the laser lines in the two images, and determines the outer diameter of the capillary based on the surface contour.

[0077] In one possible implementation, the two strip-structured lasers and the two cameras are all located at the same height, and the horizontal spacing between the two strip-structured lasers is the same as the horizontal spacing between the two cameras.

[0078] For example, such as Figure 1 As shown, the installation positions of each component of the steel pipe production line capillary outer diameter detection system are as follows: Figure 1As shown. This detection system uses a non-contact method. The cylindrical structure is the capillary tube 101 being tested. The horizontal and vertical planes are part of the structure of the capillary tube processing equipment 102: the perforating machine. Located above and in front of the capillary tube 101 is a strip-structure laser 103, and to the upper left is a camera 104. Directly in front of the capillary tube 101 is a hot metal detection sensor 105. In one application scenario, two strip-structure lasers 103, each emitting a blue and a green laser line, are positioned 2400 mm above the ground and 1600 mm horizontally from the axis of the capillary tube 101. Two cameras 104 observe the laser lines on the capillary tube 101 from a horizontal distance of 1400 mm from the strip-structure lasers 103. The hot metal detection sensor 105 is installed in the space below the cameras 104 and the strip-structure lasers 103.

[0079] To ensure that each of the two cameras observes only one laser line, the system incorporates filtering equipment. Filtering allows the camera to receive only photons in a specific wavelength range. For example, when using a blue laser with a wavelength of 450±5nm, a filter is installed on the camera observing that laser, allowing only photons with wavelengths between 440nm and 480nm to pass through.

[0080] The specific detection steps of this system are as follows:

[0081] First, two linear laser beams are projected onto the surface of the capillary tube, and two cameras are used to acquire images of the laser beams on the surface. Then, an image analysis model is used to extract the center of the laser beams, thereby obtaining the laser beam contour of the capillary tube surface through three-dimensional spatial coordinate conversion. Next, the detection error caused by the capillary tube tilt is corrected by synchronous detection of the two laser beam contours, thereby correcting the outer diameter contour of the capillary tube. Finally, the obtained corrected continuous capillary tube cross-sectional contour information is fitted with a circle to obtain the outer diameter of the capillary tube.

[0082] The present invention describes the above process in detail from a second aspect.

[0083] Figure 2 A flowchart of a method for determining the outer diameter of a capillary tube provided in the second aspect of an embodiment of the present invention.

[0084] like Figure 2 As shown, a flowchart illustrating the implementation of the capillary outer diameter determination method provided by an embodiment of the present invention is presented, and is described in detail below:

[0085] In step 201, a first image and a second image are acquired, wherein the first image and the second image respectively include laser lines generated on the capillary by a stripe structure laser.

[0086] In step 202, the image coordinate information of the laser line in the images is extracted from the first image and the second image respectively, and the two image coordinate information are transformed to obtain two world coordinate information, wherein the world coordinate information is the coordinate information of the laser line in the world coordinate system.

[0087] In some implementations, the coordinate transformation of the two image coordinate information to obtain two world coordinate information includes:

[0088] The image coordinate information includes multiple pixel coordinates of the laser line image. For each set of image coordinate information, the following steps are performed:

[0089] Acquire depth information, camera intrinsic parameter matrix, and camera extrinsic parameter matrix, wherein the intrinsic parameter matrix reflects the relationship between pixel coordinates on the camera imaging plane and coordinates in the camera coordinate system, the camera extrinsic parameter matrix reflects the relationship between the camera coordinate system and the world coordinate system, and the depth information reflects the distance from a point in the image to the camera.

[0090] The image coordinate information is transformed according to the camera intrinsic parameter matrix and the depth information to obtain intermediate coordinate information, wherein the intermediate coordinate information represents the coordinates of each point of the laser line in the coordinate system with the camera optical center as the origin.

[0091] The intermediate coordinate information is transformed based on the camera extrinsic matrix to obtain world coordinate information, where the world coordinate information represents the coordinates of each point of the laser line in the world coordinate system.

[0092] In some implementations, the step of transforming the image coordinate information based on the camera intrinsic parameter matrix and the depth information to obtain intermediate coordinate information includes:

[0093] The image coordinate information is transformed according to the first formula, the camera intrinsic parameter matrix, and the depth information to obtain intermediate coordinate information, wherein the first formula is:

[0094]

[0095] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the intermediate coordinate system, respectively. For depth information, This is the intrinsic parameter matrix. The focal length is the x-axis. The focal length is the y-axis. as well as These are the x-axis and y-axis coordinates of the intersection point of the optical axis and the image plane, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the image coordinate system, respectively.

[0096] The step of transforming the intermediate coordinate information based on the camera extrinsic matrix to obtain world coordinate information includes:

[0097] The intermediate coordinate information is transformed according to the second formula and the camera extrinsic parameter matrix to obtain world coordinate information, wherein the second formula is:

[0098]

[0099] In the formula, The rotation matrix describes the rotation of the camera in the world coordinate system. A vector describing the translation of the camera in the world coordinate system. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system.

[0100] For example, as mentioned earlier, the lasers generated by the lasers produce laser lines on the capillary tube. The two lasers produce different wavelengths, and the filters at the front of the two cameras correspond to the two laser wavelengths. In other words, each camera captures an image of a laser line. Since the image of the laser line is significantly different in color from the images of other objects, a color filtering algorithm can be used to further eliminate the images of other objects, retaining only the laser line.

[0101] The coordinates of the laser line in world coordinates can be calculated from the laser line image. In fact, the world coordinates of the laser line are a set of coordinates of multiple laser line pixels in world coordinates.

[0102] Before the conversion, the camera is calibrated to obtain depth information, camera intrinsic parameter matrix, and camera extrinsic parameter matrix.

[0103] There are several methods to obtain the intrinsic parameter matrix. For example, the self-calibration method is used. The principle is that it does not require the use of a specific calibration board, but rather uses the geometric relationships and motion information between images to estimate the camera intrinsic parameters.

[0104] For example, by capturing images of a series of scenes, analyzing the motion and transformation of feature points in the images, and using geometric constraints such as epipolar geometry and homography matrix, combined with some assumptions and algorithms, the camera intrinsic parameters can be solved.

[0105] In this invention, the distance to the capillary is determined by a hot metal detection sensor (the axis of the hot metal detection sensor and the capillary are at the same height), and the depth information is determined based on the position of the hot metal detection sensor relative to the camera and the position relative to the laser.

[0106] The extrinsic parameter matrix describes the position and orientation of the camera coordinate system relative to the world coordinate system. It consists of a rotation matrix R (representing rotation) and a translation vector T (representing translation). The extrinsic parameter matrix is ​​typically determined using camera calibration methods.

[0107] Preparing the calibration object: Select a calibration object with known geometric features, most commonly a checkerboard calibration board. A checkerboard consists of alternating black and white squares, with each square having a known and fixed side length. Through precise machining and measurement, determine the three-dimensional coordinates of feature points on the checkerboard (usually the corner points of the black and white squares) in the world coordinate system. Generally, the origin of the world coordinate system is set at a corner point of the checkerboard, with the coordinate axes parallel to the edges of the checkerboard.

[0108] Acquire calibration images: Use the camera to be calibrated to take multiple images of the calibration object from different angles and positions. During shooting, ensure the calibration object occupies an appropriate size and position in the image, and that the image is clear enough to accurately detect feature points on the calibration object. It is generally recommended to take 10 to 20 images to cover various possible camera poses and viewpoints.

[0109] Feature point detection: Each acquired calibration image is processed using image processing algorithms (such as corner detection algorithms, commonly Harris corner detection, Shi-Tomasi corner detection, etc.) to detect the pixel coordinates of feature points on the calibration object in the image. The coordinates of these feature points in the image will serve as important data for subsequent calculations.

[0110] Based on a mathematical model, calculate the coordinates of the known feature points in the world coordinate system. (Determined by the calibration object) and pixel coordinates in the image Given the camera intrinsic parameter matrix K obtained in advance through other methods, optimization algorithms such as the least squares method can be used to solve for the rotation matrix R and translation vector T. In practical calculations, mature computer vision libraries (such as OpenCV) are typically used to implement these algorithms. OpenCV provides specialized functions and tools that facilitate camera calibration and the calculation of extrinsic parameter matrices.

[0111] Optimization and Validation: To improve the accuracy of the extrinsic parameter matrix, the calculation results are typically optimized. Methods such as maximum likelihood estimation can be used to further adjust the values ​​of the rotation matrix R and translation vector T, minimizing the reprojection error (i.e., the error between the coordinates of a point projected from the world coordinate system onto the image plane based on the calculated extrinsic and intrinsic parameter matrices and the actual detected image coordinates). Simultaneously, additional image data can be used to validate the calculated extrinsic parameter matrix, checking its accuracy and reliability under different scenarios. Through these steps, the camera's extrinsic parameter matrix can be determined, thereby establishing the transformation relationship between the camera coordinate system and the world coordinate system.

[0112] After obtaining the depth information, camera intrinsic parameter matrix, and camera extrinsic parameter matrix, the image coordinate information can be converted into intermediate coordinate information using the first formula:

[0113]

[0114] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the intermediate coordinate system, respectively. For depth information, This is the intrinsic parameter matrix. The focal length is the x-axis. The focal length is the y-axis. as well as These are the x-axis and y-axis coordinates of the intersection point of the optical axis and the image plane, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the image coordinate system, respectively.

[0115] Then, the intermediate coordinate information is converted into world coordinate information again using the second formula:

[0116]

[0117] In the formula, The rotation matrix describes the rotation of the camera in the world coordinate system. A vector describing the translation of the camera in the world coordinate system. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system.

[0118] In step 203, two positioning center coordinates are determined based on the two world coordinate information, and the inclination of the capillary is determined based on the two center coordinates, wherein the positioning center coordinates are the center coordinates of the capillary cross section where the laser line is located.

[0119] In some implementations, determining the coordinates of two positioning centers based on the two world coordinates, and determining the inclination of the capillary tube based on the two center coordinates, includes:

[0120] Construct the first ellipse equation based on the focus;

[0121] Based on the two world coordinate information, the first ellipse equation is fitted using the least squares method or the random sampling consensus algorithm to obtain the second and third ellipse equations.

[0122] Based on the second ellipse equation and the third ellipse equation, a first focus pair and a second focus pair are determined respectively, wherein the first focus pair and the second focus pair each include two foci extracted based on the second ellipse equation and the third ellipse equation;

[0123] Based on the first focus pair and the second focus pair, determine the coordinates of the first positioning center and the coordinates of the second positioning center;

[0124] Calculate the difference between the coordinates of the first positioning center and the coordinates of the second positioning center to obtain the coordinate difference;

[0125] The inclination of the capillary tube is determined based on the coordinate difference and the laser line spacing length, wherein the laser line spacing is the distance between two laser lines on the capillary tube.

[0126] In some implementations, the equation of the first ellipse is:

[0127]

[0128] In the formula, Let be the distance from the laser point to the first focal point. Let be the distance from the laser point to the second focal point. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the first focus of the ellipse in the world coordinate system. , as well as These are the coordinates of the second focus of the ellipse along the x-axis, y-axis, and z-axis in the world coordinate system. For sum constants;

[0129] The step of determining the capillary tilt angle based on the coordinate difference and the laser line spacing length includes:

[0130] The inclination of the capillary tube is determined based on the third formula, the coordinate difference, and the laser line spacing length, wherein the third formula is:

[0131]

[0132] In the formula, , as well as These represent the differences between the x-axis, y-axis, and z-axis coordinates, respectively. Let be the angle between the capillary tube and the x-axis in the xy-plane. Let be the angle between the capillary tube and the x-axis in the xz plane. To take into account the tilt, The length of the laser line spacing. It is an arcsine function.

[0133] For example, in an embodiment of the present invention, the inclination of the capillary axis is determined based on the center of the two laser lines, and then one of the laser lines (elliptical profile) is fitted based on the inclination to determine the diameter of the capillary.

[0134] In determining the inclination of the capillary tube, based on two world coordinate information and the first ellipse equation based on the focus, the least squares method or random sampling consensus algorithm is used to fit the first ellipse equation to obtain the ellipse equation with the best fit. Based on the coordinates of the two foci in this ellipse equation with the best fit, the center of the ellipse containing the ellipse line is found, and then the inclination of the capillary tube is determined based on the two centers.

[0135] The equation of the first ellipse is:

[0136]

[0137] In the formula, Let be the distance from the laser point to the first focal point. Let be the distance from the laser point to the second focal point. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the first focus of the ellipse in the world coordinate system. , as well as These are the coordinates of the second focus of the ellipse along the x-axis, y-axis, and z-axis in the world coordinate system. Let be a constant.

[0138] In one application scenario, the Random Sample Consensus (RANSAC) algorithm was used to fit the equation of the first ellipse. The principle of RANSAC is as follows: The core idea of ​​RANSAC is to select a minimum subset from the dataset through random sampling. This subset contains enough sample points to estimate the model parameters. For example, for line fitting, the minimum subset typically contains 2 points (because two points determine a line); for plane estimation, 3 points are needed. A model is estimated using the selected minimum subset, and then this model is used to test all points in the dataset. Based on a certain error threshold, each point is judged as either an inlier (i.e., a point that conforms to the model) or an outlier (i.e., a point that does not conform to the model). This process of sampling, estimating the model, and classifying inliers and outliers is repeated multiple times, recording the number of inliers in each iteration. At the end of the algorithm, the model obtained in the iteration with the largest number of inliers is selected as the final estimated model.

[0139] Algorithm Steps: First, initialize: Set parameters such as the number of iterations N and the error threshold t. Then, randomly sample: Randomly select a minimum subset S from the dataset. Next, perform model estimation: Estimate a model M using the subset S. Then, count interior points: Iterate through all points in the dataset, calculate the error between each point and model M. If the error is less than the threshold t, the point is an interior point, and the number of interior points n is counted. Then, iterate and judge: If the maximum number of iterations N is reached or the number of interior points n is large enough (exceeding the preset threshold), stop iterating; otherwise, return to continue sampling. Finally, determine the model: Select the model with the largest number of interior points as the final estimation result.

[0140] The RANSAC algorithm is robust and can effectively handle a large number of outliers and noise in a dataset because it does not rely on all data points to estimate the model, but rather approximates the true model by finding the model with the most inliers. The RANSAC algorithm performs exceptionally well when dealing with noisy and outlier data, making it a very practical parameter estimation method.

[0141] When applying the RANSAC algorithm in this invention, seven parameters need to be determined: the coordinates of the two foci (each focal point has three parameters) and a constant. Since the coordinates of each laser point in the world coordinate system can construct three equations, the minimum subset S should be 3. That is, by extracting three coordinate points from the world coordinate information and performing the above iterative process each time, a final ellipse equation can be determined. The coordinates of the two foci are extracted from this ellipse equation, and the median of the two focal coordinates is used as the center coordinate. In other words, a center coordinate is obtained through each piece of world coordinate information (one piece of world coordinate information is obtained for each laser line). Then, the capillary tilt can be obtained using the third formula.

[0142]

[0143] In the formula, , as well as These represent the differences between the x-axis, y-axis, and z-axis coordinates, respectively. Let be the angle between the capillary tube and the x-axis in the xy-plane. Let be the angle between the capillary tube and the x-axis in the xz plane. To take into account the tilt, The length of the laser line spacing. It is an arcsine function.

[0144] In step 204, a circular fit is performed based on the tilt and the two world coordinate information to obtain the outer diameter of the capillary tube.

[0145] In some embodiments, one of the two world coordinate information is used as the outer diameter estimation coordinate information. The step of performing circular fitting based on the inclination and the two world coordinate information to obtain the capillary outer diameter includes:

[0146] Based on the stated inclination, a fourth ellipse equation is constructed using the major and minor axes, wherein the fourth ellipse equation is:

[0147]

[0148] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as The rotation of the laser point in the xz coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. , as well as The rotation of the laser point in the xy coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. For the long axis, For the short axis, Where is the radius of the capillary tube. Let be the angle between the capillary tube and the x-axis in the xy-plane. The angle between the capillary tube and the x-axis in the xz plane;

[0149] Based on the estimated coordinate information of the outer diameter, the fourth ellipse equation is fitted using the least squares method or the random sampling consensus algorithm to obtain the fifth ellipse equation;

[0150] The capillary diameter is determined based on the capillary radius in the fifth ellipse equation.

[0151] For example, based on the inclination of the capillary tube, an equation can be constructed using the inclination, the major axis of the ellipse, and the minor axis of the ellipse. In fact, the minor axis of the ellipse is the diameter of the capillary tube. This equation (the fourth ellipse equation) is:

[0152]

[0153] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as The rotation of the laser point in the xz coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. , as well as The rotation of the laser point in the xy coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. For the long axis, For the short axis, Where is the radius of the capillary tube. Let be the angle between the capillary tube and the x-axis in the xy-plane. The angle between the capillary tube and the x-axis in the xz plane.

[0154] In fact, with Figure 1 For example, this equation is based on a world coordinate system where the positive z-axis is above, the positive y-axis is in front, and the positive x-axis is to the right. If we transform this coordinate system to the yz plane, the equation will take the following form (based on the equation of an ellipse with major and minor axes):

[0155]

[0156] In the formula For the long axis, For the short axis, Where is the radius of the capillary tube. and These are the equations after transforming the ellipse to the yz plane coordinate system. However, as mentioned earlier, when the capillary tube is tilted, the above equations cannot be used to express the situation.

[0157] In reality, the tilting of the capillary tube is a combination of two tilting directions: vertical tilting and forward / backward tilting. These two tilting directions have already been derived through the aforementioned steps. and The combination of the two oblique cuts is: We have two existing world coordinate systems, one of which serves as the coordinate system for determining the capillary diameter (outer diameter estimation coordinate system). This system can be transformed by tilting in two directions, resulting in a plane coordinate system that is coplanar with the elliptical plane. This allows us to apply the above equations.

[0158] The first conversion in the embodiment of the present invention utilizes Specifically, it can be transformed using the following formula:

[0159]

[0160] In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as The rotation of the laser point in the xz coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle.

[0161] Then, the second conversion utilized... Specifically, the following formula was used:

[0162]

[0163] In the formula, , as well as The rotation of the laser point in the xy coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. For the long axis, For the short axis, Where is the radius of the capillary tube. Let be the angle between the capillary tube and the x-axis in the xy-plane. The angle between the capillary tube and the x-axis in the xz plane.

[0164] In this way, the transformed coordinate plane is coplanar with the ellipse, and the previously mentioned equation (the fourth ellipse equation) can be used to fit the estimated outer diameter coordinates. The fitting method can also employ the least squares method or the random sampling consensus algorithm. Those skilled in the art can implement the fitting process without creative effort based on existing technology and the detailed explanations already provided, therefore, they will not be elaborated further. The fitting yields the fifth equation, which is the equation that ensures the most points in the estimated outer diameter coordinates lie on the ellipse curve. The capillary radius in this equation is taken as the final determined capillary radius.

[0165] The present invention provides a method for determining the outer diameter of a capillary tube. First, it acquires a first image and a second image, each including a laser line generated on the capillary tube by a linear laser. Then, it extracts the image coordinates of the laser lines from the first and second images, and performs coordinate transformation on these two image coordinates to obtain two world coordinates, where the world coordinates are the coordinates of the laser lines in the world coordinate system. Next, based on the two world coordinates, it determines two positioning center coordinates and the capillary tube's inclination, where the positioning center coordinates are the center coordinates of the capillary tube's cross-section where the laser lines are located. Finally, it performs circular fitting based on the inclination and the two world coordinates to obtain the capillary tube's outer diameter. This invention first generates two laser lines on the capillary tube using a laser, then transforms the laser lines' coordinates in the image to world coordinates, then determines the capillary tube's inclination using the world coordinates, and finally determines the capillary tube's diameter based on the inclination. Because it considers the influence of inclination on capillary tube diameter detection, the diameter detection result is more accurate compared to current technologies.

[0166] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0167] The following are embodiments of the apparatus of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0168] Figure 3 This is a functional block diagram of the capillary outer diameter determining device provided in the embodiments of the present invention, with reference to... Figure 3 The capillary outer diameter determination device includes: an image acquisition module 301, a coordinate transformation module 302, a capillary inclination determination module 303, and a capillary outer diameter determination module 304, wherein:

[0169] Image acquisition module 301 is used to acquire a first image and a second image, wherein the first image and the second image respectively include laser lines generated on the capillary by a stripe structure laser;

[0170] The coordinate transformation module 302 is used to extract the image coordinate information of the laser line in the images from the first image and the second image respectively, and perform coordinate transformation on the two image coordinate information to obtain two world coordinate information, wherein the world coordinate information is the coordinate information of the laser line in the world coordinate system;

[0171] The capillary tilt determination module 303 is used to determine two positioning center coordinates based on the two world coordinate information, and to determine the tilt of the capillary based on the two center coordinates, wherein the positioning center coordinates are the center coordinates of the capillary cross section where the laser line is located;

[0172] The capillary outer diameter determination module 304 is used to perform circular fitting based on the inclination and the two world coordinate information to obtain the capillary outer diameter.

[0173] Figure 4 This is a functional block diagram of the electronic device provided in an embodiment of the present invention. For example... Figure 4 As shown, the electronic device 4 of this embodiment includes a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can run on the processor 400. When the processor 400 executes the computer program 402, it implements the steps of the various capillary outer diameter determination methods and embodiments described above, for example... Figure 1 Steps 201 to 204 are shown.

[0174] For example, the computer program 402 may be divided into one or more modules / units, which are stored in the memory 401 and executed by the processor 400 to complete the present invention.

[0175] The electronic device 4 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The electronic device 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 4 and does not constitute a limitation on electronic device 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 4 may also include input / output devices, network access devices, buses, etc.

[0176] The processor 400 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0177] The memory 401 can be an internal storage unit of the electronic device 4, such as a hard disk or memory. The memory 401 can also be an external storage device of the electronic device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 401 can include both internal and external storage units of the electronic device 4. The memory 401 is used to store the computer program 402 and other programs and data required by the electronic device 4. The memory 401 can also be used to temporarily store data that has been output or will be output.

[0178] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here.

[0179] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0180] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0181] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0182] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0183] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0184] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods and apparatus embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0185] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for determining the outer diameter of a capillary tube, characterized in that, An application is made in a capillary outer diameter detection system, which includes: two strip-structured lasers, two cameras, and a processor; The two strip-structured lasers and the two cameras are respectively electrically connected to the processor; The two strip-structured lasers emit laser wavelengths that are different. When the capillary tube is located in the laser projection area of ​​the two strip-structured lasers, the two strip-structured lasers project two laser lines on the outer contour of the capillary tube. The two cameras are each equipped with a filtering device, and the wavelengths corresponding to the filtering devices of the two cameras correspond one-to-one with the emission wavelengths of the two strip-structure lasers. When the two cameras respectively capture images containing laser lines, the processor determines the capillary surface contour by the position of the laser lines in the two images, and determines the outer diameter of the capillary based on the surface contour. The method for determining the outer diameter of the capillary tube includes: Acquire a first image and a second image, wherein the first image and the second image respectively include laser lines generated on the capillary by a stripe structure laser; The image coordinate information of the laser line in the images is extracted from the first image and the second image respectively, and the two image coordinate information are transformed to obtain two world coordinate information, wherein the world coordinate information is the coordinate information of the laser line in the world coordinate system; Based on the two world coordinates, determine the coordinates of two positioning centers, and determine the inclination of the capillary tube based on the two center coordinates, including: Construct the first ellipsoid equation based on the focus; Based on the two world coordinate information, the first ellipsoid equation is fitted using the least squares method or the random sampling consensus algorithm to obtain the second and third ellipsoid equations. Based on the second ellipsoid equation and the third ellipsoid equation, a first focus pair and a second focus pair are determined respectively, wherein the first focus pair and the second focus pair each include two foci extracted based on the second ellipsoid equation and the third ellipsoid equation; Based on the first focus pair and the second focus pair, the coordinates of the first positioning center and the coordinates of the second positioning center are determined, wherein the coordinates of the positioning center are the center coordinates of the capillary cross section where the laser line is located; Calculate the difference between the coordinates of the first positioning center and the coordinates of the second positioning center to obtain the coordinate difference; The inclination of the capillary tube is determined based on the coordinate difference and the laser line spacing length, wherein the laser line spacing is the distance between two laser lines on the capillary tube. The outer diameter of the capillary tube is obtained by performing a circular fit based on the tilt and the two world coordinate information.

2. The capillary outer diameter detection method according to claim 1, characterized in that, The two strip-structure lasers and the two cameras are all located at the same height, and the horizontal distance between the two strip-structure lasers is the same as the horizontal distance between the two cameras.

3. The method for determining the outer diameter of a capillary tube according to claim 1, characterized in that, The process of transforming the coordinate information of two images to obtain two world coordinate information includes: The image coordinate information includes multiple pixel coordinates of the laser line image. For each set of image coordinate information, the following steps are performed: Acquire depth information, camera intrinsic parameter matrix, and camera extrinsic parameter matrix, wherein the intrinsic parameter matrix reflects the relationship between pixel coordinates on the camera imaging plane and coordinates in the camera coordinate system, the camera extrinsic parameter matrix reflects the relationship between the camera coordinate system and the world coordinate system, and the depth information reflects the distance from a point in the image to the camera. The image coordinate information is transformed according to the camera intrinsic parameter matrix and the depth information to obtain intermediate coordinate information, wherein the intermediate coordinate information represents the coordinates of each point of the laser line in the coordinate system with the camera optical center as the origin. The intermediate coordinate information is transformed based on the camera extrinsic matrix to obtain world coordinate information, where the world coordinate information represents the coordinates of each point of the laser line in the world coordinate system.

4. The method for determining the outer diameter of a capillary tube according to claim 3, characterized in that, The step of transforming the image coordinate information based on the camera intrinsic parameter matrix and the depth information to obtain intermediate coordinate information includes: The image coordinate information is transformed according to the first formula, the camera intrinsic parameter matrix, and the depth information to obtain intermediate coordinate information, wherein the first formula is: In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the intermediate coordinate system, respectively. For depth information, This is the intrinsic parameter matrix. The focal length is the x-axis. The focal length is the y-axis. as well as These are the x-axis and y-axis coordinates of the intersection point of the optical axis and the image plane, respectively. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the image coordinate system, respectively. The step of transforming the intermediate coordinate information based on the camera extrinsic matrix to obtain world coordinate information includes: The intermediate coordinate information is transformed according to the second formula and the camera extrinsic parameter matrix to obtain world coordinate information, wherein the second formula is: In the formula, The rotation matrix describes the rotation of the camera in the world coordinate system. A vector describing the translation of the camera in the world coordinate system. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system.

5. The method for determining the outer diameter of a capillary tube according to claim 1, characterized in that, The equation of the first ellipsoid is: In the formula, Let be the distance from the laser point to the first focal point. Let be the distance from the laser point to the second focal point. , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as These are the coordinates of the first focus of the ellipsoid along the x-axis, y-axis, and z-axis in the world coordinate system. , as well as These are the coordinates of the second focus of the ellipsoid along the x-axis, y-axis, and z-axis in the world coordinate system. For sum constants; The step of determining the capillary tilt angle based on the coordinate difference and the laser line spacing length includes: The inclination of the capillary tube is determined based on the third formula, the coordinate difference, and the laser line spacing length, wherein the third formula is: In the formula, , as well as These represent the differences between the x-axis, y-axis, and z-axis coordinates, respectively. Let be the angle between the projection of the capillary tube onto the xy-plane and the x-axis. Let be the angle between the projection of the capillary tube onto the xz plane and the x-axis. To take into account the tilt, The length of the laser line spacing. It is an inverse cosine function.

6. The method for determining the outer diameter of a capillary tube according to any one of claims 1-5, characterized in that, Using one of the two world coordinate information as the outer diameter estimation coordinate information, the step of performing circular fitting based on the inclination and the two world coordinate information to obtain the capillary outer diameter includes: Based on the stated inclination, a fourth ellipse equation is constructed using the major and minor axes, wherein the fourth ellipse equation is: In the formula, , as well as These are the x-axis, y-axis, and z-axis coordinates of the laser point in the world coordinate system, respectively. , as well as The rotation of the laser point in the xz coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. , as well as The rotation of the laser point in the xy coordinate plane is respectively The coordinates of the x-axis, y-axis, and z-axis after the angle. For the long axis, For the short axis, Where is the radius of the capillary tube. Let be the angle between the capillary tube and the x-axis in the xy-plane. The angle between the capillary tube and the x-axis in the xz plane; Based on the estimated coordinate information of the outer diameter, the fourth ellipse equation is fitted using the least squares method or the random sampling consensus algorithm to obtain the fifth ellipse equation; The capillary diameter is determined based on the capillary radius in the fifth ellipse equation.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6 above.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6 above.

Citation Information

Patent Citations

  • Online detection method for size of moving steel pipe

    CN118602978A

  • Visual inspection method and device for straightness of pipe

    CN119573610A