Revolving body size measurement method and system based on binocular vision

By using binocular vision technology, Zhang Zhengyou calibration method and edge detection algorithm in the measurement of gyro body size, the problems of incomplete overlap between dual camera images and reduced matching accuracy in reflective weak texture areas are solved, and high-precision and robust gyro body size measurement are achieved.

CN119879721AActive Publication Date: 2025-04-25ZHEJIANG SCI-TECH UNIV

Patent Information

Application Number
CN202411526585.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-04-25
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

When the prior art collects the gyro image through a dual camera, the incomplete overlap of images leads to the loss of depth information, increasing measurement errors, and the reflective and weak texture areas of the gyro body reduce matching accuracy, resulting in large dimensional measurement errors.

Method used

Using a gyro body size measurement method based on binocular vision, a plurality of contour points of the gyro body are collected by the first camera and the second camera, a binocular imaging model is established, and a camera calibration and image correction are used to perform camera calibration and image correction, and the contour coordinates are determined in combination with an edge detection algorithm and a cross-correlation algorithm, and the axial coordinates and radius of the gyro body are calculated.

Benefits of technology

It effectively compensates for the viewing angle occlusion error, avoids the influence of reflective and weak texture areas on measurement accuracy, improves the accuracy and robustness of dimensional measurement, and is suitable for swing bodies of different materials, colors and textures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119879721A_ABST
    Figure CN119879721A_ABST
Patent Text Reader

Abstract

The invention provides a revolved body size measurement method and system based on binocular vision, and relates to the technical field of size measurement, and the method comprises the steps: obtaining a to-be-measured revolved body; acquiring a first contour point and a second contour point of the to-be-measured revolving body on a revolving body plane perpendicular to the diameter of the to-be-measured revolving body and a first image of the to-be-measured revolving body through a first camera, and acquiring a third contour point and a fourth contour point of the revolving body plane and a second image of the to-be-measured revolving body through a second camera; establishing a binocular imaging model based on the acquired contour points; calibrating the first camera and the second camera by using a Zhang Zhengyou calibration method so as to perform image correction on the first image and the second image under the condition that the imaging planes of the first camera and the second camera are aligned; in combination with an edge detection algorithm and a cross-correlation algorithm, determining contour coordinates of the to-be-detected rotary body based on the corrected first image and second image; and according to the contour coordinates of the to-be-measured revolving body, calculating the axis coordinates of the to-be-measured revolving body and the radius of the to-be-measured revolving body.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of dimension measurement, and in particular to a binocular vision-based method and system for measuring the dimension of a rotating body. Background Art

[0002] With the rapid development of modern industry, the demand for precision manufacturing and high-quality products continues to increase. The dimensional measurement technology of rotating workpieces has become a key link in the manufacturing industry. The dimensional accuracy of rotating workpieces, such as shafts, cylinders, rollers, etc., is directly related to the performance and life of mechanical equipment. Therefore, high-precision and high-efficiency measurement technology is of great significance for ensuring product quality, reducing costs and improving market competitiveness.

[0003] In traditional industrial production, the measurement of the size of rotating bodies usually relies on manual operation or simple mechanical devices. Although these methods are easy to operate, their limitations gradually become apparent as the scale of production expands and the accuracy requirements increase. Not only are they inefficient, but their accuracy is limited, and they cannot meet the high requirements of modern industrial production for accuracy and efficiency. In order to meet these challenges, the industry has begun to seek more advanced measurement technologies. With the rapid development of computer vision technology, image-based measurement methods have gradually become a research hotspot. These methods use cameras to capture images of objects and extract size information through image processing technology. They have the advantages of non-contact, high speed, and high degree of automation. Using binocular stereo vision to measure rotating workpieces can overcome some limitations of monocular vision systems, such as the lack of depth information. Binocular stereo vision simulates the way people observe objects with both eyes, using two cameras to capture images from different angles to obtain the size information of the object.

[0004] However, in the process of acquiring the image of the rotating body through dual cameras, the actual images captured by the two cameras are not completely overlapped, resulting in the inability to find the pixels of the non-overlapping part during the subsequent multi-image pixel matching, causing the loss of the depth information of the rotating body and increasing the error in the measurement of the rotating body size. In addition, the rotating body itself has reflective and weak texture areas, which further reduces the matching accuracy and increases the error in the measurement of the rotating body size. In addition, existing measurement schemes usually use the width of the rotating body captured by dual cameras directly as the diameter of the rotating body, but based on visual principles, it can be seen that this is not the case. This leads to large errors and insufficient accuracy in the measurement of the rotating body size. Summary of the invention

[0005] In order to solve the problem in the prior art that, during the process of acquiring the image of a rotating body by using dual cameras, the actual images acquired by the two cameras are not completely overlapped, resulting in the inability to find the pixels of the non-overlapping part during the subsequent multi-image pixel matching, resulting in the loss of the depth information of the rotating body and increasing the error in the measurement of the rotating body size. In addition, the rotating body itself has reflective and weak texture areas, which further reduce the matching accuracy and increase the error in the measurement of the rotating body size. In addition, the existing measurement schemes usually take the width of the rotating body acquired by the dual cameras directly as the diameter of the rotating body, but based on the principle of vision, it can be seen that this is not the case. This leads to the problem of large error and insufficient accuracy in the measurement of the rotating body size. The present invention provides a rotating body size measurement method and system based on binocular vision.

[0006] The technical solution provided by the embodiment of the present invention is as follows:

[0007] First aspect

[0008] The embodiment of the present invention provides a binocular vision-based rotating body size measurement method, comprising:

[0009] S1: Obtain the rotating body to be tested;

[0010] S2: using a first camera to collect first contour points, second contour points and a first image of the rotating body to be measured on a rotating body plane perpendicular to the diameter of the rotating body to be measured, and using a second camera to collect third contour points, fourth contour points and a second image of the rotating body to be measured on the rotating body plane;

[0011] S3: establishing a binocular imaging model of the rotating object to be measured based on the first contour point, the second contour point, the third contour point and the fourth contour point;

[0012] S4: calibrating the first camera and the second camera using the Zhang Zhengyou calibration method, so as to perform image correction on the first image and the second image while aligning the imaging planes of the first camera and the second camera;

[0013] S5: combining an edge detection algorithm and a cross-correlation algorithm, and determining the contour coordinates of the rotating body to be measured based on the corrected first image and the second image;

[0014] S6: Calculate the axis coordinates and radius of the rotating body to be measured according to the contour coordinates of the rotating body to be measured.

[0015] Second aspect

[0016] The embodiment of the present invention provides a binocular vision-based rotating body size measurement system, comprising:

[0017] processor;

[0018] A memory having computer-readable instructions stored therein, wherein when the computer-readable instructions are executed by the processor, the method for measuring the size of a rotating object based on binocular vision as described in the first aspect is implemented.

[0019] The third aspect

[0020] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method for measuring the size of a rotating body based on binocular vision as described in the first aspect is implemented.

[0021] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0022] In the present invention, through the multi-view shooting of the binocular camera, the complete contour information of the rotating body is obtained, and the camera optical center origin is used to focus on the contour feature point collection of the rotating body rather than the surface texture, which effectively compensates for the error caused by the perspective occlusion, avoids the influence of the reflection and weak texture area of ​​the rotating body itself on the measurement accuracy, and improves the accuracy of size measurement. In the pixel point matching process, the Zhang Zhengyou calibration method is introduced, skipping the pixel-by-pixel matching process in the binocular algorithm, using the Zhang Zhengyou calibration method to accurately calibrate the camera, and correct the image, combining the edge detection algorithm and the cross-correlation algorithm with the corrected image, accurately extracting the contour coordinates of the rotating body, significantly improving the accuracy and efficiency of feature point matching. Based on the obtained contour coordinates of the rotating body to be measured, the size of the rotating body to be measured, including the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured, can be accurately calculated, even in the case of uneven lighting or unclear surface texture, high-precision measurement results can still be obtained, with good robustness, suitable for rotating bodies of different materials, colors and textures, increasing the measurement application scenarios, and improving the measurement accuracy of the rotating body. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A schematic flow chart of a method for measuring the size of a rotating object based on binocular vision provided by an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of a monocular camera imaging process provided by an embodiment of the present invention;

[0026] Figure 3 An equivalent schematic diagram of monocular camera imaging provided by an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of a binocular camera imaging process provided by an embodiment of the present invention;

[0028] Figure 5 An equivalent schematic diagram of binocular camera imaging provided by an embodiment of the present invention;

[0029] Figure 6 A schematic diagram of epipolar geometry provided in an embodiment of the present invention;

[0030] Figure 7 A schematic structural diagram of a rotating body dimension measurement system based on binocular vision provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0032] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0033] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0034] Reference Manual Attached Figure 1 , which shows a flow chart of a method for measuring the size of a rotating body based on binocular vision provided in an embodiment of the present invention.

[0035] Reference Manual Attached Figure 2 , which shows a schematic diagram of a monocular camera imaging process provided by an embodiment of the present invention.

[0036] Figure 2 In the example, O2 is the second camera selected as a monocular camera for rotating body image acquisition. Figure 21, 2 and 3 correspond to the rotating body to be measured, the camera imaging plane and the second camera respectively, showing the measurement error problem existing in the monocular camera measurement. The rotating body to be measured is regarded as a cylinder, and the camera is used to observe the outer contour points r1 and r2 of the rotating body to be measured on different cross sections on the imaging plane. The object is projected onto a two-dimensional plane, which is represented by a grid in the figure. This plane is also called the projection plane or the view plane, which is parallel to the bottom of the object. Rays connect the points on the 3D object with the projection center. The rays pass through the projection plane to form the projection of the object on the two-dimensional plane. The imaging process of a single camera is as follows: the rotating body is regarded as a cylinder with its axis perpendicular to the ground. Take a vertical axis section of the rotating body, which is perpendicular to the axis of the rotating body and can be regarded as a circle. When the light passes through the rotating body and enters the camera lens, a series of pixel points will be formed on the imaging plane of the camera. These pixel points constitute the projection of the rotating body on the imaging plane. For a section of a vertical axis on the rotating body, a section of pixel points can be obtained on the imaging plane of the camera, and the two ends of the pixel points are the outer contour projection points. According to the pinhole imaging model, the projection point of the outer contour on the imaging plane does not correspond to the outermost edge point on the section of the rotating body, but corresponds to the imaging point of the two light rays that pass through the optical center of the camera and are tangent to the section circle.

[0037] Reference Manual Attached Figure 3 , shows an equivalent schematic diagram of monocular camera imaging provided by an embodiment of the present invention.

[0038] Figure 3 In the figure, R is the true diameter of the section circle, but the projection size corresponding to the outer contour projection point on the imaging plane is E. Using the outer contour projection point to estimate the diameter or width of a rotating body will introduce errors that make the calculation results inaccurate. This error is related to the shooting distance and the diameter of the rotating body and is difficult to decouple. The outer contour projection point in monocular vision cannot be used to estimate the diameter or width of a rotating body. Additional information is required for estimation. According to the pinhole imaging model, the outer contour projection point on the imaging plane does not correspond to the outermost edge point on the section of the rotating body, but corresponds to the imaging point of two light rays that pass through the optical center of the camera and are tangent to the section circle. In the figure, R is the true diameter of the section circle, but the projection size corresponding to the outer contour projection point on the imaging plane is E. A, B, C, and D represent the outer contour points observed by the camera.

[0039] The embodiment of the present invention provides a method for measuring the size of a rotating body based on binocular vision, which can be implemented by a device for measuring the size of a rotating body based on binocular vision, and the device for measuring the size of a rotating body based on binocular vision can be a terminal or a server. The processing flow of the method for measuring the size of a rotating body based on binocular vision can include the following steps:

[0040] S1: Obtain the rotating body to be tested.

[0041] Reference Manual Attached Figure 4 , which shows a schematic diagram of a binocular camera imaging process provided by an embodiment of the present invention.

[0042] Figure 4 In the figure, the two images represent the observation results of the first camera and the second camera on the same cylinder, O1 and O2 are the optical centers of the first camera and the second camera respectively. The grids in each figure represent the imaging planes of the cameras. The projections of the cylinder are displayed on these planes. The projections of the cylinder on the two imaging planes present different viewing angles. The line connecting the optical centers of the two cameras is called the baseline. l1 and l2, r1 and r2 are the outer contour points of the rotating body to be measured collected by the first camera and the second camera respectively.

[0043] S2: The first camera collects the first contour points, the second contour points and the first image of the rotating body to be measured on the rotating body plane perpendicular to the diameter of the rotating body to be measured, and the second camera collects the third contour points, the fourth contour points and the second image of the rotating body to be measured on the rotating body plane.

[0044] Among them, the first camera is one of the two cameras used to obtain the image of the rotating body to be measured. It is responsible for collecting the first contour point, the second contour point and the first image of the entire rotating body to be measured. The second camera is another camera in the binocular vision measurement system. It works with the first camera and is responsible for collecting the third contour point, the fourth contour point and the second image of the rotating body to be measured. The first and second contour points are collected by the first camera, and the third and fourth contour points are collected by the second camera. They are the boundary points of the rotating body on a specific plane, and the subsequent contour calculation depends on the positions of these contour points.

[0045] It should be noted that the two cameras in the binocular vision system collect images of the rotating body from different angles to obtain its multiple contour points. This method can provide a stereoscopic perspective. The contour information under different perspectives is recorded by the first image and the second image respectively, so as to more accurately construct a three-dimensional model of the rotating body. Compared with monocular vision measurement, the binocular system can eliminate the problem of missing depth information caused by a single angle and provide more accurate spatial coordinate and geometric dimension measurement. This dual-perspective imaging method improves the measurement accuracy and robustness.

[0046] Reference Manual Attached Figure 5 , shows an equivalent schematic diagram of binocular camera imaging provided by an embodiment of the present invention.

[0047] Figure 5 In the plane where the first camera imaging plane, i.e., the line connecting the outer contour points l1 and l2, is located, B and C on the circle correspond to the outer contour points l1 and l2 on the imaging plane, and the two light rays line passing through the outer contour points and converging into the optical center of the camera o1-l1 、line o1-l2Tangent to circle, line o1-l1 、line o1-l2 Corresponding to Figure 5 In s1 and s2, Bisector1 is line o1-l1 、line o1-l2 The angle bisector of the second camera imaging plane, A and D on the circle correspond to the outer contour points r1 and r2 on the imaging plane, and the two light rays line passing through the outer contour points converge into the optical center of the camera o2-r1 、line o2-r2 Tangent to the circle, the intersection point O represents the intersection of the two angle bisectors, line o2-r1 、line o2-r2 Corresponding to Figure 5 In the figure, s3 and s4, b represents the distance between the optical centers of the two cameras, c1 and c2 represent the horizontal coordinate values ​​of the optical centers of the first camera and the second camera on their respective pixel planes, and Bisector2 is the line o2-r1 、line o2-r2 The angle bisector of the camera, f represents the focal length, x represents the internal parameters of the camera l1 、x l2 、x r1 、x r2 is the horizontal coordinate value of the pixel of the outer contour point. More specifically, a plane coordinate system is established with the optical center O2 of the second camera as the origin of the coordinate system, the direction O1-O2 of the connecting line of the optical centers of the two cameras as the y-axis, and the direction perpendicular to O1-O2 as the x-axis. These points can be expressed as:

[0048] O1(0,b),O2(0,0),l1(f,bx l1 +c1),l2(f,bx l2 +c2),r1(f,c2-x r1 ),r2(f,c2-x r2 )

[0049] Among them, for any point in space, when this point is photographed by two cameras from different angles, its projection on the imaging planes of the two cameras must satisfy this mathematical relationship, which is determined by the geometric configuration and internal parameters of the camera.

[0050] S3: establishing a binocular imaging model of the rotating object to be measured based on the first contour point, the second contour point, the third contour point and the fourth contour point.

[0051] Among them, the binocular imaging model is a three-dimensional model constructed based on images from different perspectives obtained by two cameras. Through the geometric position of the camera and the captured images, combined with the principle of stereo vision, the binocular imaging model can reconstruct the three-dimensional structure of the object to be tested.

[0052] It should be noted that a binocular imaging model was established through accurate geometric modeling methods, which provided a solid foundation for subsequent three-dimensional reconstruction and precise measurement. By connecting the optical center of the camera with the contour points and projecting these lines on the imaging plane of the camera, the complex three-dimensional spatial relationship was effectively converted into a processable two-dimensional geometric problem.

[0053] In a possible implementation, S3 specifically includes sub-steps S301 to S305:

[0054] S301: Connect the optical center of the first camera with the first contour point and the second contour point respectively to obtain a first connecting line and a second connecting line, and connect the optical center of the second camera with the third contour point and the fourth contour point respectively to obtain a third connecting line and a fourth connecting line.

[0055] Among them, the optical center of the first camera refers to the optical center of the first camera, which is the reference point when measuring from the perspective of the first camera. The lines connecting all contour points are associated with the optical center. The optical center of the second camera is the imaging reference point under the perspective of the second camera. The lines connecting all contour points and the camera imaging plane are related to this point. The first line refers to the straight line between the optical center of the first camera and the first contour point, and the second line refers to the straight line between the optical center of the first camera and the second contour point. They represent the projection path of the contour of the rotating body on the imaging plane of the first camera and are used to calculate the imaging coordinates and spatial position. The third line is the straight line between the optical center of the second camera and the third contour point, and the fourth line is the straight line between the optical center of the second camera and the fourth contour point. These lines are used to describe the contour projection of the rotating body under the perspective of the second camera.

[0056] S302: Output the intersection points of the first and second lines with the first camera imaging plane as the first contour point and the second contour point respectively, and output the intersection points of the third and fourth lines with the second camera imaging plane as the third contour point and the fourth contour point respectively.

[0057] Among them, the first camera imaging plane is the plane where the photosensitive element of the first camera is located, and an image is formed after the light reaches this plane through the camera lens. The second camera imaging plane is similar to the first camera imaging plane. This is the plane where the photosensitive element of the second camera is located. The first contour point and the second contour point are external contour points obtained by the intersection of the first line and the second line with the first camera imaging plane, and the third contour point and the fourth contour point are external contour points generated by the intersection of the third line and the fourth line with the second camera imaging plane.

[0058] S303: Establish a plane coordinate system with the optical center of the second camera as the origin of the coordinate system, the direction of the line connecting the optical center of the first camera and the optical center of the second camera as the extension direction of the y-axis, and the straight line perpendicular to the y-axis as the x-axis.

[0059] The plane coordinate system is a two-dimensional coordinate system based on the x-axis and the y-axis. The origin of the coordinate system is the optical center of the second camera, the y-axis is the direction of the line connecting the optical center of the first camera and the optical center of the second camera, and the x-axis is a straight line perpendicular to the y-axis.

[0060] S304: Determine coordinate information in a plane coordinate system, wherein the coordinate information includes first camera optical center coordinates, second camera optical center coordinates, first contour point coordinates, second contour point coordinates, third contour point coordinates, and fourth contour point coordinates.

[0061] S305: Establish a binocular imaging model based on the coordinate information:

[0062] line o1-l1 :

[0063] line o1-l2 :

[0064] line o2-r1 :

[0065] line o2-r2 :

[0066] Where c1 and c2 represent the horizontal coordinates of the optical center of the first camera and the optical center of the second camera in their respective imaging planes, x l1 、x l2 、x r1 and x r2 Respectively represent the horizontal coordinate values ​​of the first contour point, the second contour point, the third contour point and the fourth contour point in their respective imaging planes, f represents the focal length of the first camera and the second camera, b represents the binocular camera baseline representing the distance from the optical center of the first camera to the optical center of the second camera, line o1-l1 、line o1-l2 、line o2-r1 and line o2-r2 They respectively represent the first connecting line obtained by connecting the first camera optical center o1 and the first outer contour point l1, the second connecting line obtained by connecting the first camera optical center o1 and the first outer contour point l2, the third connecting line obtained by connecting the second camera optical center o2 and the third outer contour point r1, and the fourth connecting line obtained by connecting the second camera optical center o2 and the fourth outer contour point r2, and x and y respectively represent the horizontal and vertical coordinates of the corresponding connecting lines in the plane coordinate system. .

[0067] It should be noted that the coordinate system of the binocular imaging system is accurately constructed through geometric modeling. This process first obtains a connecting line by connecting the camera optical center and the contour points, then determines the position of the contour points on the imaging plane, and establishes a two-dimensional plane coordinate system through the camera optical center and the camera imaging plane. This geometric modeling method can effectively convert three-dimensional contour points in space into two-dimensional coordinates, ensuring the accuracy of the subsequent imaging model and the accuracy of the measurement results.

[0068] Reference Manual Attached Figure 6 , showing a schematic diagram of epipolar geometry provided in an embodiment of the present invention.

[0069] Figure 6 In the figure, after obtaining the internal and external parameters of the two cameras through calibration, due to the installation and manufacturing errors, the relative positions of the two cameras are not in the same plane but have a certain angle, and their imaging meets the epipolar geometry constraint, where O1 and O2 are the optical centers of the left and right cameras, L and R are the imaging planes of the left and right cameras, P is a point in the world coordinate system, p1 and p2 are the imaging points on the pixel planes L and R, and the poles e1 and e2 are the intersection points of the baseline O1O2 and the pixel planes L and R. At this time, the plane formed by O1O2P is called the epipolar plane. Through the principle of epipolar geometry, the pixel point p1 in the left view can be mapped to the epipolar line J2 in the right view, which greatly reduces the range of finding its corresponding point p2 with the same name. However, the amount of calculation of the epipolar line corresponding to each pixel one by one is still very large. In fact, the associated two epipolar lines J1 and J2 are located on the same epipolar plane and share the same epipolar constraint. As the epipolar plane rotates, all view pixels can be represented by a certain epipolar line. By rearranging the pixels on the epipolar line so that the pixels on the same epipolar line are located in the same row, the row number is used to directly associate the pixel point p1 of the left view with its candidate pixel of the same name in the right view, which differs only in the column coordinates. This process is called epipolar correction, which avoids pixel-by-pixel calibration and greatly improves the calibration efficiency. The binocular vision system is converted to an ideal configuration so that the imaging surfaces of the two cameras are coplanar and vertically aligned. After correction, the projections of the points in the scene in the two cameras will appear on the same row. Through this calibration, the accurate pixel coordinate conversion relationship of the images captured by different cameras is obtained, and then the distortion of the captured images is corrected, thereby improving the measurement accuracy of the size of the rotating body.

[0070] S4: Calibrate the first camera and the second camera using the Zhang Zhengyou calibration method to perform image correction on the first image and the second image while aligning the imaging planes of the first camera and the second camera.

[0071] Among them, the Zhang Zhengyou calibration method is one of the classic methods for camera calibration, proposed by Chinese scientist Zhang Zhengyou. This method calculates the camera's internal parameters (such as focal length, principal point position, distortion coefficient, etc.) and external parameters (such as the camera's position and posture in the world coordinate system) by taking images of known structures (such as a chessboard), thereby accurately calibrating the camera geometrically. The Zhang Zhengyou calibration method obtains the camera's geometric parameters, aligns the camera's imaging plane, and corrects the image, providing an accurate basis for subsequent image processing and size measurement.

[0072] In a possible implementation, S4 specifically includes sub-steps S401 to S404:

[0073] S401: Performing single-object positioning on the first camera and the second camera respectively to obtain camera internal parameters, wherein the camera internal parameters include focal length, optical center coordinates, and distortion coefficient.

[0074] S402: Acquire a first camera epipolar line located on a first camera imaging plane and a second epipolar line located on a second camera imaging plane respectively.

[0075] Among them, the first camera epipolar line is a straight line formed on the imaging plane of the first camera. The epipolar line is an important concept in binocular stereo vision. It represents the projection path of the disparity information corresponding to a certain point in the image of another camera. The second camera epipolar line is a straight line formed on the imaging plane of the second camera. It is also related to the disparity information and is the projection of the contour point obtained through the second camera's perspective on the imaging plane.

[0076] S403: Mapping the pixel points of the first epipolar line to the second epipolar line, rearranging the pixel points of the first epipolar line so that the pixel points of the first epipolar line and the second epipolar line are located on the same straight line, so as to align the first camera imaging plane and the second camera imaging plane.

[0077] S404: Perform image correction on the first image and the second image according to the camera internal parameters and the rearranged pixel points.

[0078] It should be noted that, first, the internal parameters of the camera, including focal length, optical center coordinates and distortion coefficients, are obtained through single-target positioning. These parameters can correct the perspective deformation and lens distortion of the camera. Then, the imaging planes of the two cameras are aligned using the epipolar correction method to ensure that the images from the two perspectives can accurately correspond on the same plane. This correction step greatly improves the image alignment accuracy of the binocular vision system, making the subsequent 3D reconstruction and size measurement more accurate and reliable.

[0079] In a possible implementation, the first camera epipolar line is a line connecting a first imaging point of the point to be measured in the first camera imaging plane and a first pole, and the second camera epipolar line is a line connecting a second imaging point of the point to be measured in the second camera imaging plane and a second pole, wherein the first pole and the second pole are intersection points of the baseline and the first camera imaging plane and the second camera imaging plane, respectively.

[0080] S5: Combining the edge detection algorithm and the cross-correlation algorithm, the contour coordinates of the rotating body to be measured are determined based on the corrected first image and the second image.

[0081] Among them, the edge detection algorithm is an algorithm used to extract the edges of objects from images. It can identify significant grayscale changes in images, which usually indicate the boundaries of objects. The cross-correlation algorithm is an algorithm used to compare the similarity of two sequences or signals. It evaluates the similarity of two images or image regions by comparing the positional relationship between different pixels or contour points in the images. The contour coordinates of the rotating body to be measured are the coordinate points of the outer contour of the rotating body determined by edge detection and cross-correlation algorithms. These coordinate points are used to accurately describe the shape of the rotating body and provide data support for subsequent size measurement and three-dimensional reconstruction.

[0082] It should be noted that by combining the edge detection algorithm and the cross-correlation algorithm, the contour coordinates of the rotating body can be accurately extracted from the corrected image. The edge detection algorithm effectively identifies the boundary of the rotating body, and the cross-correlation algorithm ensures that the corresponding contour points are accurately matched in the image taken from the binocular perspective. This process greatly improves the accuracy of contour extraction and ensures the consistency of images taken from different perspectives in three-dimensional space.

[0083] In a possible implementation, S5 specifically includes sub-steps S501 and S506:

[0084] S501: extracting edge contours from the corrected first image and the second image using an edge detection algorithm, wherein the edge detection algorithm includes a structured forest algorithm.

[0085] Among them, the structural forest algorithm is an advanced algorithm for edge detection. It uses machine learning methods to identify structural features in images and extract edges. The structural forest algorithm can accurately extract edge information in complex images and is more robust and accurate than traditional edge detection algorithms.

[0086] S502: retaining edge contours whose edge contour strength is greater than a preset edge contour strength.

[0087] Among them, edge contour intensity refers to the intensity or contrast of the edge identified by the edge detection algorithm in the image. The higher the edge contour intensity, the more significant the grayscale change in the image, which usually indicates that the contour is more obvious and clear. The preset edge contour intensity is a threshold set by the user according to the measurement requirements, which represents the minimum intensity for retaining the edge contour. Only edge contours with an intensity higher than this preset value will be retained and further processed.

[0088] It should be noted that those skilled in the art can set the preset edge profile strength according to actual needs, and the present invention is not limited thereto.

[0089] S503: Extracting the first image centroid and the second image centroid from the retained image edge contour, and respectively calculating a first distance sequence from the first image centroid to edge points of the edge contour to which it belongs and a second distance sequence from the first image centroid to edge points of the edge contour to which it belongs.

[0090] Among them, the first image centroid refers to the centroid of the corrected first image, the second image centroid refers to the centroid of the second image, the first distance sequence is a sequence composed of the distances from the centroid of the first image to all edge contour points in the first image, and the second distance sequence is a sequence composed of the distances from the centroid of the second image to all edge contour points in the second image, which reflects the contour shape of the rotating body in the second image.

[0091] S504: Select a standard rotating body, and use the distance sequence of the standard rotating body as a standard distance sequence, wherein the standard rotating body is a rotating body with a known shape and known parameters.

[0092] S505: Calculate the mutual correlation coefficients between the first distance sequence, the second distance sequence and the standard distance sequence respectively.

[0093] Among them, the standard distance sequence is the distance set from the center of mass of the standard rotation body to the edge contour point, and the mutual correlation coefficient is a statistical indicator used to measure the similarity of two sequences. It compares the correlation of the two sequences to obtain their matching degree.

[0094] S506: Select the image belonging to the distance sequence having the highest mutual correlation coefficient with the standard distance sequence as the target image, and output the edge contour coordinates corresponding to the target image as the contour coordinates of the rotation body to be measured.

[0095] Among them, the target image is the best image selected from the corrected first image or the second image. By calculating the distance sequence with the highest cross-correlation coefficient with the standard distance sequence, the image that best meets the standard shape of the rotating body is determined. This is the so-called target image. The edge contour coordinates are the specific coordinate point set of the boundary of the rotating body in the image. By extracting the contour coordinates in the target image, the external shape of the rotating body to be measured can be obtained, which can be used for accurate size calculation.

[0096] It should be noted that the geometric features of the body of revolution can be effectively captured by extracting high-quality contours through the edge detection algorithm and combining the distance sequence analysis between the center of mass and the edge points. In addition, the most matching target image is selected by comparing the cross-correlation coefficient with the standard distance sequence, which ensures the accuracy and reliability of the contour information. The entire process accurately and robustly extracts the contour coordinates of the body of revolution, providing a solid foundation for subsequent size calculation and modeling, especially in complex scenes.

[0097] S6: Calculate the axis coordinates and radius of the rotating body to be measured according to the contour coordinates of the rotating body to be measured.

[0098] Among them, the axis coordinates of the rotating body to be measured are the coordinates of the center point of the rotating body to be measured. The coordinates are calculated by algebraic or geometric methods under the binocular imaging model, representing the axis position of the rotating body. The radius of the rotating body is an important parameter describing the external dimensions of the object. It is calculated based on the binocular imaging model and combined with the contour information of the rotating body.

[0099] It should be noted that the axis coordinates and radius of the rotating body to be measured can be accurately calculated through the binocular imaging model combined with algebraic or geometric methods.

[0100] In a possible implementation, based on the binocular imaging model, the axis center coordinates and the radius of the rotating body to be measured are calculated by an algebraic method or by a geometric method.

[0101] In a possible implementation manner, the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured are calculated by algebraic method as follows:

[0102] Set the unknown circle center coordinates.

[0103] Assume an arbitrary center position (h, k) and radius r0. For each line, use the point-to-line distance formula to calculate the distance from the center of the circle to the tangent line, which is equal to the radius:

[0104]

[0105] Among them, r0 represents the radius of any circle, m represents the slope of the straight line, and c represents the intercept of the straight line.

[0106] The distances between the unknown circle center coordinates and the first connecting line, the second connecting line, the third connecting line and the fourth connecting line are calculated respectively.

[0107] Calculate the difference between the square of the interval distance and the radius of the rotating body to be measured.

[0108] Create an error function based on the difference:

[0109]

[0110] Where (h, k) represents the coordinates of the unknown circle center, r represents the radius of the rotating body to be measured, E(h, k, r) represents the error function about (h, k, r), and m i and c i They represent the slope and intercept of the i-th line respectively.

[0111] The error function is solved with the goal of minimizing the error function value, and the minimum error function value obtained is output.

[0112] Calculate the coordinates of the center of the unknown circle with the minimum error function value.

[0113] The calculated unknown circle center coordinates are output as the axis center coordinates of the rotating body to be measured.

[0114] Substitute the axis coordinates of the rotating body to be measured into the error function to obtain the radius of the rotating body to be measured.

[0115] In a possible implementation manner, the axis coordinates and the radius of the rotating body to be measured are calculated by a geometric method as follows:

[0116] S601: Calculate the first angle bisector between the first connecting line and the second connecting line and the second angle bisector between the third connecting line and the fourth connecting line respectively.

[0117] Among them, the first angle bisector is the angle bisector between the first line and the second line. The angle bisector refers to a line segment that evenly divides two angles. The second angle bisector is the angle bisector between the third line and the fourth line. It plays the same role as the first angle bisector, but it comes from the perspective of the second camera and represents the geometric midpoint of the two contour points.

[0118] S602: Calculate the coordinates of the intersection of the first angle bisector and the second angle bisector.

[0119] The intersection coordinates refer to the coordinates of the intersection point of the first angle bisector and the second angle bisector.

[0120] S603: Output the intersection coordinates as the axis coordinates of the rotating body to be measured.

[0121] S604: Substitute the axis coordinates of the rotating body to be measured into the first connecting line, the second connecting line, the third connecting line or the fourth connecting line to obtain the radius of the rotating body to be measured.

[0122] It should be noted that the line connecting the optical centers of the two cameras and the contour points provides an intuitive and effective way to determine the axis coordinates of the rotating body through the geometric relationship of the intersection of the angle bisectors. This process does not rely on complex mathematical formulas, but is based on simple and robust geometric properties, making the calculation process fast and efficient. Then, by further substituting the axis coordinates into the line to solve the radius of the rotating body, the whole process simplifies complex three-dimensional calculations and ensures accuracy, which is very suitable for fast measurement needs in practical applications.

[0123] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0124] In the present invention, through the multi-view shooting of the binocular camera, the complete contour information of the rotating body is obtained, and the camera optical center origin is used to focus on the contour feature point collection of the rotating body rather than the surface texture, which effectively compensates for the error caused by the perspective occlusion, avoids the influence of the reflection and weak texture area of ​​the rotating body itself on the measurement accuracy, and improves the accuracy of size measurement. In the pixel point matching process, the Zhang Zhengyou calibration method is introduced, skipping the pixel-by-pixel matching process in the binocular algorithm, using the Zhang Zhengyou calibration method to accurately calibrate the camera, and correct the image, combining the edge detection algorithm and the cross-correlation algorithm with the corrected image, accurately extracting the contour coordinates of the rotating body, significantly improving the accuracy and efficiency of feature point matching. Based on the obtained contour coordinates of the rotating body to be measured, the size of the rotating body to be measured, including the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured, can be accurately calculated, even in the case of uneven lighting or unclear surface texture, high-precision measurement results can still be obtained, with good robustness, suitable for rotating bodies of different materials, colors and textures, increasing the measurement application scenarios, and improving the measurement accuracy of the rotating body.

[0125] Reference Manual Attached Figure 7 , shows a schematic structural diagram of a rotating body size measurement system based on binocular vision provided in an embodiment of the present invention.

[0126] The present invention further provides a binocular vision-based rotating body size measurement system 20, which is applied to the above binocular vision-based rotating body size measurement method, comprising:

[0127] Processor 201.

[0128] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, the method for measuring the size of a rotating object based on binocular vision as in the method embodiment is implemented.

[0129] The binocular vision-based rotating body size measurement system 20 provided by the present invention can execute the above-mentioned binocular vision-based rotating body size measurement method and achieve the same or similar technical effects. To avoid repetition, the present invention will not go into details.

[0130] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0131] In the present invention, through the multi-view shooting of the binocular camera, the complete contour information of the rotating body is obtained, and the camera optical center origin is used to focus on the contour feature point collection of the rotating body rather than the surface texture, which effectively compensates for the error caused by the perspective occlusion, avoids the influence of the reflection and weak texture area of ​​the rotating body itself on the measurement accuracy, and improves the accuracy of size measurement. In the pixel point matching process, the Zhang Zhengyou calibration method is introduced, skipping the pixel-by-pixel matching process in the binocular algorithm, using the Zhang Zhengyou calibration method to accurately calibrate the camera, and correct the image, combining the edge detection algorithm and the cross-correlation algorithm with the corrected image, accurately extracting the contour coordinates of the rotating body, significantly improving the accuracy and efficiency of feature point matching. Based on the obtained contour coordinates of the rotating body to be measured, the size of the rotating body to be measured, including the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured, can be accurately calculated, even in the case of uneven lighting or unclear surface texture, high-precision measurement results can still be obtained, with good robustness, suitable for rotating bodies of different materials, colors and textures, increasing the measurement application scenarios, and improving the measurement accuracy of the rotating body.

[0132] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0133] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0134] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When a computer instruction or computer program is loaded or executed on a computer, a process or function according to an embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0135] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0136] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0137] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean 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.

[0138] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0140] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0142] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0143] If the function is implemented in the form of 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, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0144] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, a method for measuring the size of a rotating body based on binocular vision as described in a method embodiment is implemented.

[0145] A computer-readable storage medium provided by the present invention can implement the steps and effects of the rotating body size measurement method based on binocular vision in the above method embodiment. To avoid repetition, the present invention will not go into details.

[0146] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0147] In the present invention, through the multi-view shooting of the binocular camera, the complete contour information of the rotating body is obtained, and the camera optical center origin is used to focus on the contour feature point collection of the rotating body rather than the surface texture, which effectively compensates for the error caused by the perspective occlusion, avoids the influence of the reflection and weak texture area of ​​the rotating body itself on the measurement accuracy, and improves the accuracy of size measurement. In the pixel point matching process, the Zhang Zhengyou calibration method is introduced, skipping the pixel-by-pixel matching process in the binocular algorithm, using the Zhang Zhengyou calibration method to accurately calibrate the camera, and correct the image, combining the edge detection algorithm and the cross-correlation algorithm with the corrected image, accurately extracting the contour coordinates of the rotating body, significantly improving the accuracy and efficiency of feature point matching. Based on the obtained contour coordinates of the rotating body to be measured, the size of the rotating body to be measured, including the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured, can be accurately calculated, even in the case of uneven lighting or unclear surface texture, high-precision measurement results can still be obtained, with good robustness, suitable for rotating bodies of different materials, colors and textures, increasing the measurement application scenarios, and improving the measurement accuracy of the rotating body.

[0148] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0149] There are a few points to note:

[0150] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention, and other structures may refer to the general design.

[0151] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.

[0152] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.

[0153] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for measuring the size of a rotating object based on binocular vision, characterized in that: include: S1: Obtain the rotating body to be tested; S2: collecting, by a first camera, first contour points, second contour points of the rotating body to be measured on a rotating body plane perpendicular to the diameter of the rotating body to be measured, and a first image of the rotating body to be measured, and collecting, by a second camera, third contour points, fourth contour points of the rotating body plane, and a second image of the rotating body to be measured; S3: establishing a binocular imaging model of the rotating object to be measured based on the first contour point, the second contour point, the third contour point and the fourth contour point; S4: calibrating the first camera and the second camera using the Zhang Zhengyou calibration method, so as to perform image correction on the first image and the second image while aligning the imaging planes of the first camera and the second camera; S5: combining an edge detection algorithm and a cross-correlation algorithm, and determining the contour coordinates of the rotating body to be measured based on the corrected first image and the second image; S6: Calculate the axis coordinates and radius of the rotating body to be measured according to the contour coordinates of the rotating body to be measured.

2. The method for measuring the size of a rotating object based on binocular vision according to claim 1, characterized in that: The S3 specifically includes: S301: connecting the optical center of the first camera with the first contour point and the second contour point respectively to obtain a first connecting line and a second connecting line, and connecting the optical center of the second camera with the third contour point and the fourth contour point respectively to obtain a third connecting line and a fourth connecting line; S302: Outputting the intersection points of the first connecting line and the second connecting line with the first camera imaging plane as the first contour point and the second contour point respectively, and outputting the intersection points of the third connecting line and the fourth connecting line with the second camera imaging plane as the third contour point and the fourth contour point respectively; S303: establishing a plane coordinate system with the optical center of the second camera as the origin of the coordinate system, the direction of the line connecting the optical center of the first camera and the optical center of the second camera as the extension direction of the y-axis, and the straight line perpendicular to the y-axis as the x-axis; S304: Determine coordinate information in the plane coordinate system, wherein the coordinate information includes the first camera optical center coordinates, the second camera optical center coordinates, the first contour point coordinates, the second contour point coordinates, the third contour point coordinates, and the fourth contour point coordinates; S305: Establishing a binocular imaging model according to the coordinate information: Where c1 and c2 represent the horizontal coordinates of the optical center of the first camera and the optical center of the second camera in their respective imaging planes, x l1 、x l2 、x r1 and x r2 Respectively represent the horizontal coordinate values ​​of the first contour point, the second contour point, the third contour point and the fourth contour point in their respective imaging planes, f represents the focal length of the first camera and the second camera, b represents the binocular camera baseline representing the distance from the optical center of the first camera to the optical center of the second camera, line o1-l1 、line o1-l2 、line o2-r1 and line o2-r2 They respectively represent a first line connecting the first camera optical center o1 and the first outer contour point l1, a second line connecting the first camera optical center o1 and the first outer contour point l2, a third line connecting the second camera optical center o2 and the third outer contour point r1, and a fourth line connecting the second camera optical center o2 and the fourth outer contour point r2, and x and y respectively represent the horizontal and vertical coordinates of the corresponding lines in the plane coordinate system.

3. The method for measuring the size of a rotating object based on binocular vision according to claim 2, characterized in that: The S4 specifically includes: S401: performing single-target positioning on the first camera and the second camera respectively to obtain camera internal parameters, wherein the camera internal parameters include focal length, optical center coordinates, and distortion coefficient; S402: Acquire a first camera epipolar line located on a first camera imaging plane and a second epipolar line located on a second camera imaging plane respectively; S403: Mapping the pixel points of the first epipolar line to the second epipolar line, and rearranging the pixel points of the first epipolar line so that the pixel points of the first epipolar line and the second epipolar line are located in the same straight line, so as to align the first camera imaging plane and the second camera imaging plane; S404: Perform image correction on the first image and the second image according to the camera internal parameters and the rearranged pixel points.

4. The method for measuring the size of a rotating object based on binocular vision according to claim 3, characterized in that: The first camera epipolar line is a line connecting the first imaging point of the measured point in the first camera imaging plane and the first pole, and the second camera epipolar line is a line connecting the second imaging point of the measured point in the second camera imaging plane and the second pole, wherein the first pole and the second pole are intersection points of the baseline and the first camera imaging plane and the second camera imaging plane, respectively.

5. The method for measuring the size of a rotating object based on binocular vision according to claim 3, characterized in that: The S5 specifically includes: S501: extracting edge contours from the corrected first image and the second image using an edge detection algorithm, wherein the edge detection algorithm includes a structured forest algorithm; S502: retaining edge contours with edge contour strength greater than a preset edge contour strength; S503: extracting a first image centroid and a second image centroid from the retained image edge contour, and respectively calculating a first distance sequence from the first image centroid to edge points of the edge contour to which it belongs and a second distance sequence from the first image centroid to edge points of the edge contour to which it belongs; S504: Select a standard rotating body, and use the distance sequence of the standard rotating body as a standard distance sequence, wherein the standard rotating body is a rotating body with a known shape and known parameters; S505: respectively calculating the mutual correlation coefficients between the first distance sequence and the second distance sequence and the standard distance sequence; S506: Selecting an image belonging to a distance sequence having the highest mutual correlation coefficient with the standard distance sequence as a target image, and outputting edge contour coordinates corresponding to the target image as contour coordinates of the rotating body to be measured.

6. The method for measuring the size of a rotating object based on binocular vision according to claim 1, characterized in that: The S6 is specifically: According to the binocular imaging model, the axis center coordinates of the rotating body to be measured and the radius of the rotating body to be measured are calculated by an algebraic method or by a geometric method.

7. The method for measuring the size of a rotating object based on binocular vision according to claim 6, characterized in that: The specific calculation of the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured by algebraic method is: Set the unknown circle center coordinates; Respectively calculating the interval distances between the coordinates of the center of the unknown circle and the first connecting line, the second connecting line, the third connecting line and the fourth connecting line; Calculate the difference between the square of the interval distance and the radius of the rotating body to be measured; An error function is established based on the difference: Where (h, k) represents the coordinates of the unknown circle center, r represents the radius of the rotating body to be measured, E(h, k, r) represents the error function about (h, k, r), and m i and c i Respectively represent the slope and intercept of the i-th line; Solving the error function with the goal of minimizing the error function value, and outputting the minimum error function value obtained by solving; Calculate the unknown circle center coordinates of the parameters under the minimum error function value; Outputting the calculated unknown circle center coordinates as the axis center coordinates of the rotating body to be measured; Substitute the axis center coordinates of the rotating body to be measured into the error function to obtain the radius of the rotating body to be measured.

8. The method for measuring the size of a rotating object based on binocular vision according to claim 6, characterized in that: The calculation of the axis coordinates of the rotating body to be measured and the radius of the rotating body to be measured by the geometric method is specifically as follows: S601: Calculate a first angle bisector between the first connecting line and the second connecting line and a second angle bisector between the third connecting line and the fourth connecting line respectively; S602: Calculate the coordinates of the intersection of the first angle bisector and the second angle bisector; S603: Outputting the intersection coordinates as the axis coordinates of the rotating body to be measured; S604: Substitute the axis coordinates of the rotating body to be measured into the first connecting line, the second connecting line, the third connecting line or the fourth connecting line to obtain the radius of the rotating body to be measured.

9. A rotating body size measurement system based on binocular vision, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method for measuring the size of a rotating body based on binocular vision as described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a binocular vision-based rotating body dimension measurement method as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Component multiple size measuring method and system based on binocular vision

    CN107588721A

  • Projection image automatic correction method and system based on binocular vision

    CN110830781A

  • Additive component three-dimensional contour reconstruction method and system based on light field imaging

    CN117237546A

  • Stereophotogrammetric method based on binocular vision

    US11959744B1

  • Object detection method, related device and computer storage medium

    WO2020103427A1

Cited By

  • Object size measurement method and related device, security inspection machine and storage medium

    CN120063173A

  • Object Size Measurement Method and Related Device, Security Inspection Machine, and Storage Medium

    CN120063173B

  • Monocular vision large-size revolving body diameter dynamic measurement device and method

    CN120274659A

  • Crankshaft size detection method based on computer vision

    CN120655623A

  • Visual inspection method and device for surface defects of rotary body micro-group hole part

    CN120870142A