A Multi-Vision Method for Measuring the Dimensions of Small Workpieces Based on a Binocular Vision System
By employing a multi-vision measurement method based on a binocular vision system, and utilizing checkerboard corner point extraction and stereo matching algorithms, the problem of measuring the three-dimensional dimensions of small workpieces was solved, achieving high-precision three-dimensional dimension measurement.
Patent Information
- Application Number
- CN202310529046.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2043-05-11
AI Technical Summary
Existing technologies make it difficult to accurately measure the three-dimensional dimensions of small workpieces, especially when the workpiece color is similar to the background, which increases the difficulty of measurement.
A multi-vision measurement method based on a binocular vision system is adopted to calculate the three-dimensional dimensions of the workpiece through algorithms such as checkerboard corner point extraction, plane fitting, vertex extraction, and stereo matching.
It achieves three-dimensional measurement of small workpieces at different angles, with an average absolute error of 0.33mm, a total relative error of 0.90%, and a variance of less than 0.01mm², demonstrating high accuracy.
Smart Images

Figure CN116538914B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of small workpiece size measurement technology, and in particular to a multi-vision small workpiece size measurement method based on a binocular vision system. Background Technology
[0002] With the advancement of Industry 4.0, higher demands are being placed on the automation of product processing and inspection in industrial production, especially in the continuous mass production of workpieces, where higher requirements are being placed on dimensional measurement. However, contact measurement methods suffer from drawbacks such as low efficiency, high labor costs, and errors in measurement accuracy due to tool wear, making them unsuitable for industrial automation needs. Non-contact measurement is widely favored due to its high efficiency and low wear resistance. Laser measurement and visual measurement techniques using ordinary light sources are the most commonly used non-contact measurement technologies. Laser measurement uses a camera and a combination of linear laser or structured light to reconstruct the 3D point cloud of the object being measured, and then measures the dimensions through the point cloud. Zhang Zhipeng et al. used 3D laser scanning to obtain point cloud data of the volume of a railway tank car, calculating the dimensions and volume of the tank car. Junchao Zhu et al. proposed a rapid scanning structured light method to realize the calculation and construction of 3D information. Q. Zhou et al. used binocular stereo vision technology combined with Gray code and phase-shift coded structured light for 3D surface measurement. Bangguo Wang et al. used linear lasers and binocular cameras to measure the dimensions of large forgings with an accuracy of 3.0%. Although the laser-based measurement method mentioned above has high measurement accuracy, its equipment structure is complex and the cost is high.
[0003] Visual measurement techniques using ordinary light sources do not require additional specific light sources and have advantages such as simple equipment, high flexibility, high precision, simple operation, and low cost. Therefore, binocular vision measurement has been proposed. Binocular vision uses two cameras to acquire the three-dimensional coordinates of the target object, thereby calculating its size information. This technology has better applicability. Rong Xiang et al. proposed a new method based on binocular vision and relative measurement principles to measure the dimensions of large automotive brake pads. Gangfeng Xiao et al. proposed a new online detection method for the dimensional progress of conical rotating workpieces, achieving rapid and automatic calculation of the straightness and roundness of the conical rotating workpiece with a relative measurement error of less than 3%. Huang JH proposed a method for measuring the hole radius and spacing of large workpieces with planar features based on binocular vision combined with dynamic local planes, realizing the planar dimension measurement of large workpieces. Zhou YQ proposed a binocular vision measurement method based on the internal collaboration of cameras, which achieves accurate dimension measurement of objects by accumulating pixel counts. Lin... Chen et al. proposed a workpiece positioning algorithm based on Zernike moments and angle matching, combined with a stereo matching algorithm based on epipolar geometry and cross-ratio invariance (CMEC), and designed a high-precision measurement method based on binocular vision to measure the length of workpieces. Zhu S et al. used digital image correlation theory based on zero-mean normalized cross-correlation (ZNCC) to realize a method for measuring the depth of scour pits in three dimensions. Although a lot of research has been done on various workpiece size measurement methods, the above methods only measure two-dimensional dimensions and do not achieve three-dimensional size measurement. Furthermore, the angle is limited, especially in scenarios where the workpiece's color is very similar to the background, making three-dimensional size measurement difficult. Therefore, the above methods are not suitable for measuring the three-dimensional dimensions of workpieces. Summary of the Invention
[0004] This invention proposes a multi-vision method for measuring the size of small workpieces based on a binocular vision system, which solves the problem that it is difficult to achieve accurate three-dimensional size measurement.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A multi-view method for measuring the dimensions of small workpieces based on a binocular vision system includes the following steps:
[0007] S1: Chessboard corner point extraction;
[0008] S2: Remove calibration plate
[0009] First, by using the corner point p of the extracted calibration plate... i (x i y i ), calculate the center point p of the calibration plate o (x o y oThe formula is as follows:
[0010]
[0011] Find the outermost points of the chessboard, that is, the four corner points farthest from the center point (Pouter corner point(x,y)), and calculate them using the following formula.
[0012] p outer corner point (x, y) = Max(p(x) i y i )-p o (x o y o ))
[0013] Therefore, the coordinates of the outermost vertex of the chessboard can be calculated as follows:
[0014] p outer vertex (x,y)=K*(p outer corner point (x, y)-(K-1)*p o (xo, y) o ), where K is a variable coefficient that represents the relationship between the distance from the center of the chessboard to the outermost corner of the chessboard and the coordinates of the distance from the center of the chessboard to the outermost vertex of the chessboard;
[0015] S3: Plane fitting;
[0016] S4: Vertex extraction;
[0017] S5: Stereo Matching Algorithm
[0018] First, calculate the center of the workpiece vertices, then decenter the vertices and normalize the coordinates of the left and right vertices to the workpiece coordinate system O. W Next, by calculating the Euclidean distance between the corresponding points, the best match is found when the sum of their Euclidean distance errors is minimized.
[0019] S6: Dimension calculation.
[0020] Preferably, the stereo matching algorithm in step S5 above specifically includes the following: taking the left image vertex as P l (x li ,y li ); i = 0, ..., 3; the right vertex of the image is P. r (x ri ,y ri ); i = 0,…,3; the image size is m×n. First, determine the center coordinates of the vertices of the left and right workpieces (O). l Let O be the center coordinate of the vertex of the left workpiece. r Let the coordinates of the center of the vertex of the right workpiece be (where the coordinates are), then we have the formula:
[0021]
[0022] Establish workpiece coordinate systems with the centers of the left and right workpiece vertices as origins. In these workpiece coordinate systems, the coordinates of the left image vertex can be represented as P. lw (x li y li ): i = 0, ..., 3; the right vertex of the graph is P. rw (x ri y ri i = 0, ..., 3; This normalizes the two coordinate systems into a single coordinate system, as shown in the following formula:
[0023] P lw (x li y li ) = P l (x li y li )-O l (x ol y ol )
[0024] P rw (x ri y ri ) = P r (x ri y ri )-O r (x or y or )
[0025] The minimum distance d was found after four iterations of calculation. error The optimal matching is achieved when the sum of the distances between vertices is minimized. Based on this, a mathematical model for matching is established.
[0026]
[0027] Preferably, the dimension calculation in step S6 above specifically includes the following:
[0028] S6.1: The workpiece vertex P in the left and right images l P r The reconstructed 3D point is represented as P. i (x i y i , z i ), where i = 0, ..., 3, the plane fitted through the corner points of the checkerboard is denoted as Cplane, and therefore the corresponding workpiece vertices and the checkerboard plane are represented as P, respectively. i (x i y i , z i ) and Cplane;
[0029] S6.2: Length and width calculation
[0030] Select P1 as the base point, then select the two points closest to P1, and use the following formula to calculate the length (L) and width (W) of the workpiece.
[0031]
[0032] S6.3: Height Calculation
[0033] Through workpiece vertex P l Find the centroid of the workpiece's upper surface, denoted as P. c (x c y c , z c The formula for calculating the centroid is as follows:
[0034]
[0035] Calculate the centroid P of the upper surface of the workpiece c The distance to the plane Cplane is the height (H) from the checkerboard surface to the upper surface of the workpiece. d The calculation formula is as follows:
[0036]
[0037] In plane fitting, we simplify the formula for the fitted plane. This simplification of the above equation yields the following formula:
[0038]
[0039] Preferably, the chessboard grid has a thickness, so the calculated height needs to be compensated. The thickness of the chessboard grid is measured to be 1.00 mm using a vernier caliper. Therefore, the actual height should be 1 mm higher than the calculated height.
[0040] Preferably, in step S3 above, the planar fitting is performed on the workpiece surface as a quadrilateral.
[0041] Preferably, in step S4 above, vertex extraction refers to extracting sub-pixel corner points on the workpiece.
[0042] The beneficial effects of this invention are:
[0043] 1. A method for measuring workpiece height using the distance from the centroid to the calibration plate plane is proposed, which can accurately measure workpiece height. A method for measuring 3D dimensions in scenarios where workpiece depth cannot be extracted is also proposed, by reconstructing the calibration plate corner points and fitting the plane. This method addresses the issue of dimension measurement at various angles, simplifying 3D dimension measurement. The average absolute error of this method at different angles is 0.33mm, the total relative error is 0.90%, and the variance is less than 0.01mm. 2 This enables relatively accurate measurement of the three-dimensional dimensions of small workpieces from multiple perspectives. Attached Figure Description
[0044] Figure 1 This is a flowchart illustrating a multi-vision method for measuring the size of small workpieces based on a binocular vision system proposed in this invention.
[0045] Figure 2 This is a schematic diagram illustrating the matching principle of a stereo matching algorithm for a multi-vision small workpiece size measurement method based on a binocular vision system proposed in this invention. Detailed Implementation
[0046] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0047] Reference Figure 1 A multi-vision method for measuring the size of small workpieces based on a binocular vision system includes the following steps:
[0048] S1: Chessboard corner point extraction; Place a calibration plate on the workbench, extract the chessboard corner points using the camera calibration principle, and fit the plane where the test bench is located;
[0049] S2: Remove the calibration plate. Besides the workpiece, the acquired image also contains a checkerboard pattern, which affects the extraction of the workpiece's edges and vertices. Therefore, the calibration plate needs to be removed.
[0050] First, by using the corner point p of the extracted calibration plate... i (x i y i ), calculate the center point p of the calibration plate o (x o y o The formula is as follows:
[0051]
[0052] Find the outermost points of the chessboard, that is, the four corner points farthest from the center point. The calculation formula is as follows:
[0053] p outer corner point(x, y) = Max(p(x) i y i )-p o (x o y o ))
[0054] Therefore, the coordinates of the outermost vertex of the chessboard can be calculated as follows:
[0055] p outervevtex (x,y)=K*(p outer coner point (x,y)-(K-1)*p o (x o y o (), where K is a variable coefficient that represents the relationship between the distance from the center of the chessboard to the outermost corner of the chessboard and the coordinates of the distance from the center of the chessboard to the outermost vertex of the chessboard. Here, k is set to 2.3 based on experiments.
[0056] S3: Perform quadrilateral fitting on the workpiece surface;
[0057] S4: Extract sub-pixel corner points on the workpiece;
[0058] S5: Stereo Matching Algorithm
[0059] First, calculate the center of the workpiece vertices, then decenter the vertices and normalize the coordinates of the left and right vertices to the workpiece coordinate system O. W Next, by calculating the Euclidean distance between the corresponding points, the best match is achieved when the sum of their Euclidean distance errors is minimized. When obtaining the vertices of the left and right workpieces, all vertices are arranged in a certain order, but they may not start from the same starting point. Therefore, the order of the four vertices is fixed, and the starting point may not be the same. According to the principle of Euclidean minimum distance similarity, the sum of their distances will be minimized only when the four vertices are correctly matched. A new matching model is established based on this principle.
[0060] The vertex of the left image is P. l (x li y li ); i = 0, ..., 3; the right vertex of the image is P. r (x ri y ri ); i = 0, ..., 3; the image size is m*n. First, determine the center coordinates of the vertices of the left and right workpieces (O). l Let O be the center coordinate of the vertex of the left workpiece. r Let the coordinates of the center of the vertex of the right workpiece be (where the coordinates are), then we have the formula:
[0061]
[0062] Establish workpiece coordinate systems with the centers of the left and right workpiece vertices as origins. In these workpiece coordinate systems, the coordinates of the left image vertex can be represented as P. lw (x li y li ); i = 0, ..., 3; the right vertex of the image is P. rw (x ri y ri i = 0, ..., 3; This normalizes the two coordinate systems into a single coordinate system, as shown in the following formula:
[0063] P lw (x li y li ) = P l (x li y li )-O l (x ol y ol )
[0064] P rw (x ri y ri ) = P r (x ri y ri )-O r (x or y or )
[0065] After four iterations of calculation, the minimum distance is found, that is, the sum of the distances between vertices is minimized, which is the optimal matching. Based on this, a matching mathematical model is established.
[0066]
[0067] pass Figure 2 The 3D matching algorithm provides important information for the measurement of workpiece vertices, and the matching of workpiece vertices improves the accuracy of 3D information recovery.
[0068] S6: Dimension calculations, including the following:
[0069] S6.1: The workpiece vertex P in the left and right images l P r The reconstructed 3D point is represented as P. i (x i y i , z i ), where i = 0, ..., 3, the plane fitted through the corner points of the checkerboard is denoted as Cplane, and therefore the corresponding workpiece vertices and the checkerboard plane are represented as P, respectively. i (x i y i , z i) and Cplane;
[0070] S6.2: Length and width calculation
[0071] Select P1 as the base point, then select the two points closest to P1, and use the following formula to calculate the length (L) and width (W) of the workpiece.
[0072]
[0073] S6.3: Height Calculation
[0074] Through workpiece vertex P l Find the centroid of the workpiece's upper surface, denoted as P. c (x c y c , z c The formula for calculating the centroid is as follows:
[0075]
[0076] Calculate the centroid P of the upper surface of the workpiece c The distance to the plane Cplane is the height (H) from the checkerboard surface to the upper surface of the workpiece. d The calculation formula is as follows:
[0077]
[0078] In plane fitting, we simplify the formula for the fitted plane. This simplification of the above equation yields the following formula:
[0079]
[0080] The checkerboard pattern has thickness, so height compensation is needed for the calculated height. Using vernier calipers, the checkerboard thickness is measured to be 1.00mm. Therefore, the actual height should be 1mm more than the calculated height. This method can quickly and accurately measure the three-dimensional dimensions of a workpiece. The average absolute error at different angles is 0.33mm, the total relative error is 0.90%, and the variance is less than 0.01mm. 2 This enables relatively accurate measurement of the three-dimensional dimensions of small workpieces from multiple perspectives.
[0081] Working principle: First, a calibration plate is placed on the workbench, and the corner points of the checkerboard are extracted using the camera calibration principle to fit the plane where the test bench is located. Then, quadrilateral fitting is performed on the workpiece surface to extract the sub-pixel corner points on the workpiece. Based on the Euclidean distance metric, a decentralized minimum distance sparse vertex stereo matching algorithm (EDMS) is proposed to obtain the centroid of the upper surface of the workpiece using the fitted quadrilateral. Finally, the extracted 2D vertices are used to calculate the corresponding 3D coordinates using triangulation, and the size of the workpiece is obtained through calculation.
[0082] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0083] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0084] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A multi-vision small workpiece size measurement method based on a binocular vision system, characterized in that, The method comprises the following steps: S1: chessboard corner point extraction; S2: removing the calibration board First, the corner points of the extracted calibration board are calculated The center point of the calibration board is calculated The formula is as follows Find the outermost points of the chessboard, that is, the four corner points farthest from the center point The calculation formula is as follows Thus, the coordinates of the outermost vertex of the checkerboard can be calculated as where K is a variable coefficient referred to, which represents the relationship between the distance from the center of the checkerboard to the outermost corner of the checkerboard and the distance from the center of the checkerboard to the outermost vertex of the checkerboard. S3: plane fitting; S4: vertex extraction; S5: stereo matching algorithm; First, the center of the workpiece vertex is calculated, and then the vertex is decentered, and the left and right vertex coordinates are normalized to the workpiece coordinate system O w Next, the Euclidean distance between the corresponding points is calculated, and when the sum of the Euclidean distance errors is the smallest, it is the best match. S6: size calculation; The stereoscopic matching algorithm in the step S5 comprises the following steps: taking the vertex of the left image as , taking the vertex of the right image as , and taking the image size as m*n. First, the vertex center coordinates of the left and right workpieces are determined. is the vertex center coordinate of the left workpiece, is the vertex center coordinate of the right workpiece, and the formula is: , , The workpiece coordinate system is established with the left and right workpiece vertex centers as the origins. In the workpiece coordinate system, the left image vertex coordinates can be expressed as ; the right image vertex is ; thus, the two coordinate systems are normalized into one coordinate system, and the formula is as follows: , , The minimum distance is found after 4 iterations The best match is the one with the minimum sum of distances between the vertices, thus establishing a mathematical model for matching, , The size calculation in the above step S6 specifically comprises the following contents: S6.1: From left and right image workpiece vertices , The reconstructed 3D point representation is denoted as where The plane fitted through the checkerboard corner points is denoted as Cplane, and the corresponding workpiece vertices and checkerboard plane are denoted as and Cplane, respectively. S6.2: length-width calculation selected As the base point, the distance The nearest two points, the length L and the width W of the workpiece are calculated using the following formula, , , S6.3: height calculation By the workpiece vertex , find the workpiece upper surface centroid expressed as , centroid calculation formula as follows: , , , Calculate the centroid of the upper surface of the workpiece The distance from the plane Cplane, which is the height of the checkerboard surface to the upper surface of the workpiece The calculation formula is as follows: , In the plane fitting, we simplify the plane equation formula, where , , , is the coefficient of the plane equation, and thus the height of the workpiece The calculation formula is as follows: 。 2. The multi-vision small workpiece size measurement method based on binocular vision system according to claim 1, characterized in that, The chessboard is of thickness, so the calculated height needs to be compensated for height, which is measured by using a vernier caliper, and the thickness of the chessboard is 1.00 mm, so the actual height should be 1 mm higher than the calculated height.
3. The multi-vision small workpiece size measurement method based on binocular vision system according to claim 1, characterized in that, The plane fitting in the above step S3 is quadrilateral fitting for the workpiece surface.
4. The multi-vision small workpiece size measurement method based on binocular vision system according to claim 1, characterized in that, The vertex extraction in the above step S4 is sub-pixel corner point extraction on the workpiece.
Citation Information
Patent Citations
Binocular-stereoscopic-vision-based workpiece detection and three-dimensional measurement system and detection method
CN106969706A
Multi-ocular stereoscopic vision three-dimensional scanning method and system
CN107621226A
Non-contact type six-degree-of-freedom displacement measuring method based on binocular vision
CN109373912A
Fusion calibration method of three-dimensional laser radar and binocular visible light sensor
CN110349221A
Three-dimensional reconstruction system and method based on panoramic binocular stereo vision
CN114092647A
Cited By
A wind power pile foundation cable overhang height detection method based on binocular vision
CN122492819A