CN-115222668-B - Binocular vision box size measurement method based on monocular coordination
Abstract
The invention relates to a binocular vision box size measurement method based on monocular synergy, which specifically comprises the steps of S1, construction of a measurement system, S2, setting of a target box, S3, processing of binocular images, S4, processing of the monocular images, S5, establishing a height measurement model, measuring the height of the target box, S6, establishing a length measurement model, measuring the length of the target box, S7, establishing a width measurement model, and measuring the width of the target box. According to the invention, the preset included angle between the edge of the target box body and the image plane of the binocular camera is introduced, and the measurement model of the target box body about the length, the width and the height is established, so that the accurate three-dimensional size of the target box body is calculated, and then the corresponding measurement model is automatically selected according to the size and the coordinate position of the preset included angle, so that the measurement of the three-dimensional size of the target box body is realized. The measuring method can greatly improve the measuring precision, and is particularly suitable for high-precision three-dimensional measurement of the box body in the logistics industry.
Inventors
- XIAO JINZHUANG
- WANG NING
- ZHOU ZHEN
- GUO HUIHUI
- ZHOU GANG
Assignees
- 河北大学
Dates
- Publication Date
- 20260508
- Application Date
- 20220621
Claims (2)
- 1. The binocular vision box body size measurement method based on monocular coordination is characterized by comprising the following steps of: S1, constructing a measuring system, namely arranging a base platform with a conveying belt attached to a table top, arranging a hack lever at the side of the conveying belt, arranging a monocular camera on the cross lever, wherein a cross rod on the hack lever spans over the conveying belt, arranging a camera of the monocular camera vertically downwards, arranging a binocular camera on a vertical rod of the hack lever, wherein the camera of the binocular camera is vertical to the moving direction of the conveying belt, and the arranging height of the binocular camera is half of the height of a target box body; S2, setting a target box body, namely placing the target box body on a conveyor belt, wherein the length direction of the target box body deviates from the movement direction of the conveyor belt, and the target box body is not contacted with a preset straight line; S3, processing binocular images, namely acquiring two panoramic original images of a target box body by a binocular camera, removing background images in the two original images through image segmentation operation to obtain two target images only containing the target box body, marking each box body corner point of the target box body on the two target images, obtaining corner point coordinates of each box body corner point by using a corner point detection algorithm, and respectively calculating parallax values corresponding to each box body corner point; S4, processing a monocular image, namely acquiring a local original image of a target box body in a camera view area by a monocular camera, detecting an image of a box body edge and a preset straight line in the original image, which are provided with the target box body, by an edge detection algorithm, converting edge lines of the target box body in the image by Hough to obtain three straight lines representing the edge lines of the target box body and the preset straight line in a cross state and coordinate parameters of the three straight lines on polar coordinates, and then calculating to obtain an included angle between the two edge lines of the target box body and the preset straight line, which is called as a preset included angle ; S5, establishing a height measurement model, and measuring the height of the target box body: s5-1, establishing a height measurement model of a high line P 11 P 12 as follows: (7) Wherein, the For the true length of the high line P 11 P 12 , Is the average value of the disparity values of the two points P 11 、P 12 , D 1 is the parallax value of P 11 , d 2 is the parallax value of P 12 , b is the horizontal base line distance between the focuses of two cameras in the binocular camera, X 12 is the abscissa of the two-point image plane of P 11 、P 12 ; Y 12 is the ordinate of the P 11 、P 12 two-point image plane; True lengths of S5-2 high line P 21 P 22 and high line P 31 P 32 、 The analog formula (7) is calculated; s5-3, respectively calculating three high lines by using a formula (8), and then averaging to obtain a measurement result of the height of the target box: (8) Wherein, the For the true length of the high line P 21 P 22 , Is the true length of the high line P 31 P 32 ; s6, establishing a length measurement model, and measuring the length of the target box body: S6-1 the true length of the length line P 1 P 2 is projected to the left of the principal point o as the projection point P 1 The measurement model of (2) is: (14) wherein b is the horizontal base line distance between the focuses of two cameras in the binocular camera, f is the focal length of the binocular camera, Is the parallax value of the point P 2 , The abscissa of the point P 1 , The abscissa of the point P 2 , The abscissa of the main point of the left image plane; S6-2 the true length of the length line P 1 P 2 is projected to the right of the principal point o as the projection point P 1 The measurement model of (2) is: (16) s6-3, calculating the length of the target box body under two conditions through a formula (14) and a formula (16); S7, establishing a width measurement model, and measuring the width of the target box body: S7-1, establishing a width measurement model of a projection point P 1 P 2 as follows: (17) Wherein, the For the parallax at the point P 11 , For the parallax at the point P 12 , X 11 、x 12 、x 21 、x 22 is the abscissa of the point P 11 、P 12 、P 21 、P 22 , y 11 is the ordinate of the point P 11 , y 12 is the ordinate of the point P 12 , and w is the weight coefficient; And S7-2, substituting the coordinates of the corresponding angular points into a formula (17) when measuring the width, and estimating the width edge coordinates of the target box body on the coordinate axis.
- 2. The binocular vision box size measuring method based on monocular synergy according to claim 1, wherein the Hough transformation in the step S3 is to transform the detection in the cartesian coordinate system into the polar coordinate system by utilizing the point-to-line duality, and the transformation relationship between the polar coordinate system and the cartesian coordinate system is as follows: (1) Wherein, the As the distance from the origin to the straight line, The inclination angle is the angle from the origin to the vertical line of the straight line; preset included angle of measuring target box The calculation formula of (2) is as follows: (2) Wherein, the Is the polar coordinate included angle corresponding to the preset straight line, The included angle is preset when the detected edge is the length of the target box body When the detected edge is the width of the target box body and is positive, presetting an included angle And is negative.
Description
Binocular vision box size measurement method based on monocular coordination Technical Field The invention relates to a method for measuring three-dimensional information of a three-dimensional target, in particular to a binocular vision box size measuring method based on monocular coordination. Background Binocular vision is an important form of machine vision technology, and the basic principle is that two cameras horizontally placed from left to right are utilized to simulate human eyes to respectively obtain images of the same object at different angles, and then the three-dimensional size of the measured object is calculated according to the parallax of corresponding points of the left image and the right image, so that two-dimensional to three-dimensional visual surface reconstruction and scale measurement are realized. Yang et al propose a stereo matching algorithm for water area digital surface model generation, which realizes accurate parallax and height estimation of a water area through self-adaptive matching, so that the generated water area digital surface model has higher precision and visual quality. Liu et al propose a binocular reconstruction algorithm based on laser line constraints. By introducing laser line constraint, then establishing three matching modes, and finally establishing a binocular reconstruction test system and a measurement precision evaluation device, the precision of integral measurement and single-point measurement is improved. Huang et al propose a hole radius and interval measurement method based on binocular vision combined dynamic local plane, which overcomes the problem that the working distance is variable and the abrupt edge positioning error is large in the traditional method, and the measurement precision is respectively improved by at least 77% and 53% in the radius and interval. Wang Yuemin et al divide a discontinuous mirror object into a plurality of continuous object planes, independently calculate the 3D morphology of each continuous object plane through gradient integration, calculate the absolute space coordinates of the feature points in the continuous area by binocular vision, reconstruct the 3D morphology of the discontinuous mirror object, and avoid the problem of integration errors between the discontinuous object planes while ensuring the measurement accuracy. Liu Shiting et al propose a super-resolution imaging ranging method based on binocular zoom. According to the method, the zooming super-resolution reconstruction is carried out through the zooming system, the imaging resolution of the system is improved under the condition that the rest hardware conditions of the system are unchanged, and the range finding relative error is reduced. Yang et al propose a method for estimating height through a binocular stereoscopic video sequence, and estimating the height of a human body through head parallax and calibration parameters of a binocular camera. Zheng et al estimate the diameter and length of vegetables based on stereo cameras by using pixel position and depth information of key points. When the binocular vision technology is used for measuring the size of the box body, a certain angle exists between the binocular camera and the side face of the box body to be measured, and the far point parallax value can generate serious measurement errors due to the fact that the resolution of the camera is fixed, so that the measurement accuracy is greatly affected. The problem of error increase of far-point parallax values can be avoided by using the multi-camera binocular camera, but the binocular camera is high in price and not suitable for industrial requirements. Disclosure of Invention The invention aims to provide a binocular vision box size measurement method based on monocular coordination, so as to realize more accurate box size measurement and reduce industrial application cost. The invention discloses a binocular vision box size measuring method based on monocular coordination, which comprises the following steps of: S1, constructing a measuring system, namely arranging a base platform with a conveying belt attached to a table top, arranging a hack lever at the side of the conveying belt, arranging a monocular camera on the cross lever, wherein a cross rod on the hack lever spans over the conveying belt, arranging a camera of the monocular camera vertically downwards, arranging a binocular camera on a vertical rod of the hack lever, wherein the camera of the binocular camera is vertical to the moving direction of the conveying belt, and the arranging height of the binocular camera is half of the height of a target box body; S2, setting a target box body, namely placing the target box body on a conveyor belt, wherein the length direction of the target box body deviates from the movement direction of the conveyor belt, and the target box body is not contacted with a preset straight line; S3, processing binocular images, namely acquiring two panoram