Monocular cooperation-based binocular vision box size measurement method
By introducing a monocular camera into a binocular vision system, and using the angle between the target box edge and the binocular camera to establish a measurement model and perform error correction, the problem of large parallax error in binocular vision box measurement is solved, and high-precision measurement of the box's three-dimensional dimensions is achieved, which is particularly suitable for industrial applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEBEI UNIVERSITY
- Filing Date
- 2022-06-21
- Publication Date
- 2026-05-08
AI Technical Summary
When using binocular vision technology to measure the dimensions of a box, the angle between the binocular camera and the side of the box being measured causes a serious measurement error in the far-point parallax value, affecting the measurement accuracy. Furthermore, binocular cameras are expensive and unsuitable for industrial needs.
A binocular vision method with monocular collaboration is adopted. By setting up monocular and binocular cameras on the conveyor belt, the monocular camera is used to obtain the angle between the edge of the target box and the binocular camera, and a measurement model of the length, width and height of the target box is established. Error correction is performed by using an approximate ideal model to reduce the impact of parallax error.
It significantly improves the accuracy of three-dimensional dimension measurement of enclosures, reducing the measurement error of length and width to 0.45% and the measurement error of height to 0.16%, which are 56 times and 17 times higher than traditional methods, respectively, and are suitable for high-precision measurement of industrial enclosures.
Smart Images

Figure CN115222668B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for measuring the three-dimensional information of a stereo target, specifically a binocular vision-based method for measuring the size of a box based on monocular collaboration. Background Technology
[0002] Binocular vision is an important form of machine vision technology. Its basic principle is to use two horizontally placed cameras to simulate human eyes, acquiring images of the same object from different angles. Then, based on the disparity between corresponding points in the left and right images, the 3D dimensions of the object are calculated, thus achieving 2D-to-3D visible surface reconstruction and scale measurement. Yang et al. proposed a stereo matching algorithm for generating digital surface models of water bodies. Through adaptive matching, they achieved accurate disparity and height estimation of the water surface, resulting in a digital surface model with high accuracy and visual quality. Liu et al. proposed a binocular reconstruction algorithm based on laser line constraints. By introducing laser line constraints, establishing three matching modes, and finally creating a binocular reconstruction test system and measurement accuracy evaluation device, they improved the accuracy of overall and single-point measurements. Huang et al. proposed a method for measuring hole radius and spacing based on binocular vision combined with dynamic local planes. This method overcomes the problems of variable working distance and large positioning errors at abrupt edges in traditional methods, improving measurement accuracy by at least 77% and 53% in radius and spacing, respectively. Wang Yuemin et al. segmented discontinuous mirror objects into several continuous surfaces and independently calculated the 3D morphology of each continuous surface through gradient integration. They then used binocular vision to calculate the absolute spatial coordinates of feature points within the continuous region and reconstructed the 3D morphology of the discontinuous mirror object, thus ensuring measurement accuracy while avoiding integration errors between discontinuous surfaces. Liu Shiting et al. proposed a super-resolution imaging ranging method based on binocular zoom. This method uses a zoom system for super-resolution reconstruction, improving the system's imaging resolution and reducing relative ranging errors while keeping other hardware conditions unchanged. Yang et al. proposed a method for estimating height using video sequences from binocular stereo vision, estimating human height through head parallax and the calibration parameters of the binocular camera. Zheng et al., based on a stereo camera, estimated the diameter and length of vegetables by using the pixel positions and depth information of key points.
[0003] When using binocular vision technology to measure the dimensions of a box, there will be a certain angle between the binocular camera and the side of the box being measured. Since the camera resolution is fixed, the parallax at the far point will produce a serious measurement error, which will greatly affect the measurement accuracy. Using a multi-camera binocular camera can avoid the problem of increased parallax error at the far point, but binocular cameras are expensive and not suitable for industrial needs. Summary of the Invention
[0004] The purpose of this invention is to provide a binocular vision-based box size measurement method based on monocular collaboration, so as to achieve more accurate box size measurement and reduce industrial application costs.
[0005] This invention is implemented as follows: a binocular vision-based box size measurement method based on monocular collaboration, comprising the following steps:
[0006] S1. Construction of the measurement system: A base with a conveyor belt attached to the platform is set up. A support pole is set up next to the conveyor belt, and a horizontal bar on the support pole spans over the conveyor belt. A monocular camera is set on the horizontal bar, and the camera of the monocular camera is set vertically downward. A binocular camera is set on the vertical bar of the support pole. The camera of the binocular camera is perpendicular to the movement direction of the conveyor belt, and the height of the binocular camera is such that the camera is at half the height of the target box. A preset straight line is drawn on the conveyor belt on the side close to the binocular camera. The preset straight line is consistent with the movement direction of the conveyor belt.
[0007] S2. Setting the target box: Place the target box on the conveyor belt, with the length direction of the target box deviating from the direction of movement of the conveyor belt, and the target box not in contact with the preset straight line; start the conveyor belt to move forward carrying the target box, and stop the conveyor belt after one of the side edges of the target box close to the binocular camera enters the central area of the field of view of the monocular camera, keeping the position of the target box unchanged.
[0008] S3. Processing of binocular images: Two panoramic original images of the target box are acquired by the binocular camera. The background image in the two original images is removed by the image segmentation operation to obtain two target images containing only the target box. The corner points of the target box are marked on the two target images, and the corner point detection algorithm is used to obtain the corner point coordinates of each box. The disparity value corresponding to each box corner point is calculated respectively.
[0009] S4. Monocular Image Processing: A local original image of the target box within the camera's field of view is acquired by a monocular camera. An edge detection algorithm is used to detect the box's edge and a preset straight line within the original image. The target box's edge line in the image is then subjected to a Hough transform to obtain three intersecting straight lines representing the target box's edge and the preset straight line, along with their coordinate parameters in polar coordinates. The angle between two edge lines of the target box and the preset straight line is then calculated; this angle is called the preset angle. ;
[0010] S5. Establish a height measurement model and measure the height of the target container:
[0011] S5-1 Establishing the elevation line P 11 P 12The height measurement model is as follows:
[0012] (7)
[0013] in, For the high line P 11 P 12 The actual length, For P 11 P 12 The average of the disparity values of the two points ; , Let x be the x-coordinate of the two points on the image plane; , The vertical coordinate of the image plane;
[0014] S5-2 High Line P 21 P 22 With high line P 31 P 32 The actual length , The result is obtained by analogy with formula (7);
[0015] S5-3 After calculating the three elevation lines using formula (8), the average value is used to obtain the measurement result of the target box height:
[0016] (8)
[0017] in, For the high line P 21 P 22 The actual length, For the high line P 31 P 32 The actual length;
[0018] S6. Establish a length measurement model and measure the length of the target box:
[0019] S6-1 When projection point P1 is projected to the left of principal point o, what is the true length of length line P1P2? The measurement model is as follows:
[0020] (14)
[0021] Where b is the horizontal baseline distance between the focal points of the two cameras in the stereo camera, and f is the focal length of the stereo camera. Let P2 be the disparity value. Let P1 be the x-coordinate. Let P2 be the x-coordinate. Let x be the x-coordinate of the principal point of the image on the left image plane. This is the preset angle, which is also the angle between the edge line of the target box and the image plane of the binocular camera;
[0022] S6-2 When projection point P1 is projected to the right of principal point o, what is the true length of length line P1P2? The measurement model is as follows:
[0023] (16)
[0024] S6-3 The length of the target box is calculated in two cases using formulas (14) and (16);
[0025] S7. Establish a width measurement model and measure the width of the target box:
[0026] S7-1 establishes the width measurement model for projection point P1P1 as follows:
[0027] (17)
[0028] in, For P 11 Parallax of a point For P 12 Parallax of a point Let y be the principal point's ordinate. For P 11 The ordinate of the point, For P 12 The ordinate of the point, w is the weighting coefficient;
[0029] When measuring the width of S7-2, the coordinates of the corresponding corner points are substituted into formula (17) to estimate the width edge coordinates of the target box on the coordinate axis.
[0030] The measurement method of this invention introduces a preset angle between the edge of the target box and the binocular camera. A measurement model of the target box regarding its length and width is established; using an approximate ideal model and after error correction, a height model of the target box is established; thus, the accurate three-dimensional dimensions of the target box are calculated. Then, based on a preset angle... Based on the size and coordinate position, the corresponding measurement model is automatically selected to measure the three-dimensional dimensions of the target box. This invention's measurement method introduces a preset angle into the length and width measurement models of the target box. In height measurement, the ideal measurement model of a binocular camera is used to obtain the height value of the target box and perform error correction, thereby solving the problem of large measurement error caused by parallax error in the traditional binocular vision target box size measurement method.
[0031] This invention introduces a monocular camera into a traditional binocular vision-based 3D box measurement system to assist in obtaining the angle between the box edge and the binocular camera. A corresponding algorithm is derived to shield the impact of far-point parallax error on measurement accuracy in the length and width measurement models, while also significantly suppressing the impact of near-point parallax error. Regarding improving the performance of the height measurement model, the height value is obtained through an ideal binocular camera model, and the effects of position and parallax are effectively compensated for, resulting in a corresponding algorithm that improves the measurement accuracy of box height. Comparative experiments were conducted using a measurement system built with actual boxes as the measurement object. The results show that, compared to existing methods, the average error in measuring length and width is 0.45%, a 56-fold improvement in accuracy; the average error in height measurement is 0.16%, a 17-fold improvement in accuracy. This significantly improves measurement accuracy and makes the method particularly suitable for high-precision 3D measurement of boxes in the logistics industry. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the measurement system used in the measurement method of the present invention; in the figure: 1, binocular camera, 2, conveyor belt, 3, preset straight line, 4, target box, 5, monocular camera, 6, guide rail, 7, image processing system, 8, base.
[0033] Figure 2 This is a flowchart of the algorithm used in the measurement method of this invention.
[0034] Figure 3 This is a demonstration diagram of binocular image processing; among them, Figure 3 (a) is the original binocular image. Figure 3 (b) is a diagram showing the segmentation result of the target box. Figure 3 (c) is the corner detection result diagram.
[0035] Figure 4 This is a demonstration diagram of monocular image processing; among them, Figure 4 (a) is the original monocular image. Figure 4 (b) is the edge detection result image. Figure 4 (c) is a graph showing the angle measurement results.
[0036] Figure 5 It is a statistical chart of measurement errors.
[0037] Figure 6 This is a schematic diagram of the target box being imaged on the left image plane.
[0038] Figure 7 This is a schematic diagram of the measurement principle.
[0039] Figure 8 yes < The principle diagram for length calculation.
[0040] Figure 9 yes > The principle diagram for length calculation.
[0041] Figure 10 This is a comparison chart of measurement errors; among them, Figure 10 (a) is the captured image. Figure 10 (b) is a length error statistics chart. Figure 10 (c) is a height error statistics chart. Detailed Implementation
[0042] The measurement method of the present invention will be further described in detail below with reference to the accompanying drawings.
[0043] The measurement method of the present invention includes the following steps:
[0044] Step S1: Construct the measurement system used in the measurement method of the present invention.
[0045] like Figure 1 As shown, an L-shaped support rod 6 is installed on one side of the conveyor belt 2. The horizontal bar of the L-shaped support rod 6 spans above the conveyor belt 2. A binocular camera 1 is installed on the vertical bar of the L-shaped support rod 6. The binocular camera 1 is perpendicular to the transmission direction of the conveyor belt 2 and parallel to the edge of the conveyor belt 2. A monocular camera 5 is installed on the horizontal bar of the L-shaped support rod 6. The monocular camera 5 is located above the conveyor belt 2 and is vertically downward. A preset straight line 3 is marked on the conveyor belt 2 near the binocular camera 1. This preset straight line 3 is parallel to the edge of the conveyor belt 2 and is used to obtain the angle between the extended lines of the two lower edges of the target box near the corner and the preset straight line 3. This angle is represented as the preset angle of the target box. This included angle is also the angle between the target housing 4 and the image plane of the binocular camera 1. (Preset included angle) The setting is to better obtain the three-dimensional dimensions of the target box 4, and also to reduce the impact of angle measurement errors on the system measurement.
[0046] Step S2: Set the target box in the measurement system.
[0047] Place the target box 4 on the conveyor belt 2, with the length of the target box 4 deviating from the direction of movement of the conveyor belt 2, and the target box 4 not in contact with the preset straight line 3. Start the conveyor belt to move the target box 4 forward. Once one side edge of the target box 4 near the binocular camera 1 enters the central area of the field of view of the monocular camera, stop the conveyor belt and keep the position of the target box 4 unchanged.
[0048] Step S3: Processing of binocular images.
[0049] Two panoramic raw images of the target box 4 were acquired by the binocular camera 1. Figure 3 (a) By performing image segmentation, the background image is removed from the two original images, resulting in two target images containing only the target box. Figure 3 (b) Mark the corner points of the target box on the two target images. Figure 3 (c) and using a corner detection algorithm, the corner coordinates of each box corner are obtained, and the disparity value corresponding to each box corner is calculated.
[0050] Binocular camera 1 was used to acquire original binocular images. Figure 3 (a) The target box is separated from the background by image segmentation, and then all corners of the target box are obtained by corner detection algorithm.
[0051] Step S4: Monocular image processing.
[0052] like Figure 4 As shown, the monocular image processing procedure is as follows: First, the monocular camera 5 acquires a local raw image of the target box 4 within the camera's field of view. Figure 4 (a) Using an edge detection algorithm, the edge of the target box 4 and the preset straight line in the original image are detected. Figure 4 (b) The edge line of the target box 4 in the image is transformed by Hough transform to obtain three intersecting straight lines representing the edge line of the target box and the preset straight line. Figure 4 (c) and the coordinate parameters of the three straight lines on polar coordinates, and then calculate the angle between the edge line of the target box and the preset straight line, that is, the preset angle. .
[0053] Acquired monocular raw images using a monocular camera 5 ( Figure 4 (a)), edge detection is performed after preprocessing to obtain the edge detection results ( Figure 4 (b) Then, the edge detection results are processed using Hough transform to perform line detection. Figure 4 (c) The principle of the Hough transform is to utilize the duality between points and lines to transform the detection problem in the Cartesian coordinate system to the polar coordinate system. The transformation relationship between the polar coordinate system and the Cartesian coordinate system is as follows:
[0054] (1)
[0055] in, The distance from the origin to the line is denoted as . The angle of inclination from the origin to the perpendicular line is denoted as .
[0056] Preset angle of the target box The calculation formula is:
[0057] (2)
[0058] in, The polar coordinate angle corresponding to the preset straight line will not change when the position of the monocular camera remains unchanged. This is the polar coordinate angle corresponding to the edge of the target box; when the measured edge is the length of the target box, the preset angle is... The preset included angle is a positive number when the measured edge is the width of the target box. It is a negative number.
[0059] The monocular camera used in this embodiment has a resolution of 640×480 pixels. Original monocular images are acquired, and the edges of the target box are detected using an edge detection algorithm. Subsequently, a Hough transform is performed to obtain the angles between each edge of the target box and a preset straight line, i.e., the preset angles. In this embodiment, 20 different target boxes at different preset angles were used as test objects, and the measurement error results are as follows. Figure 5 As shown. The average absolute error of the angle measurement is 0.003°, and the maximum error is 0.0445°. According to... Figure 10 of The results of the systematic error analysis show that when the measurement error is less than 0.05°, the angular error is a factor. The measurement error has a negligible impact on the systematic error caused by the two-length model of this invention.
[0060] Step S5: Establish a height measurement model and measure the height of the target box.
[0061] exist Figure 6 In the schematic diagram of the left image plane imaging of the target box 4 shown, P1P2 is the length of the box, P2P3 is the width of the box, P4P5 is the length of the box, and P... 11 P 12 P 21 P 22 P 31 P 32 These six points are all corner points of the target box 4. The three-dimensional dimensions of the target box are obtained simultaneously using binocular vision; the target box 4 must have a horizontal angle with the binocular camera 1. Figure 1 The angle between P1P2 and the stereo camera 1 is positive, while the angle between P2P3 and the stereo camera 1 is negative.
[0062] exist Figure 7 In the measurement diagram shown, the horizontal distance between the focal points of the two cameras S1 and S2 in the binocular camera is the baseline distance b; the distance between the binocular camera and its corresponding image plane is the focal length f, which can be obtained through calibration; the intersection of the camera's imaging center and the perpendicular line to its corresponding image plane is the principal point. (See diagram.) The principal point of the image on the left image plane; and P1 and P2 are two points on the edge of the line segment being measured in the camera coordinate system; P1 and P2 are respectively and The projection point on the left image plane is projected onto the u-axis of the image plane coordinate system. Then... The spatial coordinates of a point can be obtained from the image information on the left plane:
[0063] (3)
[0064] Where d1 is the disparity value of point P1. The spatial coordinates can also be obtained using formula (3). Then... Spatial distances can be derived using traditional measurement models:
[0065] (4)
[0066] Where d1 and d2 are respectively and The parallax of the target box is calculated using formula (4). The accuracy of traditional box size measurement heavily relies on the accuracy of the two parallax values, d1 and d2. However, due to the influence of camera resolution and other parameter calibrations, it is difficult to obtain accurate parallax values. Especially... Due to the distance from the binocular camera 1, d1 is limited by the camera resolution, leading to increased measurement error. The algorithm of this invention, through collaborative measurement with the monocular camera 5, can effectively reduce the impact of parallax error on the measurement error.
[0067] When the measured line segment P1P2 is parallel to the image planes L and R and coplanar with the two optical centers S1 and S2 of the binocular camera 1, it is considered the ideal binocular measurement state. Because in the ideal state... , , Substituting into formula (4), we get:
[0068] (5)
[0069] Because the binocular camera 1 is placed vertically (e.g.) Figure 6 P4P5 is a parallel binocular camera 1 with equal x-coordinates. According to formula (3), the true length of P4P5 is:
[0070] (6)
[0071] in, This is the actual length of P4P5; , These are the ordinate values of points P4 and P5 in the image plane coordinate system, respectively. Let P4 and P5 be the disparity values.
[0072] Figure 6 In the image, there are three elevation lines exposed within the binocular field of view. Each elevation line is theoretically parallel to the y-axis of the image plane, and the disparity values of the corresponding two corner points are theoretically the same. Therefore, the length of each elevation line can be calculated by substituting the coordinates of the corresponding detected corner point into formula (6). However, in actual measurement, corner point detection inevitably has deviations or the target box itself has defects, causing the vertical edge of the target box to be not perpendicular to the ground. In this case, the possible angular deviation can be calculated by measuring the coordinates of two points to compensate for the error. Figure 6 High line P in the middle 11 P 12 For example, its actual height calculation model is as follows:
[0073] (7)
[0074] in, For the high line P 11 P 12 The actual length, For P 11 P 12 The average of the disparity values of the two points ; , Let x be the x-coordinate of the two points on the image plane; , y is the ordinate of the image plane.
[0075] Similarly, the high line P 21 P 22 High line P 31 P 32 The actual length , It can also be calculated using formula (7). Finally, after calculating the three elevation lines using formula (8), the average value can be used to obtain the measurement result of the target box height:
[0076] (8)
[0077] in, and for Figure 6 Middle and high line P 21 P 22 and high line P 31 P 32 The actual length. The height of the target box is determined by... Figure 6 The lengths of the three elevation lines are calculated on the left image plane, and the average of all elevation line lengths is taken as the final measured height value.
[0078] Step S6: Establish a length and width measurement model and measure the length and width of the target box.
[0079] like Figure 6 As shown, before measurement, the target box and the binocular camera need to be positioned at a preset angle to ensure that all information about the target box is obtained. After multiple experimental verifications, the included angle on one side of the target box... The corner detection effect is best when the angle is less than 60°. In order to obtain corner information on both sides of the target box at the same time, the preset angle between one side of the target box and the binocular camera should be within the range of 30°~60° before measurement.
[0080] Formula (5) can be used to obtain the line segment length under ideal conditions, but in actual measurement, there is a preset angle between the target box and the phase plane of the binocular camera. When the preset angle When the value is positive, the measured side is the length of the target box, and the calculation is performed in the left image plane of the binocular image; when the preset angle is... When the value is negative, the measured side represents the width of the target box, calculated in the right image plane of the binocular image. The length and width calculations are performed in the left and right image planes of the binocular image, respectively; the principle is the same, so only the details are described here. When the angle is positive, it represents the measurement model for the length of the target box. The length measurement depends on the x-coordinate of the projection point P1. The x-coordinate of the principal point o on the image plane The measurement models differ depending on the size of the comparison.
[0081] exist Figure 8 In the length calculation principle diagram shown, there is a preset angle between the edge of the target box and the image plane of the binocular camera. This angle was obtained using a monocular camera. Now, a straight line is introduced. Passing point And parallel to the two image planes, at this time the straight line and The included angle is , and projection lines They intersect at point A. extension line intersects At point B.
[0082] The length has been obtained from formula (5):
[0083] (9)
[0084] Because of Rt△ Similar to Rt△ Then there is , and They are supplementary angles. The length is , Length is Then we have:
[0085] (10)
[0086] at this time, for:
[0087] (11)
[0088] According to the law of sines It can be obtained through the following formula:
[0089] (12)
[0090] (13)
[0091] (14)
[0092] in, for The disparity value, and Let P1 and P2 be the x-coordinates. is the x-coordinate of the principal point of the left image plane.
[0093] when At times, such as Figure 9 As shown, projection point P1 is projected to the right of the principal image point o. Based on the similarity of triangles, ,and and If they are vertex angles, then:
[0094] (15)
[0095] Length is:
[0096] (16)
[0097] The length of the target box is calculated using formulas (14) and (16) for both cases. Width calculation requires measurement on the right side of the binocular image, and the principle is the same as for length measurement.
[0098] like Figure 6As shown, the above principle only calculates the actual length corresponding to P1P2 in the image. The projection points of the detected target box corners are not on the coordinate axes of the image plane. Due to the pinhole imaging principle, the horizontal edge of the target box is projected as an oblique line at a non-coordinate axis position on the image plane. Therefore, it is necessary to use the obtained corner coordinates to estimate the target box edge coordinates on the coordinate axes.
[0099] For a binocular camera system, the measurement error is proportional to the parallax value of the measurement point. Considering the positional relationship between the corner points and the coordinate axes, the x-coordinates P1 and P2 on the coordinate axes are derived from the following formula:
[0100] (17)
[0101] in, , P respectively 11 P 12 Parallax of a point; The ordinate of the principal point; and For P 11 and P 12 The ordinate of the point. Weighting coefficient. By fully considering the influence of the measurement point location and parallax value, a higher accuracy estimate is obtained. When measuring the width, the coordinates of the corresponding corner points are substituted into formula (17) to estimate the width edge coordinates of the target box on the coordinate axis.
[0102] Method verification: Dimensions of the checkerboard squares were measured.
[0103] To verify the measurement performance of the system of this invention on actual targets, a real-world target experiment was conducted. This experiment was performed on a computer with an AMD Ryzen 4800H CPU with Radeon Graphics, a GeForce GTX 1650 GPU, and 32GB of RAM. The binocular camera 1 was a Bumblebee BB2-03S2M-60, and the monocular camera 5 was an Allied VisionStingray F-046C. The acquired images were processed using Microsoft Visual Studio 2013 with OpenCV version 2.4.11. The intrinsic and extrinsic parameters were obtained using Zhang Zhengyou's calibration method, as shown in Table 1.
[0104] Table 1 Internal and external parameters of the binocular camera
[0105]
[0106] To further compare the actual performance of the algorithm of this invention with that of traditional algorithms, this step uses a calibration board for comparative experiments. Since the calibration board has a large number of blocks of fixed size, measuring the length and height of each block is statistically significant. The chessboard used in this experiment consists of 6×8 blocks. The measured side length of each block on the chessboard is 28.9 mm, and the coordinates of the internal corner points of the chessboard can be obtained through the corner detection algorithm. To test the accuracy of the model of this invention, the outermost blocks are removed, and only the size of the inner 35 blocks is measured. Because the measurement of the length and width of the target object is only done by… The sign of the angle determines the calculation; the model calculation is identical, so only the sign is listed here. When the angle is positive, it corresponds to the measurement result of the target box length. This experiment will use four sets of... The calibration plate with an angle gradually increasing between 30° and 60° was used as the test object. Figure 10 yes Comparison of errors between the two algorithms when the angle is 58.13°.
[0107] like Figure 10 As shown, at the angle In larger cases, it is evident that the algorithm of this invention has lower errors in height and width measurements, and the system is more stable, especially with a more significant improvement in length measurement accuracy. Table 2 lists the comparison data of the average and standard deviation of the errors in the four sets of experimental measurement results.
[0108] Table 2. Measurement error of chessboard pattern (unit: mm)
[0109]
[0110] Analysis of Table 2 shows that, in measuring the length of checkerboard squares, the traditional model relies on the accuracy of the disparity value, resulting in a relatively large average systematic error, which increases with... As the angle increases, the standard deviation of the error in traditional algorithms increases dramatically, leading to significant fluctuations in the measurement results. The average and standard deviation of the error in the length measurement algorithm of this invention are affected by... The impact of corner errors is negligible. In measuring the height of checkerboard squares, since the disparity values of the two corner points are basically the same and there are no relatively remote corner points, the accuracy of traditional algorithms is significantly improved compared to the measurement of their length. However, the height model of this invention further reduces the correlation with disparity errors compared to traditional models and compensates for minor deviations. The measurement results are superior to traditional algorithms, and the average and standard deviation of systematic errors are significantly reduced.
[0111] Effect verification: The measurement effect is verified by measuring the actual target box size.
[0112] This invention uses three target boxes at different distances and angles as test objects. Table 3 shows a comparison of the target box size measurements obtained using the method of this invention and the conventional method.
[0113] Table 3 Measurement Results
[0114]
[0115] As shown in Table 3, the traditional method has the lowest measurement accuracy, with an average error of 25.24% for length and width measurements and 2.75% for height measurements. In the measurement results of the method of this invention, the average error for length and width is 0.45%, a 56-fold improvement in accuracy compared to the traditional method; the average error for height is 0.16%, a 17-fold improvement in accuracy compared to the traditional method. The relative error of the measurement results of the method of this invention for the three groups of experimental objects is less than 0.6%, and the experimental results are stable, demonstrating the high accuracy and reliability of the algorithm used in the measurement method of this invention.
Claims
1. A binocular vision-based box size measurement method based on monocular collaboration, characterized in that, Includes the following steps: S1. Construction of the measurement system: A base with a conveyor belt attached to the platform is set up. A support pole is set up next to the conveyor belt, and a horizontal bar on the support pole spans over the conveyor belt. A monocular camera is set on the horizontal bar, and the camera of the monocular camera is set vertically downward. A binocular camera is set on the vertical bar of the support pole. The camera of the binocular camera is perpendicular to the movement direction of the conveyor belt, and the height of the binocular camera is such that the camera is at half the height of the target box. A preset straight line is drawn on the conveyor belt on the side close to the binocular camera. The preset straight line is consistent with the movement direction of the conveyor belt. S2. Setting the target box: Place the target box on the conveyor belt, with the length direction of the target box deviating from the movement direction of the conveyor belt, and the target box not in contact with the preset straight line; Start the conveyor belt to move the target box forward. Once the side edge of the target box, which is close to the binocular camera, enters the central area of the monocular camera's field of view, stop the conveyor belt and keep the target box in the same position. S3. Processing of binocular images: Two panoramic original images of the target box are acquired by the binocular camera. The background image in the two original images is removed by the image segmentation operation to obtain two target images containing only the target box. The corner points of the target box are marked on the two target images, and the corner point detection algorithm is used to obtain the corner point coordinates of each box. The disparity value corresponding to each box corner point is calculated respectively. S4. Monocular Image Processing: A local original image of the target box within the camera's field of view is acquired by a monocular camera. An edge detection algorithm is used to detect the box's edge and a preset straight line within the original image. The target box's edge line in the image is then subjected to a Hough transform to obtain three intersecting straight lines representing the target box's edge and the preset straight line, along with their coordinate parameters in polar coordinates. The angle between two edge lines of the target box and the preset straight line is then calculated; this angle is called the preset angle. ; S5. Establish a height measurement model and measure the height of the target container: S5-1 Establishing the elevation line P 11 P 12 The height measurement model is as follows: (7) in, For the high line P 11 P 12 The actual length, For P 11 P 12 The average of the disparity values of the two points ;d1 is P 11 The disparity value of a point, d2 is P 12 The disparity value of a point, where b is the horizontal baseline distance between the focal points of the two cameras in a stereo camera. x 12 For P 11 P 12 The x-coordinates of the two points on the image plane; y 12 For P 11 P 12 The ordinates of the two points on the image plane; S5-2 High Line P 21 P 22 With high line P 31 P 32 The actual length , The result is obtained by analogy with formula (7); S5-3 After calculating the three elevation lines using formula (8), the average value is used to obtain the measurement result of the target box height: (8) in, For the high line P 21 P 22 The actual length, For the high line P 31 P 32 The actual length; S6. Establish a length measurement model and measure the length of the target box: S6-1 When projection point P1 is projected to the left of principal point o, what is the true length of length line P1P2? The measurement model is as follows: (14) Where b is the horizontal baseline distance between the focal points of the two cameras in the stereo camera, and f is the focal length of the stereo camera. Let P2 be the disparity value. Let P1 be the x-coordinate. Let P2 be the x-coordinate. The x-coordinate of the principal point of the image on the left image plane; S6-2 When projection point P1 is projected to the right of principal point o, what is the true length of length line P1P2? The measurement model is as follows: (16) S6-3 The length of the target box is calculated in two cases using formulas (14) and (16); S7. Establish a width measurement model and measure the width of the target box: S7-1 establishes the width measurement model for projection points P1P2 as follows: (17) in, For P 11 Parallax of a point For P 12 Parallax of a point Let x be the ordinate of the principal point. 11 x 12 x 21 x 22 P respectively 11 P 12 P 21 P 22 The x-coordinate of the point, y 11 For P 11 The ordinate of a point, y 12 For P 12 The ordinate of the point, w is the weighting coefficient; When measuring the width of S7-2, the coordinates of the corresponding corner points are substituted into formula (17) to estimate the width edge coordinates of the target box on the coordinate axis.
2. The binocular vision box size measurement method based on monocular collaboration according to claim 1, characterized in that, The Hough transform in step S3 utilizes the duality of points and lines to transform the detection in the Cartesian coordinate system to the polar coordinate system; the transformation relationship between the polar coordinate system and the Cartesian coordinate system is as follows: (1) in, The distance from the origin to the line is denoted as . The angle of inclination from the origin to the perpendicular line; Measure the preset included angle of the target box The calculation formula is: (2) in, The polar coordinate angle corresponding to the preset straight line. This is the polar coordinate angle corresponding to the edge of the target box; when the measured edge is the length of the target box, the preset angle is... The preset included angle is a positive number when the measured edge is the width of the target box. It is a negative number.
Citation Information
Patent Citations
Optimized depth extraction and passive ranging based on monocular vision
CN109146980A
Camera parameter calibration method, device, apparatus, and system
WO2019001410A1