[go: up one dir, main page]

CN107869954A - A binocular vision volume weight measurement system and its realization method - Google Patents

A binocular vision volume weight measurement system and its realization method Download PDF

Info

Publication number
CN107869954A
CN107869954A CN201710994098.0A CN201710994098A CN107869954A CN 107869954 A CN107869954 A CN 107869954A CN 201710994098 A CN201710994098 A CN 201710994098A CN 107869954 A CN107869954 A CN 107869954A
Authority
CN
China
Prior art keywords
industrial camera
camera
mrow
mtr
mtd
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710994098.0A
Other languages
Chinese (zh)
Other versions
CN107869954B (en
Inventor
谈季
刘信宏
萧植涛
雷亮
何苗
刘树成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201710994098.0A priority Critical patent/CN107869954B/en
Publication of CN107869954A publication Critical patent/CN107869954A/en
Application granted granted Critical
Publication of CN107869954B publication Critical patent/CN107869954B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01GWEIGHING
    • G01G19/00Weighing apparatus or methods adapted for special purposes not provided for in the preceding groups
    • G01G19/002Weighing apparatus or methods adapted for special purposes not provided for in the preceding groups for postal parcels and letters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a kind of binocular vision volume weight measuring system, including Installation cabinet, and it is arranged on the first industrial camera, the second industrial camera, LASER Light Source, LED bar graph light source, signal processing system, measuring table and Bluetooth electronic scale in the Installation cabinet, wherein, the measuring table is arranged on the bottom of the Installation cabinet, and the Bluetooth electronic scale is arranged on the lower section of the measuring table;Second industrial camera is arranged on the top of the Installation cabinet, and the LASER Light Source is arranged side by side with second industrial camera, and the shooting direction keeping parallelism of the radiation direction of the LASER Light Source and second industrial camera;The present invention is compared to traditional artificial tape measure mode, and the advantage such as have quick, accurate, non-contact and cost cheap suitable for the automatic measurement of batch, greatly reduces cost of labor, improves production efficiency.

Description

一种双目视觉体积重量测量系统及其实现方法A binocular vision volume weight measurement system and its realization method

技术领域technical field

本发明涉及非接触智能测控技术领域,具体涉及一种双目视觉体积重量测量系统及其实现方法。The invention relates to the technical field of non-contact intelligent measurement and control, in particular to a binocular vision volume weight measurement system and an implementation method thereof.

背景技术Background technique

随着物流行业在国内快速发展,对各种物流箱大小和重量的快速测量以及分拣,避免物流业塞车,已经成为急需解决的问题。目前对于物流箱的测量还处于人工分别测量物流箱体积和重量的过程,而在测量技术中,一般的激光测距技术仅能获取物体的深度信息,无法给出物体面积。而激光扫描技术虽然可以通过扫描物体表面建立三维模型,但是对于物体表面的要求苛刻,例如需要在物体表面涂上显影剂,以便激光在其身上产生漫反射,这种方法操作麻烦,应用存在局限性。With the rapid development of the logistics industry in China, the rapid measurement and sorting of the size and weight of various logistics boxes to avoid traffic jams in the logistics industry has become an urgent problem to be solved. At present, the measurement of the logistics box is still in the process of manually measuring the volume and weight of the logistics box. In the measurement technology, the general laser ranging technology can only obtain the depth information of the object, but cannot give the object area. Although laser scanning technology can create a three-dimensional model by scanning the surface of the object, it has strict requirements on the surface of the object. For example, it is necessary to coat the surface of the object with a developer so that the laser can produce diffuse reflection on it. This method is cumbersome to operate and has limitations in application. sex.

发明内容Contents of the invention

本发明的目的在于克服现有技术的缺点与不足,提供一种双目视觉体积重量测量系统。The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and provide a binocular vision volume weight measurement system.

本发明的另一目的在于提供一种双目视觉体积重量测量系统的实现方法。Another object of the present invention is to provide a method for realizing a binocular vision volumetric weight measurement system.

本发明的目的通过下述技术方案实现:The object of the present invention is achieved through the following technical solutions:

一种双目视觉体积重量测量系统,包括安装柜,以及设置在所述安装柜内的第一工业相机、第二工业相机、激光光源、LED条形光源、信号处理系统、测量平台和蓝牙电子秤,其中,所述测量平台设置在所述安装柜的底部,所述蓝牙电子秤设置在所述测量平台的下方;所述第二工业相机设置在所述安装柜的顶部,所述激光光源与所述第二工业相机并排设置,且所述激光光源的光线方向与所述第二工业相机的拍摄方向保持平行;所述第二工业相机和所述激光光源设置在所述测量平台的正上方,且所述第二工业相机的拍摄方向与所述激光光源的光线方向都同时垂直于所述测量平台;所述第一工业相机设置在所述安装柜的顶部,所述第一工业相机位于所述测量平台的斜上方,且所述第一工业相机与所述测量平台呈45度角倾斜设置;所述第一工业相机和第二工业相机拍摄所述测量平台的视场范围相同;所述LED条形光源设有四个,其中两个LED条形光源水平设置在所述第二工业相机的前后两侧,另外两个LED条形光源竖直设置在所述第一工业相机的前后两侧;A binocular visual volumetric weight measurement system, including an installation cabinet, and a first industrial camera, a second industrial camera, a laser light source, an LED bar light source, a signal processing system, a measurement platform and a Bluetooth electronic device installed in the installation cabinet scale, wherein the measurement platform is arranged at the bottom of the installation cabinet, the bluetooth electronic scale is arranged below the measurement platform; the second industrial camera is arranged at the top of the installation cabinet, and the laser light source It is arranged side by side with the second industrial camera, and the light direction of the laser light source is kept parallel to the shooting direction of the second industrial camera; the second industrial camera and the laser light source are arranged on the front of the measurement platform above, and the shooting direction of the second industrial camera and the light direction of the laser light source are both perpendicular to the measurement platform; the first industrial camera is arranged on the top of the installation cabinet, and the first industrial camera Located obliquely above the measurement platform, and the first industrial camera is set at an angle of 45 degrees to the measurement platform; the first industrial camera and the second industrial camera have the same field of view of the measurement platform; There are four LED bar-shaped light sources, two of which are horizontally arranged on the front and rear sides of the second industrial camera, and the other two LED bar-shaped light sources are vertically arranged on the sides of the first industrial camera. front and rear sides;

所述第一工业相机、第二工业相机、激光光源和蓝牙电子秤分别与所述信号处理系统相连接;所述信号处理系统设有显示屏。The first industrial camera, the second industrial camera, the laser light source and the bluetooth electronic scale are respectively connected to the signal processing system; the signal processing system is provided with a display screen.

优选地,所述测量平台经过喷漆并打磨成黑色光滑表面;这样设置能够保证物流箱进出测量平台平稳顺滑,且能够减小图像处理过程中的背景干扰。Preferably, the measurement platform is painted and polished to a black smooth surface; such setting can ensure that the logistics box enters and exits the measurement platform smoothly, and can reduce background interference during image processing.

一种由上述双目视觉体积重量测量系统的实现方法,包括下述步骤:A kind of realization method by above-mentioned binocular vision volumetric weight measurement system, comprises the following steps:

步骤一,启动双目视觉体积重量测量系统,第一工业相机、第二工业相机、激光光源、蓝牙电子秤、LED条形光源和信号处理系统开始工作;Step 1, start the binocular vision volume and weight measurement system, the first industrial camera, the second industrial camera, laser light source, Bluetooth electronic scale, LED bar light source and signal processing system start to work;

步骤二,进行第一工业相机和第二工业相机的内参数、外参数以及畸变系数的标定,并将标定结果传送至信号处理系统,具体工作流程如下:Step 2: Calibrate the internal parameters, external parameters and distortion coefficients of the first industrial camera and the second industrial camera, and transmit the calibration results to the signal processing system. The specific workflow is as follows:

(1)第一工业相机和第二工业相机满足针孔相机模型,设图像坐标向量为其中(u,v)为目标点的像素坐标;相机内参数矩阵为其中fx,fy,cx,cy分别为x向焦距,y向焦距和光轴中心坐标;相机外参数矩阵为(R|T),其中R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;世界坐标向量为其中X,Y,Z为目标点的世界坐标;相机成像模型满足关系式:(1) The first industrial camera and the second industrial camera satisfy the pinhole camera model, and the image coordinate vector is set as Where (u, v) is the pixel coordinates of the target point; the internal parameter matrix of the camera is Where f x , f y , c x , c y are the x-direction focal length, y-direction focal length and optical axis center coordinates respectively; the camera extrinsic parameter matrix is (R|T), where R is the camera optical center coordinate system relative to the world coordinate system The 3×3 rotation matrix, T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system; the world coordinate vector is Among them, X, Y, and Z are the world coordinates of the target point; the camera imaging model satisfies the relation:

其中zc为尺度因子;此外,相机畸变模型满足如下关系:where z c is the scale factor; in addition, the camera distortion model satisfies the following relationship:

其中,(x,y)为畸变纠正前的图像物理坐标,(xcor,ycor)为畸变纠正后的图像物理坐标,r=x2+y2,k1,k2,k3,p1,p2为相机的3个径向畸变系数和2个切向畸变系数;Among them, (x, y) are the physical coordinates of the image before distortion correction, (x cor , y cor ) are the physical coordinates of the image after distortion correction, r=x 2 +y 2 ,k 1 ,k 2 ,k 3 ,p 1 , p 2 are three radial distortion coefficients and two tangential distortion coefficients of the camera;

第一工业相机和第二工业相机标定的目的为求解相机内参数、外参数和畸变系数,将测量平台设为零平面,采用张正友棋盘平面标定法,通过改变棋盘的位置和角度拍摄20张图像,进行相机的标定,并求解得到相机内参数、外参数和畸变系数;The purpose of the calibration of the first industrial camera and the second industrial camera is to solve the internal parameters, external parameters and distortion coefficient of the camera. The measurement platform is set as the zero plane, and Zhang Zhengyou’s checkerboard plane calibration method is used to take 20 images by changing the position and angle of the checkerboard. , to calibrate the camera, and solve to obtain the camera internal parameters, external parameters and distortion coefficients;

步骤三,将物流箱置于测量平台上,激光光源照射物流箱,并在物流箱的上表面形成激光点,蓝牙电子秤探测物流箱的重量,当蓝牙电子秤的数据稳定时,记录物流箱重量并将数据通过电子秤上的蓝牙模块传输给信号处理系统,之后信号处理系统将重量数据传输给第一工业相机并触发其采集物流箱的侧视图像C1,第一工业相机默认为小光圈模式,这样能够保证采集的图像亮度低,易于后期对图像中激光点的提取;先对侧视图像C1进行二值化处理得到侧视图像C2,再对侧视图像C2进行激光点轮廓提取,获得激光点的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为侧视图像特征点R的像素坐标(u1,v1),之后第一工业相机将侧视图像特征点R像素坐标(u1,v1)传输到信号处理系统,信号处理系统将重量数据和侧视图像特征点R像素坐标(u1,v1)传输到第二工业相机;Step 3, place the logistics box on the measurement platform, the laser light source illuminates the logistics box, and forms a laser spot on the upper surface of the logistics box, the Bluetooth electronic scale detects the weight of the logistics box, and when the data of the Bluetooth electronic scale is stable, record the logistics box Weight and transmit the data to the signal processing system through the Bluetooth module on the electronic scale, and then the signal processing system transmits the weight data to the first industrial camera and triggers it to collect the side view image C1 of the logistics box. The first industrial camera defaults to a small aperture mode, which can ensure that the brightness of the collected image is low, and it is easy to extract the laser point in the image in the later stage; firstly, the side-view image C1 is binarized to obtain the side-view image C2, and then the side-view image C2 is extracted from the laser point outline. After obtaining the outline of the laser point, take its smallest enclosing circle, and determine the pixel coordinates of the center of the smallest enclosing circle. The pixel coordinates of the center of the circle are the pixel coordinates (u1, v1) of the feature point R of the side-view image. After that, the first industrial camera The side-view image feature point R pixel coordinates (u1, v1) are transmitted to the signal processing system, and the signal processing system transmits the weight data and the side-view image feature point R pixel coordinates (u1, v1) to the second industrial camera;

步骤四,第二工业相机接收到重量数据和侧视图像特征点R像素坐标(u1,v1)后,触发第二工业相机采集物流箱的俯视图像,具体工作流程如下:Step 4: After the second industrial camera receives the weight data and the R pixel coordinates (u1, v1) of the feature point of the side-view image, it triggers the second industrial camera to collect the top-view image of the logistics box. The specific workflow is as follows:

(1)第二工业相机默认为小光圈模式,小光圈模式能够保证采集的图像亮度低,易于后期获取激光点的像素坐标;激光光源照射物流箱,并在物流箱的上表面形成激光点;第二工业相机采集第一张物流箱的俯视图像F1,先对俯视图像F1进行二值化处理得到俯视图像F2,再对俯视图像F2进行激光点轮廓提取,获得激光点的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为俯视图像特征点L像素坐标(u2,v2);(1) The second industrial camera defaults to the small aperture mode. The small aperture mode can ensure that the captured image has low brightness and is easy to obtain the pixel coordinates of the laser point in the later stage; the laser light source illuminates the logistics box and forms a laser point on the upper surface of the logistics box; The second industrial camera collects the top-view image F1 of the first logistics box, first binarizes the top-view image F1 to obtain the top-view image F2, then extracts the contour of the laser point from the top-view image F2, obtains the contour of the laser point and takes the minimum Enclose the circle, and determine the center pixel coordinates of the smallest encircling circle, the center pixel coordinates are the L pixel coordinates (u2, v2) of the feature point of the overlooking image;

(2)第二工业相机自动转换为大光圈模式,保证采集的图像亮度高,可清晰区分出物流箱与背景;第二工业相机采集第二张物流箱的俯视图像F2,对俯视图像F2进行边缘提取得到俯视图像F3,再对俯视图像F3进行轮廓提取并在提取到的多个轮廓中通过判断轮廓的周长剔除背景杂质的干扰,最后得到只包含物流箱轮廓的俯视图像F4,此时,若俯视图像F4中闭合轮廓数为0,则返回错误信息给信号处理系统,表示物流箱没有完全位于第一相机视场范围内,需要重新摆放;最后对正确的俯视图像F4的轮廓提取其最小外接矩形,并获得最小外接矩形的图像长宽数据l和w;(2) The second industrial camera automatically switches to the large aperture mode to ensure the high brightness of the captured image, and can clearly distinguish the logistics box from the background; the second industrial camera collects the second overhead image F2 of the logistics box, and performs an image analysis on the overhead image F2 The edge is extracted to obtain the top-view image F3, and then the contour is extracted from the top-view image F3, and the interference of background impurities is eliminated by judging the perimeter of the contour among the multiple extracted contours, and finally the top-view image F4 containing only the contour of the logistics box is obtained. , if the number of closed contours in the top-view image F4 is 0, an error message will be returned to the signal processing system, indicating that the logistics box is not completely within the field of view of the first camera and needs to be rearranged; finally, the correct contour of the top-view image F4 is extracted Its minimum circumscribed rectangle, and obtain the image length and width data l and w of the minimum circumscribed rectangle;

步骤五,第二工业相机进行激光特征点匹配的三维重构算法,具体工作流程如下:Step five, the second industrial camera performs the 3D reconstruction algorithm of laser feature point matching, the specific workflow is as follows:

(1)通过步骤二中第一工业相机和第二工业相机标定得到的内参数和外参数,可建立激光特征点像素坐标(u,v)与三维世界坐标(X,Y,Z)之间的对应关系,即:(1) Through the internal parameters and external parameters obtained by the calibration of the first industrial camera and the second industrial camera in step 2, the relationship between the pixel coordinates (u, v) of the laser feature point and the three-dimensional world coordinates (X, Y, Z) can be established. The corresponding relationship, that is:

其中A为内参数矩阵(R|T)为外参数矩阵,R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;where A is the internal parameter matrix (R|T) is the external parameter matrix, R is the 3×3 rotation matrix of the camera optical center coordinate system relative to the world coordinate system, and T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system;

(2)第二工业相机获取步骤二中第一工业相机和第二工业相机标定得到的内参数和外参数,利用步骤三和步骤四中得到的侧视图像特征点R像素坐标(u1,v1)和俯视图像特征点L像素坐标(u2,v2),分别代入步骤五(1)中的关系式,可以建立一对激光特征点像素坐标和该点三维世界坐标的方程组,通过最小二乘法解得世界坐标(X,Y,Z)从而还原激光特征点在世界坐标系中的真实位置,完成激光特征点匹配的三维重构过程,其中Z即为物流箱的高度数据;(2) The second industrial camera obtains the internal parameters and external parameters obtained by the calibration of the first industrial camera and the second industrial camera in step 2, and uses the R pixel coordinates (u1, v1) of the side-view image feature points obtained in step 3 and step 4 ) and the pixel coordinates (u2, v2) of the feature point L of the top-view image are respectively substituted into the relational formula in step 5 (1), and a pair of equations of the pixel coordinates of the laser feature point and the three-dimensional world coordinates of the point can be established, and the least square method Solve the world coordinates (X, Y, Z) to restore the real position of the laser feature point in the world coordinate system, and complete the three-dimensional reconstruction process of laser feature point matching, where Z is the height data of the logistics box;

步骤六,第二工业相机进行物流箱真实长宽数据计算,通过步骤四(2)得到的图像长宽数据l,w和预先测量的相机高度H和相机焦距f,根据光学成像模型中相似三角形的计算公式:Step six, the second industrial camera calculates the real length and width data of the logistics box, and the image length and width data l, w obtained in step four (2) and the pre-measured camera height H and camera focal length f, according to the similar triangle in the optical imaging model The formula for calculating:

其中pix表示图像中长或者宽的像素个数,Δ表示像素大小,图像长宽数据l或w的值为其各自对应的pix*Δ,即l=pix*Δ或者w=pix*Δ,f为焦距,H为相机距测量平台高度,h为物流箱高度,从而可计算得出物流箱实际长宽信息L和W,则物流箱体积V为V=L*W*Z,将物流箱体积信息传输给信号处理系统;Among them, pix represents the number of long or wide pixels in the image, Δ represents the pixel size, and the value of the image length and width data l or w is its corresponding pix*Δ, that is, l=pix*Δ or w=pix*Δ, f is the focal length, H is the height of the camera from the measurement platform, and h is the height of the logistics box, so that the actual length and width information L and W of the logistics box can be calculated, then the volume of the logistics box V is V=L*W*Z, the volume of the logistics box Information transmission to the signal processing system;

步骤七,信号处理系统的显示屏显示物流箱体积及重量信息,或者显示摆放错误的提示信息。In step seven, the display screen of the signal processing system displays the volume and weight information of the logistics box, or displays a prompt message indicating that it is placed incorrectly.

本发明的工作原理:Working principle of the present invention:

工作时,步骤一,启动双目视觉体积重量测量系统,第一工业相机、第二工业相机、激光光源、蓝牙电子秤、LED条形光源和信号处理系统开始工作;When working, step 1, start the binocular visual volume and weight measurement system, the first industrial camera, the second industrial camera, laser light source, Bluetooth electronic scale, LED bar light source and signal processing system start to work;

步骤二,进行第一工业相机和第二工业相机的内参数、外参数以及畸变系数的标定,并将标定结果传送至信号处理系统,具体工作流程如下:Step 2: Calibrate the internal parameters, external parameters and distortion coefficients of the first industrial camera and the second industrial camera, and transmit the calibration results to the signal processing system. The specific workflow is as follows:

(1)第一工业相机和第二工业相机满足针孔相机模型,设图像坐标向量为其中(u,v)为目标点的像素坐标;相机内参数矩阵为其中fx,fy,cx,cy分别为x向焦距,y向焦距和光轴中心坐标;相机外参数矩阵为(R|T),其中R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;世界坐标向量为其中X,Y,Z为目标点的世界坐标;相机成像模型满足关系式:(1) The first industrial camera and the second industrial camera satisfy the pinhole camera model, and the image coordinate vector is set as Where (u, v) is the pixel coordinates of the target point; the internal parameter matrix of the camera is Where f x , f y , c x , c y are the x-direction focal length, y-direction focal length and optical axis center coordinates respectively; the camera extrinsic parameter matrix is (R|T), where R is the camera optical center coordinate system relative to the world coordinate system The 3×3 rotation matrix, T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system; the world coordinate vector is Among them, X, Y, and Z are the world coordinates of the target point; the camera imaging model satisfies the relation:

其中zc为尺度因子;此外,相机畸变模型满足如下关系:where z c is the scale factor; in addition, the camera distortion model satisfies the following relationship:

其中,(x,y)为畸变纠正前的图像物理坐标,(xcor,ycor)为畸变纠正后的图像物理坐标,r=x2+y2,k1,k2,k3,p1,p2为相机的3个径向畸变系数和2个切向畸变系数;Among them, (x, y) are the physical coordinates of the image before distortion correction, (x cor , y cor ) are the physical coordinates of the image after distortion correction, r=x 2 +y 2 ,k 1 ,k 2 ,k 3 ,p 1 , p 2 are three radial distortion coefficients and two tangential distortion coefficients of the camera;

第一工业相机和第二工业相机标定的目的为求解相机内参数、外参数和畸变系数,将测量平台设为零平面,采用张正友棋盘平面标定法,通过改变棋盘的位置和角度拍摄20张图像,进行相机的标定,并求解得到相机内参数、外参数和畸变系数;The purpose of the calibration of the first industrial camera and the second industrial camera is to solve the internal parameters, external parameters and distortion coefficient of the camera. The measurement platform is set as the zero plane, and Zhang Zhengyou’s checkerboard plane calibration method is used to take 20 images by changing the position and angle of the checkerboard. , to calibrate the camera, and solve to obtain the camera internal parameters, external parameters and distortion coefficients;

步骤三,将物流箱置于测量平台上,激光光源照射物流箱,并在物流箱的上表面形成激光点,蓝牙电子秤探测物流箱的重量,当蓝牙电子秤的数据稳定时,记录物流箱重量并将数据通过电子秤上的蓝牙模块传输给信号处理系统,之后信号处理系统将重量数据传输给第一工业相机并触发其采集物流箱的侧视图像C1,第一工业相机默认为小光圈模式,这样能够保证采集的图像亮度低,易于后期对图像中激光点的提取;先对侧视图像C1进行二值化处理得到侧视图像C2,再对侧视图像C2进行激光点轮廓提取,获得激光点的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为侧视图像特征点R的像素坐标(u1,v1),之后第一工业相机将侧视图像特征点R像素坐标(u1,v1)传输到信号处理系统,信号处理系统将重量数据和侧视图像特征点R像素坐标(u1,v1)传输到第二工业相机;Step 3, place the logistics box on the measurement platform, the laser light source illuminates the logistics box, and forms a laser spot on the upper surface of the logistics box, the Bluetooth electronic scale detects the weight of the logistics box, and when the data of the Bluetooth electronic scale is stable, record the logistics box Weight and transmit the data to the signal processing system through the Bluetooth module on the electronic scale, and then the signal processing system transmits the weight data to the first industrial camera and triggers it to collect the side view image C1 of the logistics box. The first industrial camera defaults to a small aperture mode, which can ensure that the brightness of the collected image is low, and it is easy to extract the laser point in the image in the later stage; firstly, the side-view image C1 is binarized to obtain the side-view image C2, and then the side-view image C2 is extracted from the laser point outline. After obtaining the outline of the laser point, take its smallest enclosing circle, and determine the pixel coordinates of the center of the smallest enclosing circle. The pixel coordinates of the center of the circle are the pixel coordinates (u1, v1) of the feature point R of the side-view image. After that, the first industrial camera The side-view image feature point R pixel coordinates (u1, v1) are transmitted to the signal processing system, and the signal processing system transmits the weight data and the side-view image feature point R pixel coordinates (u1, v1) to the second industrial camera;

步骤四,第二工业相机接收到重量数据和侧视图像特征点R像素坐标(u1,v1)后,触发第二工业相机采集物流箱的俯视图像,具体工作流程如下:Step 4: After the second industrial camera receives the weight data and the R pixel coordinates (u1, v1) of the feature point of the side-view image, it triggers the second industrial camera to collect the top-view image of the logistics box. The specific workflow is as follows:

(1)第二工业相机默认为小光圈模式,小光圈模式能够保证采集的图像亮度低,易于后期获取激光点的像素坐标;激光光源照射物流箱,并在物流箱的上表面形成激光点;第二工业相机采集第一张物流箱的俯视图像F1,先对俯视图像F1进行二值化处理得到俯视图像F2,再对俯视图像F2进行激光点轮廓提取,获得激光点的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为俯视图像特征点L像素坐标(u2,v2);(1) The second industrial camera defaults to the small aperture mode. The small aperture mode can ensure that the captured image has low brightness and is easy to obtain the pixel coordinates of the laser point in the later stage; the laser light source illuminates the logistics box and forms a laser point on the upper surface of the logistics box; The second industrial camera collects the top-view image F1 of the first logistics box, first binarizes the top-view image F1 to obtain the top-view image F2, then extracts the contour of the laser point from the top-view image F2, obtains the contour of the laser point and takes the minimum Enclose the circle, and determine the center pixel coordinates of the smallest encircling circle, the center pixel coordinates are the L pixel coordinates (u2, v2) of the feature point of the overlooking image;

(2)第二工业相机自动转换为大光圈模式,保证采集的图像亮度高,可清晰区分出物流箱与背景;第二工业相机采集第二张物流箱的俯视图像F2,对俯视图像F2进行边缘提取得到俯视图像F3,再对俯视图像F3进行轮廓提取并在提取到的多个轮廓中通过判断轮廓的周长剔除背景杂质的干扰,最后得到只包含物流箱轮廓的俯视图像F4,此时,若俯视图像F4中闭合轮廓数为0,则返回错误信息给信号处理系统,表示物流箱没有完全位于第一相机视场范围内,需要重新摆放;最后对正确的俯视图像F4的轮廓提取其最小外接矩形,并获得最小外接矩形的图像长宽数据l和w;(2) The second industrial camera automatically switches to the large aperture mode to ensure the high brightness of the captured image, and can clearly distinguish the logistics box from the background; the second industrial camera collects the second overhead image F2 of the logistics box, and performs an image analysis on the overhead image F2 The edge is extracted to obtain the top-view image F3, and then the contour is extracted from the top-view image F3, and the interference of background impurities is eliminated by judging the perimeter of the contour among the multiple extracted contours, and finally the top-view image F4 containing only the contour of the logistics box is obtained. , if the number of closed contours in the top-view image F4 is 0, an error message will be returned to the signal processing system, indicating that the logistics box is not completely within the field of view of the first camera and needs to be rearranged; finally, the correct contour of the top-view image F4 is extracted Its minimum circumscribed rectangle, and obtain the image length and width data l and w of the minimum circumscribed rectangle;

步骤五,第二工业相机进行激光特征点匹配的三维重构算法,具体工作流程如下:Step five, the second industrial camera performs the 3D reconstruction algorithm of laser feature point matching, the specific workflow is as follows:

(1)通过步骤二中第一工业相机和第二工业相机标定得到的内参数和外参数,可建立激光特征点像素坐标(u,v)与三维世界坐标(X,Y,Z)之间的对应关系,即:(1) Through the internal parameters and external parameters obtained by the calibration of the first industrial camera and the second industrial camera in step 2, the relationship between the pixel coordinates (u, v) of the laser feature point and the three-dimensional world coordinates (X, Y, Z) can be established. The corresponding relationship, that is:

其中A为内参数矩阵(R|T)为外参数矩阵,R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;where A is the internal parameter matrix (R|T) is the external parameter matrix, R is the 3×3 rotation matrix of the camera optical center coordinate system relative to the world coordinate system, and T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system;

(2)第二工业相机获取步骤二中第一工业相机和第二工业相机标定得到的内参数和外参数,利用步骤三和步骤四中得到的侧视图像特征点R像素坐标(u1,v1)和俯视图像特征点L像素坐标(u2,v2),分别代入步骤五(1)中的关系式,可以建立一对激光特征点像素坐标和该点三维世界坐标的方程组,通过最小二乘法解得世界坐标(X,Y,Z)从而还原激光特征点在世界坐标系中的真实位置,完成激光特征点匹配的三维重构过程,其中Z即为物流箱的高度数据;(2) The second industrial camera obtains the internal parameters and external parameters obtained by the calibration of the first industrial camera and the second industrial camera in step 2, and uses the R pixel coordinates (u1, v1) of the side-view image feature points obtained in step 3 and step 4 ) and the pixel coordinates (u2, v2) of the feature point L of the top-view image are respectively substituted into the relational formula in step 5 (1), and a pair of equations of the pixel coordinates of the laser feature point and the three-dimensional world coordinates of the point can be established, and the least square method Solve the world coordinates (X, Y, Z) to restore the real position of the laser feature point in the world coordinate system, and complete the three-dimensional reconstruction process of laser feature point matching, where Z is the height data of the logistics box;

步骤六,第二工业相机进行物流箱真实长宽数据计算,通过步骤四(2)得到的图像长宽数据l,w和预先测量的相机高度H和相机焦距f,根据光学成像模型中相似三角形的计算公式:Step six, the second industrial camera calculates the real length and width data of the logistics box, and the image length and width data l, w obtained in step four (2) and the pre-measured camera height H and camera focal length f, according to the similar triangle in the optical imaging model The formula for calculating:

其中pix表示图像中长或者宽的像素个数,Δ表示像素大小,图像长宽数据l或w的值为其各自对应的pix*Δ,即l=pix*Δ或者w=pix*Δ,f为焦距,H为相机距测量平台高度,h为物流箱高度,从而可计算得出物流箱实际长宽信息L和W,则物流箱体积V为V=L*W*Z,将物流箱体积信息传输给信号处理系统;Among them, pix represents the number of long or wide pixels in the image, Δ represents the pixel size, and the value of the image length and width data l or w is its corresponding pix*Δ, that is, l=pix*Δ or w=pix*Δ, f is the focal length, H is the height of the camera from the measurement platform, and h is the height of the logistics box, so that the actual length and width information L and W of the logistics box can be calculated, then the volume of the logistics box V is V=L*W*Z, the volume of the logistics box Information transmission to the signal processing system;

步骤七,信号处理系统的显示屏显示物流箱体积及重量信息,或者显示摆放错误的提示信息。In step seven, the display screen of the signal processing system displays the volume and weight information of the logistics box, or displays a prompt message indicating that it is placed incorrectly.

本发明与现有技术相比具有以下的有益效果:Compared with the prior art, the present invention has the following beneficial effects:

(1)本发明相比于传统的人工标尺测量方式,具有快速、准确、非接触和成本低廉等优势,适用于批量的自动化测量,极大地降低人工成本,提高生产效率;(1) Compared with the traditional manual scale measurement method, the present invention has the advantages of fastness, accuracy, non-contact and low cost, and is suitable for automatic batch measurement, which greatly reduces labor costs and improves production efficiency;

(2)本发明无需使用传统的激光测距模块,完全依靠视觉技术就可以实现物体的长宽高测量,在近距离,小体积的测量环境中,双目视觉三维重构技术比激光测距技术精度更高,成本更低;(2) The present invention does not need to use the traditional laser ranging module, and can realize the measurement of the length, width and height of the object entirely by visual technology. Higher technical precision and lower cost;

(3)相比于一般三维重构特征点匹配中涉及到的受光照,纹理,光学失真及噪声等因素影响的问题,本发明采用的激光光源引导立体匹配的算法,大大降低了特征点匹配的难度,减小了误匹配,漏匹配等问题,提高了系统的稳定性和可靠性。(3) Compared with the problems affected by factors such as illumination, texture, optical distortion and noise involved in the general three-dimensional reconstruction feature point matching, the laser light source-guided stereo matching algorithm adopted in the present invention greatly reduces the problem of feature point matching. It reduces the difficulty of mismatching and missing matching, and improves the stability and reliability of the system.

附图说明Description of drawings

图1为本发明的整体结构示意图;Fig. 1 is the overall structure schematic diagram of the present invention;

图2为本发明的系统结构示意图;Fig. 2 is a schematic structural diagram of the system of the present invention;

图3为本发明的三维重构算法流程图;Fig. 3 is a three-dimensional reconstruction algorithm flowchart of the present invention;

图4为本发明的物流箱长宽计算示意图。Fig. 4 is a schematic diagram of calculating the length and width of the logistics box of the present invention.

图中附图标记为:1、第一工业相机;2、信号处理系统;3、LED条形光源;4、蓝牙电子秤;5、测量平台;6、第二工业相机;7、激光光源;8、激光点;9、物流箱。Reference signs in the figure are: 1. First industrial camera; 2. Signal processing system; 3. LED bar light source; 4. Bluetooth electronic scale; 5. Measurement platform; 6. Second industrial camera; 7. Laser light source; 8. Laser point; 9. Logistics box.

具体实施方式Detailed ways

下面结合实施例及附图对本发明作进一步详细的描述,但本发明的实施方式不限于此。The present invention will be further described in detail below in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.

如图1~4所示,一种双目视觉体积重量测量系统,包括安装柜,以及设置在所述安装柜内的第一工业相机1、第二工业相机6、激光光源7、LED条形光源3、信号处理系统2、测量平台5和蓝牙电子秤4,其中,所述测量平台5设置在所述安装柜的底部,所述测量平台5经过喷漆并打磨成黑色光滑表面,这样设置能够保证物流箱9进出测量平台5平稳顺滑,且能够减小图像处理过程中的背景干扰;所述蓝牙电子秤4设置在所述测量平台5的下方;所述第二工业相机6设置在所述安装柜的顶部,所述激光光源7与所述第二工业相机6并排设置,且所述激光光源7的光线方向与所述第二工业相机6的拍摄方向保持平行;所述第二工业相机6和所述激光光源7设置在所述测量平台5的正上方,且所述第二工业相机6的拍摄方向与所述激光光源7的光线方向都同时垂直于所述测量平台5;所述第一工业相机1设置在所述安装柜的顶部,所述第一工业相机1位于所述测量平台5的斜上方,且所述第一工业相机1与所述测量平台5呈45度角倾斜设置;所述第一工业相机1和第二工业相机6拍摄所述测量平台5的视场范围相同;所述LED条形光源3设有四个,其中两个LED条形光源3水平设置在所述第二工业相机6的前后两侧,另外两个LED条形光源3竖直设置在所述第一工业相机1的前后两侧,这些LED条形光源3的设置能够实现均匀打光以供第一工业相机1和第二工业相机6获取优质图像;所述第一工业相机1、第二工业相机6、激光光源7和蓝牙电子秤4分别与所述信号处理系统2相连接;所述信号处理系统2设有显示屏。As shown in Figures 1 to 4, a binocular visual volumetric weight measurement system includes an installation cabinet, and a first industrial camera 1, a second industrial camera 6, a laser light source 7, and an LED strip installed in the installation cabinet. Light source 3, signal processing system 2, measuring platform 5 and bluetooth electronic scale 4, wherein, described measuring platform 5 is arranged on the bottom of described installation cabinet, and described measuring platform 5 is polished into black smooth surface through painting, can be arranged like this Ensure that the logistics box 9 enters and exits the measurement platform 5 smoothly and smoothly, and can reduce background interference in the image processing process; the Bluetooth electronic scale 4 is arranged below the measurement platform 5; the second industrial camera 6 is arranged on the The top of the installation cabinet, the laser light source 7 and the second industrial camera 6 are arranged side by side, and the light direction of the laser light source 7 is kept parallel to the shooting direction of the second industrial camera 6; the second industrial The camera 6 and the laser light source 7 are arranged directly above the measurement platform 5, and the shooting direction of the second industrial camera 6 and the light direction of the laser light source 7 are all perpendicular to the measurement platform 5 at the same time; The first industrial camera 1 is set on the top of the installation cabinet, the first industrial camera 1 is located obliquely above the measurement platform 5, and the first industrial camera 1 is at an angle of 45 degrees to the measurement platform 5 Inclined setting; the first industrial camera 1 and the second industrial camera 6 have the same field of view of the measurement platform 5; the LED bar light source 3 is provided with four, of which two LED bar light sources 3 are arranged horizontally On the front and rear sides of the second industrial camera 6, two other LED strip light sources 3 are vertically arranged on the front and rear sides of the first industrial camera 1, and the setting of these LED strip light sources 3 can realize uniform lighting For the first industrial camera 1 and the second industrial camera 6 to obtain high-quality images; the first industrial camera 1, the second industrial camera 6, the laser light source 7 and the Bluetooth electronic scale 4 are respectively connected to the signal processing system 2; The signal processing system 2 is provided with a display screen.

双目立体视觉是计算机视觉的关键技术之一,是基于视差原理并利用成像设备从不同的位置获取被测物体的两幅图像,通过计算图像对应点间的位置偏差,来获取物体三维几何信息的方法,而利用计算机视觉的测量方法,不受人工因素的影响,精度不受测量标尺等参照物精度的限制,相比于传统的人工标尺测量,具有快速、准确、非接触和成本低廉等优势,适用于批量的自动化测量,极大地降低人工成本,提高生产效率。本发明提出的双目视觉测量技术具有效率高、精度合适、系统结构简单、成本低等优点,非常适合于制造现场的在线、非接触产品检测和质量控制。Binocular stereo vision is one of the key technologies of computer vision. It is based on the principle of parallax and uses imaging equipment to obtain two images of the measured object from different positions. By calculating the position deviation between the corresponding points of the image, the three-dimensional geometric information of the object is obtained. The method using computer vision is not affected by artificial factors, and the accuracy is not limited by the accuracy of reference objects such as measuring scales. Compared with traditional manual scale measurement, it is fast, accurate, non-contact and low cost. Advantages, suitable for batch automated measurement, greatly reducing labor costs and improving production efficiency. The binocular vision measurement technology proposed by the invention has the advantages of high efficiency, appropriate precision, simple system structure, low cost, etc., and is very suitable for on-line, non-contact product detection and quality control at the manufacturing site.

工作时,步骤一,启动双目视觉体积重量测量系统,第一工业相机1、第二工业相机6、激光光源7、蓝牙电子秤4、LED条形光源3和信号处理系统2开始工作;When working, step 1 starts the binocular visual volume and weight measurement system, and the first industrial camera 1, the second industrial camera 6, the laser light source 7, the Bluetooth electronic scale 4, the LED bar light source 3 and the signal processing system 2 start to work;

步骤二,进行第一工业相机1和第二工业相机6的内参数、外参数以及畸变系数的标定,并将标定结果传送至信号处理系统2,具体工作流程如下:Step 2: Calibrate the internal parameters, external parameters and distortion coefficients of the first industrial camera 1 and the second industrial camera 6, and transmit the calibration results to the signal processing system 2. The specific workflow is as follows:

(1)第一工业相机1和第二工业相机6满足针孔相机模型,设图像坐标向量为其中(u,v)为目标点的像素坐标;相机内参数矩阵为其中fx,fy,cx,cy分别为x向焦距,y向焦距和光轴中心坐标;相机外参数矩阵为(R|T),其中R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;世界坐标向量为其中X,Y,Z为目标点的世界坐标;(1) The first industrial camera 1 and the second industrial camera 6 satisfy the pinhole camera model, assuming that the image coordinate vector is Where (u, v) is the pixel coordinates of the target point; the internal parameter matrix of the camera is Where f x , f y , c x , c y are the x-direction focal length, y-direction focal length and optical axis center coordinates respectively; the camera extrinsic parameter matrix is (R|T), where R is the camera optical center coordinate system relative to the world coordinate system The 3×3 rotation matrix, T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system; the world coordinate vector is Where X, Y, Z are the world coordinates of the target point;

相机成像模型满足关系式:The camera imaging model satisfies the relation:

其中zc为尺度因子;此外,相机畸变模型满足如下关系:where z c is the scale factor; in addition, the camera distortion model satisfies the following relationship:

其中,(x,y)为畸变纠正前的图像物理坐标,(xcor,ycor)为畸变纠正后的图像物理坐标,r=x2+y2,k1,k2,k3,p1,p2为相机的3个径向畸变系数和2个切向畸变系数;Among them, (x, y) are the physical coordinates of the image before distortion correction, (x cor , y cor ) are the physical coordinates of the image after distortion correction, r=x 2 +y 2 ,k 1 ,k 2 ,k 3 ,p 1 , p 2 are three radial distortion coefficients and two tangential distortion coefficients of the camera;

第一工业相机1和第二工业相机6标定的目的为求解相机内参数、外参数和畸变系数,将测量平台5设为零平面,采用张正友棋盘平面标定法,通过改变棋盘的位置和角度拍摄20张图像,进行相机的标定,并求解得到相机内参数、外参数和畸变系数;The purpose of the calibration of the first industrial camera 1 and the second industrial camera 6 is to solve the internal parameters, external parameters and distortion coefficients of the cameras. The measurement platform 5 is set as the zero plane, and Zhang Zhengyou’s checkerboard plane calibration method is used to take pictures by changing the position and angle of the checkerboard. 20 images were used to calibrate the camera, and the internal parameters, external parameters and distortion coefficients of the camera were obtained by solving;

步骤三,将物流箱9置于测量平台5上,激光光源7照射物流箱9,并在物流箱9的上表面形成激光点8,蓝牙电子秤4探测物流箱9的重量,当蓝牙电子秤4的数据稳定时,记录物流箱9重量并将数据通过电子秤上的蓝牙模块传输给信号处理系统2,之后信号处理系统2将重量数据传输给第一工业相机1并触发其采集物流箱9的侧视图像C1,第一工业相机1默认为小光圈模式,这样能够保证采集的图像亮度低,易于后期对图像中激光点8的提取;先对侧视图像C1进行二值化处理得到侧视图像C2,再对侧视图像C2进行激光点8轮廓提取,获得激光点8的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为侧视图像特征点R的像素坐标(u1,v1),之后第一工业相机1将侧视图像特征点R像素坐标(u1,v1)传输到信号处理系统2,信号处理系统2将重量数据和侧视图像特征点R像素坐标(u1,v1)传输到第二工业相机6;Step 3, the logistics box 9 is placed on the measurement platform 5, the laser light source 7 irradiates the logistics box 9, and a laser spot 8 is formed on the upper surface of the logistics box 9, and the Bluetooth electronic scale 4 detects the weight of the logistics box 9. When the Bluetooth electronic scale When the data of 4 is stable, record the weight of the logistics box 9 and transmit the data to the signal processing system 2 through the Bluetooth module on the electronic scale, and then the signal processing system 2 transmits the weight data to the first industrial camera 1 and triggers it to collect the logistics box 9 The side-view image C1 of the first industrial camera 1 defaults to the small aperture mode, which can ensure that the brightness of the collected image is low, and it is easy to extract the laser point 8 in the image in the later stage; first, binarize the side-view image C1 to obtain the side-view image View the image C2, and then extract the contour of the laser point 8 from the side view image C2. After obtaining the contour of the laser point 8, take the smallest enclosing circle, and determine the pixel coordinates of the center of the smallest enclosing circle. The pixel coordinates of the center of the circle are the side view The pixel coordinates (u1, v1) of the image feature point R, and then the first industrial camera 1 transmits the pixel coordinates (u1, v1) of the side view image feature point R to the signal processing system 2, and the signal processing system 2 combines the weight data and the side view Image feature point R pixel coordinates (u1, v1) are transmitted to the second industrial camera 6;

步骤四,第二工业相机6接收到重量数据和侧视图像特征点R像素坐标(u1,v1)后,触发第二工业相机6采集物流箱9的俯视图像,具体工作流程如下:Step 4, after the second industrial camera 6 receives the weight data and the R pixel coordinates (u1, v1) of the feature point of the side-view image, it triggers the second industrial camera 6 to collect the overhead image of the logistics box 9, and the specific workflow is as follows:

(1)第二工业相机6默认为小光圈模式,小光圈模式能够保证采集的图像亮度低,易于后期获取激光点8的像素坐标;激光光源7照射物流箱9,并在物流箱9的上表面形成激光点8;第二工业相机6采集第一张物流箱9的俯视图像F1,先对俯视图像F1进行二值化处理得到俯视图像F2,再对俯视图像F2进行激光点8轮廓提取,获得激光点8的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为俯视图像特征点L像素坐标(u2,v2);(1) The second industrial camera 6 defaults to the small aperture mode. The small aperture mode can ensure that the brightness of the image collected is low, and it is easy to obtain the pixel coordinates of the laser point 8 in the later stage; A laser point 8 is formed on the surface; the second industrial camera 6 collects the first overhead image F1 of the logistics box 9, and first binarizes the overhead image F1 to obtain an overhead image F2, and then extracts the outline of the laser point 8 from the overhead image F2, After obtaining the outline of the laser point 8, get its minimum enclosing circle, and determine the center pixel coordinates of the minimum enclosing circle, and this circle center pixel coordinate is the L pixel coordinate (u2, v2) of the feature point L of the bird's-eye view image;

(2)第二工业相机6自动转换为大光圈模式,保证采集的图像亮度高,可清晰区分出物流箱9与背景;第二工业相机6采集第二张物流箱9的俯视图像F2,对俯视图像F2进行边缘提取得到俯视图像F3,再对俯视图像F3进行轮廓提取并在提取到的多个轮廓中通过判断轮廓的周长剔除背景杂质的干扰,最后得到只包含物流箱9轮廓的俯视图像F4,此时,若俯视图像F4中闭合轮廓数为0,则返回错误信息给信号处理系统2,表示物流箱9没有完全位于第一相机视场范围内,需要重新摆放;最后对正确的俯视图像F4的轮廓提取其最小外接矩形,并获得最小外接矩形的图像长宽数据l和w;(2) The second industrial camera 6 is automatically converted into a large aperture mode to ensure that the image brightness collected is high, and the logistics box 9 and the background can be clearly distinguished; the second industrial camera 6 collects the second overhead image F2 of the logistics box 9, and the Perform edge extraction on the top-view image F2 to obtain the top-view image F3, then perform contour extraction on the top-view image F3 and eliminate the interference of background impurities by judging the perimeter of the contours among the multiple extracted contours, and finally obtain a top-view image that only contains the contour of the logistics box 9 Image F4, at this time, if the number of closed contours in the top view image F4 is 0, an error message will be returned to the signal processing system 2, indicating that the logistics box 9 is not completely within the field of view of the first camera, and needs to be rearranged; finally correct Extract its minimum circumscribed rectangle from the contour of the bird's-eye view image F4, and obtain the image length and width data l and w of the minimum circumscribed rectangle;

步骤五,第二工业相机6进行激光特征点匹配的三维重构算法,具体工作流程如下:Step five, the second industrial camera 6 performs a three-dimensional reconstruction algorithm for laser feature point matching, and the specific workflow is as follows:

(1)通过步骤二中第一工业相机1和第二工业相机6标定得到的内参数和外参数,可建立激光特征点像素坐标(u,v)与三维世界坐标(X,Y,Z)之间的对应关系,即:(1) Through the internal parameters and external parameters obtained by the calibration of the first industrial camera 1 and the second industrial camera 6 in step 2, the pixel coordinates (u, v) and three-dimensional world coordinates (X, Y, Z) of laser feature points can be established The corresponding relationship between, namely:

其中A为内参数矩阵(R|T)为外参数矩阵,R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;where A is the internal parameter matrix (R|T) is the external parameter matrix, R is the 3×3 rotation matrix of the camera optical center coordinate system relative to the world coordinate system, and T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system;

(2)第二工业相机6获取步骤二中第一工业相机1和第二工业相机6标定得到的内参数和外参数,利用步骤三和步骤四中得到的侧视图像特征点R像素坐标(u1,v1)和俯视图像特征点L像素坐标(u2,v2),分别代入步骤五(1)中的关系式,可以建立一对激光特征点像素坐标和该点三维世界坐标的方程组,通过最小二乘法解得世界坐标(X,Y,Z)从而还原激光特征点在世界坐标系中的真实位置,完成激光特征点匹配的三维重构过程,其中Z即为物流箱9的高度数据;(2) the second industrial camera 6 acquires the internal parameters and external parameters that the first industrial camera 1 and the second industrial camera 6 calibrate in step 2, and utilizes the side-view image feature point R pixel coordinates obtained in step 3 and step 4 ( u1, v1) and L pixel coordinates (u2, v2) of the feature point of the top-view image are respectively substituted into the relational expression in step 5 (1), and a pair of equations of the pixel coordinates of the laser feature point and the three-dimensional world coordinates of the point can be established, through The least square method solves the world coordinates (X, Y, Z) to restore the real position of the laser feature point in the world coordinate system, and completes the three-dimensional reconstruction process of laser feature point matching, where Z is the height data of the logistics box 9;

步骤六,第二工业相机6进行物流箱9真实长宽数据计算,通过步骤四(2)得到的图像长宽数据l,w和预先测量的相机高度H和相机焦距f,根据光学成像模型中相似三角形的计算公式:Step six, the second industrial camera 6 calculates the real length and width data of the logistics box 9, the image length and width data l, w obtained in step four (2) and the pre-measured camera height H and camera focal length f, according to the optical imaging model The calculation formula of similar triangles:

其中pix表示图像中长或者宽的像素个数,Δ表示像素大小,图像长宽数据l或w的值为其各自对应的pix*Δ,即l=pix*Δ或者w=pix*Δ,f为焦距,H为相机距测量平台5高度,h为物流箱9高度,从而可计算得出物流箱9实际长宽信息L和W,则物流箱9体积V为V=L*W*Z,将物流箱9体积信息传输给信号处理系统2;Among them, pix represents the number of long or wide pixels in the image, Δ represents the pixel size, and the value of the image length and width data l or w is its corresponding pix*Δ, that is, l=pix*Δ or w=pix*Δ, f is the focal length, H is the height of the camera from the measurement platform 5, and h is the height of the logistics box 9, so that the actual length and width information L and W of the logistics box 9 can be calculated, and the volume V of the logistics box 9 is V=L*W*Z, Transmitting the volume information of the logistics box 9 to the signal processing system 2;

步骤七,信号处理系统2的显示屏显示物流箱9体积及重量信息,或者显示摆放错误的提示信息。Step 7, the display screen of the signal processing system 2 displays the volume and weight information of the logistic box 9, or displays a prompt message indicating that it is placed incorrectly.

本发明相比于传统的人工标尺测量方式,具有快速、准确、非接触和成本低廉等优势,适用于批量的自动化测量,极大地降低人工成本,提高生产效率;无需使用传统的激光测距模块,完全依靠视觉技术就可以实现物体的长宽高测量,在近距离,小体积的测量环境中,双目视觉三维重构技术比激光测距技术精度更高,成本更低;相比于一般三维重构特征点匹配中涉及到的受光照,纹理,光学失真及噪声等因素影响的问题,本发明采用的激光光源引导立体匹配的算法,大大降低了特征点匹配的难度,减小了误匹配,漏匹配等问题,提高了系统的稳定性和可靠性。Compared with the traditional manual scale measurement method, the present invention has the advantages of fast, accurate, non-contact and low cost, and is suitable for batch automatic measurement, greatly reducing labor costs and improving production efficiency; no need to use traditional laser ranging modules , the length, width and height of an object can be measured entirely by visual technology. In a short-distance, small-volume measurement environment, the binocular vision 3D reconstruction technology is more accurate and less costly than the laser ranging technology; The problems involved in the three-dimensional reconstruction feature point matching are affected by factors such as illumination, texture, optical distortion, and noise. The laser light source-guided stereo matching algorithm adopted in the present invention greatly reduces the difficulty of feature point matching and reduces errors. Problems such as matching and missing matching improve the stability and reliability of the system.

上述为本发明较佳的实施方式,但本发明的实施方式并不受上述内容的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above content, and any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention are all Replacement methods that should be equivalent are all included within the protection scope of the present invention.

Claims (3)

1.一种双目视觉体积重量测量系统,其特征在于,包括安装柜,以及设置在所述安装柜内的第一工业相机、第二工业相机、激光光源、LED条形光源、信号处理系统、测量平台和蓝牙电子秤,其中,所述测量平台设置在所述安装柜的底部,所述蓝牙电子秤设置在所述测量平台的下方;所述第二工业相机设置在所述安装柜的顶部,所述激光光源与所述第二工业相机并排设置,且所述激光光源的光线方向与所述第二工业相机的拍摄方向保持平行;所述第二工业相机和所述激光光源设置在所述测量平台的正上方,且所述第二工业相机的拍摄方向与所述激光光源的光线方向都同时垂直于所述测量平台;所述第一工业相机设置在所述安装柜的顶部,所述第一工业相机位于所述测量平台的斜上方,且所述第一工业相机与所述测量平台呈45度角倾斜设置;所述第一工业相机和第二工业相机拍摄所述测量平台的视场范围相同;所述LED条形光源设有四个,其中两个LED条形光源水平设置在所述第二工业相机的前后两侧,另外两个LED条形光源竖直设置在所述第一工业相机的前后两侧;1. A binocular visual volumetric weight measurement system, characterized in that it comprises an installation cabinet, and the first industrial camera, the second industrial camera, a laser light source, an LED strip light source, and a signal processing system arranged in the installation cabinet , a measurement platform and a bluetooth electronic scale, wherein the measurement platform is arranged at the bottom of the installation cabinet, and the bluetooth electronic scale is arranged below the measurement platform; the second industrial camera is arranged at the bottom of the installation cabinet At the top, the laser light source and the second industrial camera are arranged side by side, and the light direction of the laser light source is kept parallel to the shooting direction of the second industrial camera; the second industrial camera and the laser light source are arranged on directly above the measurement platform, and the shooting direction of the second industrial camera and the light direction of the laser light source are both perpendicular to the measurement platform; the first industrial camera is arranged on the top of the installation cabinet, The first industrial camera is located obliquely above the measurement platform, and the first industrial camera is inclined at an angle of 45 degrees to the measurement platform; the first industrial camera and the second industrial camera photograph the measurement platform The field of view range is the same; there are four LED bar light sources, two of which are horizontally arranged on the front and rear sides of the second industrial camera, and the other two LED bar light sources are vertically arranged on the The front and rear sides of the first industrial camera; 所述第一工业相机、第二工业相机、激光光源和蓝牙电子秤分别与所述信号处理系统相连接;所述信号处理系统设有显示屏。The first industrial camera, the second industrial camera, the laser light source and the bluetooth electronic scale are respectively connected to the signal processing system; the signal processing system is provided with a display screen. 2.根据权利要求1所述的双目视觉体积重量测量系统,其特征在于,所述测量平台经过喷漆并打磨成黑色光滑表面。2. The binocular vision volumetric weight measurement system according to claim 1, wherein the measurement platform is painted and polished into a black smooth surface. 3.一种由权利要求1~2任一项所述双目视觉体积重量测量系统的实现方法,其特征在于,包括下述步骤:3. A method for realizing the binocular vision volume weight measuring system according to any one of claims 1 to 2, characterized in that it comprises the following steps: 步骤一,启动双目视觉体积重量测量系统,第一工业相机、第二工业相机、激光光源、蓝牙电子秤、LED条形光源和信号处理系统开始工作;Step 1, start the binocular vision volume and weight measurement system, the first industrial camera, the second industrial camera, laser light source, Bluetooth electronic scale, LED bar light source and signal processing system start to work; 步骤二,进行第一工业相机和第二工业相机的内参数、外参数以及畸变系数的标定,并将标定结果传送至信号处理系统,具体工作流程如下:Step 2: Calibrate the internal parameters, external parameters and distortion coefficients of the first industrial camera and the second industrial camera, and transmit the calibration results to the signal processing system. The specific workflow is as follows: (1)第一工业相机和第二工业相机满足针孔相机模型,设图像坐标向量为其中(u,v)为目标点的像素坐标;相机内参数矩阵为其中fx,fy,cx,cy分别为x向焦距,y向焦距和光轴中心坐标;相机外参数矩阵为(R|T),其中R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;世界坐标向量为其中X,Y,Z为目标点的世界坐标;相机成像模型满足关系式:(1) The first industrial camera and the second industrial camera satisfy the pinhole camera model, and the image coordinate vector is set as Where (u, v) is the pixel coordinates of the target point; the internal parameter matrix of the camera is Where f x , f y , c x , c y are the x-direction focal length, y-direction focal length and optical axis center coordinates respectively; the camera extrinsic parameter matrix is (R|T), where R is the camera optical center coordinate system relative to the world coordinate system The 3×3 rotation matrix, T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system; the world coordinate vector is Among them, X, Y, and Z are the world coordinates of the target point; the camera imaging model satisfies the relation: <mrow> <msup> <mi>m</mi> <mo>&amp;prime;</mo> </msup> <mo>=</mo> <mfrac> <mn>1</mn> <msub> <mi>z</mi> <mi>c</mi> </msub> </mfrac> <mi>A</mi> <mrow> <mo>(</mo> <mi>R</mi> <mo>|</mo> <mi>T</mi> <mo>)</mo> </mrow> <msup> <mi>M</mi> <mo>&amp;prime;</mo> </msup> <mo>,</mo> </mrow> <mrow><msup><mi>m</mi><mo>&amp;prime;</mo></msup><mo>=</mo><mfrac><mn>1</mn><msub><mi>z</mi><mi>c</mi></msub></mfrac><mi>A</mi><mrow><mo>(</mo><mi>R</mi><mo>|</mo><mi>T</mi><mo>)</mo></mrow><msup><mi>M</mi><mo>&amp;prime;</mo></msup><mo>,</mo></mrow> 其中zc为尺度因子;此外,相机畸变模型满足如下关系:where z c is the scale factor; in addition, the camera distortion model satisfies the following relationship: <mrow> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <msub> <mi>x</mi> <mrow> <mi>c</mi> <mi>o</mi> <mi>r</mi> </mrow> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>y</mi> <mrow> <mi>c</mi> <mi>o</mi> <mi>r</mi> </mrow> </msub> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>+</mo> <msub> <mi>k</mi> <mn>1</mn> </msub> <msup> <mi>r</mi> <mn>2</mn> </msup> <mo>+</mo> <msub> <mi>k</mi> <mn>2</mn> </msub> <msup> <mi>r</mi> <mn>4</mn> </msup> <mo>+</mo> <msub> <mi>k</mi> <mn>3</mn> </msub> <msup> <mi>r</mi> <mn>6</mn> </msup> <mo>)</mo> </mrow> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <mi>x</mi> </mtd> </mtr> <mtr> <mtd> <mi>y</mi> </mtd> </mtr> </mtable> </mfenced> <mo>+</mo> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <mn>2</mn> <msub> <mi>p</mi> <mn>1</mn> </msub> <mi>x</mi> <mi>y</mi> <mo>+</mo> <msub> <mi>p</mi> <mn>2</mn> </msub> <mo>(</mo> <msup> <mi>r</mi> <mn>2</mn> </msup> <mo>+</mo> <mn>2</mn> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>)</mo> </mtd> </mtr> <mtr> <mtd> <msub> <mi>p</mi> <mn>1</mn> </msub> <mo>(</mo> <msup> <mi>r</mi> <mn>2</mn> </msup> <mo>+</mo> <mn>2</mn> <msup> <mi>y</mi> <mn>2</mn> </msup> <mo>)</mo> <mo>+</mo> <mn>2</mn> <msub> <mi>p</mi> <mn>2</mn> </msub> <mi>x</mi> <mi>y</mi> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> <mrow><mfenced open = "(" close = ")"><mtable><mtr><mtd><msub><mi>x</mi><mrow><mi>c</mi><mi>o</mi><mi>r</mi></mrow></msub></mtd></mtr><mtr><mtd><msub><mi>y</mi><mrow><mi>c</mi><mi>o</mi><mi>r</mi></mrow></msub></mtd></mtr></mtable></mfenced><mo>=</mo><mrow><mo>(</mo><mn>1</mn><mo>+</mo><msub><mi>k</mi><mn>1</mn></msub><msup><mi>r</mi><mn>2</mn></msup><mo>+</mo><msub><mi>k</mi><mn>2</mn></msub><msup><mi>r</mi><mn>4</mn></msup><mo>+</mo><msub><mi>k</mi><mn>3</mn></msub><msup><mi>r</mi><mn>6</mn></msup><mo>)</mo></mrow><mfenced open = "(" close = ")"><mtable><mtr><mtd><mi>x</mi></mtd></mtr><mtr><mtd><mi>y</mi></mtd></mtr></mtable></mfenced><mo>+</mo><mfenced open = "(" close = ")"><mtable><mtr><mtd><mn>2</mn><msub><mi>p</mi><mn>1</mn></msub><mi>x</mi><mi>y</mi><mo>+</mo><msub><mi>p</mi><mn>2</mn></msub><mo>(</mo><msup><mi>r</mi><mn>2</mn></msup><mo>+</mo><mn>2</mn><msup><mi>x</mi><mn>2</mn></msup><mo>)</mo></mtd></mtr><mtr><mtd><msub><mi>p</mi><mn>1</mn></msub><mo>(</mo><msup><mi>r</mi><mn>2</mn></msup><mo>+</mo><mn>2</mn><msup><mi>y</mi><mn>2</mn></msup><mo>)</mo><mo>+</mo><mn>2</mn><msub><mi>p</mi><mn>2</mn></msub><mi>x</mi><mi>y</mi></mtd></mtr></mtable></mfenced><mo>,</mo></mrow> 其中,(x,y)为畸变纠正前的图像物理坐标,(xcor,ycor)为畸变纠正后的图像物理坐标,r=x2+y2,k1,k2,k3,p1,p2为相机的3个径向畸变系数和2个切向畸变系数;Among them, (x, y) are the physical coordinates of the image before distortion correction, (x cor , y cor ) are the physical coordinates of the image after distortion correction, r=x 2 +y 2 ,k 1 ,k 2 ,k 3 ,p 1 , p 2 are three radial distortion coefficients and two tangential distortion coefficients of the camera; 第一工业相机和第二工业相机标定的目的为求解相机内参数、外参数和畸变系数,将测量平台设为零平面,采用张正友棋盘平面标定法,通过改变棋盘的位置和角度拍摄20张图像,进行相机的标定,并求解得到相机内参数、外参数和畸变系数;The purpose of the calibration of the first industrial camera and the second industrial camera is to solve the internal parameters, external parameters and distortion coefficient of the camera. The measurement platform is set as the zero plane, and Zhang Zhengyou’s checkerboard plane calibration method is used to take 20 images by changing the position and angle of the checkerboard. , to calibrate the camera, and solve to obtain the camera internal parameters, external parameters and distortion coefficients; 步骤三,将物流箱置于测量平台上,激光光源照射物流箱,并在物流箱的上表面形成激光点,蓝牙电子秤探测物流箱的重量,当蓝牙电子秤的数据稳定时,记录物流箱重量并将数据通过电子秤上的蓝牙模块传输给信号处理系统,之后信号处理系统将重量数据传输给第一工业相机并触发其采集物流箱的侧视图像C1,第一工业相机默认为小光圈模式,这样能够保证采集的图像亮度低,易于后期对图像中激光点的提取;先对侧视图像C1进行二值化处理得到侧视图像C2,再对侧视图像C2进行激光点轮廓提取,获得激光点的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为侧视图像特征点R的像素坐标(u1,v1),之后第一工业相机将侧视图像特征点R像素坐标(u1,v1)传输到信号处理系统,信号处理系统将重量数据和侧视图像特征点R像素坐标(u1,v1)传输到第二工业相机;Step 3, place the logistics box on the measurement platform, the laser light source illuminates the logistics box, and forms a laser spot on the upper surface of the logistics box, the Bluetooth electronic scale detects the weight of the logistics box, and when the data of the Bluetooth electronic scale is stable, record the logistics box Weight and transmit the data to the signal processing system through the Bluetooth module on the electronic scale, and then the signal processing system transmits the weight data to the first industrial camera and triggers it to collect the side view image C1 of the logistics box. The first industrial camera defaults to a small aperture mode, which can ensure that the brightness of the collected image is low, and it is easy to extract the laser point in the image in the later stage; firstly, the side-view image C1 is binarized to obtain the side-view image C2, and then the side-view image C2 is extracted from the laser point outline. After obtaining the outline of the laser point, take its smallest enclosing circle, and determine the pixel coordinates of the center of the smallest enclosing circle. The pixel coordinates of the center of the circle are the pixel coordinates (u1, v1) of the feature point R of the side-view image. After that, the first industrial camera The side-view image feature point R pixel coordinates (u1, v1) are transmitted to the signal processing system, and the signal processing system transmits the weight data and the side-view image feature point R pixel coordinates (u1, v1) to the second industrial camera; 步骤四,第二工业相机接收到重量数据和侧视图像特征点R像素坐标(u1,v1)后,触发第二工业相机采集物流箱的俯视图像,具体工作流程如下:Step 4: After the second industrial camera receives the weight data and the R pixel coordinates (u1, v1) of the feature point of the side-view image, it triggers the second industrial camera to collect the top-view image of the logistics box. The specific workflow is as follows: (1)第二工业相机默认为小光圈模式,小光圈模式能够保证采集的图像亮度低,易于后期获取激光点的像素坐标;激光光源照射物流箱,并在物流箱的上表面形成激光点;第二工业相机采集第一张物流箱的俯视图像F1,先对俯视图像F1进行二值化处理得到俯视图像F2,再对俯视图像F2进行激光点轮廓提取,获得激光点的轮廓后取其最小包围圆形,并确定最小包围圆形的圆心像素坐标,此圆心像素坐标即为俯视图像特征点L像素坐标(u2,v2);(1) The second industrial camera defaults to the small aperture mode. The small aperture mode can ensure that the captured image has low brightness and is easy to obtain the pixel coordinates of the laser point in the later stage; the laser light source illuminates the logistics box and forms a laser point on the upper surface of the logistics box; The second industrial camera collects the top-view image F1 of the first logistics box, first binarizes the top-view image F1 to obtain the top-view image F2, then extracts the contour of the laser point from the top-view image F2, obtains the contour of the laser point and takes the minimum Enclose the circle, and determine the center pixel coordinates of the smallest encircling circle, the center pixel coordinates are the L pixel coordinates (u2, v2) of the feature point of the overlooking image; (2)第二工业相机自动转换为大光圈模式,保证采集的图像亮度高,可清晰区分出物流箱与背景;第二工业相机采集第二张物流箱的俯视图像F2,对俯视图像F2进行边缘提取得到俯视图像F3,再对俯视图像F3进行轮廓提取并在提取到的多个轮廓中通过判断轮廓的周长剔除背景杂质的干扰,最后得到只包含物流箱轮廓的俯视图像F4,此时,若俯视图像F4中闭合轮廓数为0,则返回错误信息给信号处理系统,表示物流箱没有完全位于第一相机视场范围内,需要重新摆放;最后对正确的俯视图像F4的轮廓提取其最小外接矩形,并获得最小外接矩形的图像长宽数据l和w;(2) The second industrial camera automatically switches to the large aperture mode to ensure the high brightness of the captured image, and can clearly distinguish the logistics box from the background; the second industrial camera collects the second overhead image F2 of the logistics box, and performs an image analysis on the overhead image F2 The edge is extracted to obtain the top-view image F3, and then the contour is extracted from the top-view image F3, and the interference of background impurities is eliminated by judging the perimeter of the contour among the multiple extracted contours, and finally the top-view image F4 containing only the contour of the logistics box is obtained. , if the number of closed contours in the top-view image F4 is 0, an error message will be returned to the signal processing system, indicating that the logistics box is not completely within the field of view of the first camera and needs to be rearranged; finally, the correct contour of the top-view image F4 is extracted Its minimum circumscribed rectangle, and obtain the image length and width data l and w of the minimum circumscribed rectangle; 步骤五,第二工业相机进行激光特征点匹配的三维重构算法,具体工作流程如下:Step five, the second industrial camera performs the 3D reconstruction algorithm of laser feature point matching, the specific workflow is as follows: (1)通过步骤二中第一工业相机和第二工业相机标定得到的内参数和外参数,可建立激光特征点像素坐标(u,v)与三维世界坐标(X,Y,Z)之间的对应关系,即:(1) Through the internal parameters and external parameters obtained by the calibration of the first industrial camera and the second industrial camera in step 2, the relationship between the pixel coordinates (u, v) of the laser feature point and the three-dimensional world coordinates (X, Y, Z) can be established. The corresponding relationship, that is: <mrow> <mi>Z</mi> <mi>c</mi> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <mi>u</mi> </mtd> </mtr> <mtr> <mtd> <mi>v</mi> </mtd> </mtr> <mtr> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mo>=</mo> <mi>A</mi> <mrow> <mo>(</mo> <mi>R</mi> <mo>|</mo> <mi>T</mi> <mo>)</mo> </mrow> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <mi>X</mi> </mtd> </mtr> <mtr> <mtd> <mi>Y</mi> </mtd> </mtr> <mtr> <mtd> <mi>Z</mi> </mtd> </mtr> <mtr> <mtd> <mn>1</mn> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> <mrow><mi>Z</mi><mi>c</mi><mfenced open = "[" close = "]"><mtable><mtr><mtd><mi>u</mi></mtd></mtr><mtr><mtd><mi>v</mi></mtd></mtr><mtr><mtd><mn>1</mn></mtd></mtr></mtable></mfenced><mo>=</mo><mi>A</mi><mrow><mo>(</mo><mi>R</mi><mo>|</mo>mo><mi>T</mi><mo>)</mo></mrow><mfenced open = "[" close = "]"><mtable><mtr><mtd><mi>X</mi></mtd></mtr><mtr><mtd><mi>Y</mi></mtd></mtr><mtr><mtd><mi>Z</mi></mtd></mtr><mtr><mtd><mn>1</mn></mtd></mtr></mtable></mfenced><mo>,</mo></mrow> 其中A为内参数矩阵(R|T)为外参数矩阵,R为相机光心坐标系相对于世界坐标系的3×3旋转矩阵,T为相机光心坐标系相对于世界坐标系的3×1平移矩阵;where A is the internal parameter matrix (R|T) is the external parameter matrix, R is the 3×3 rotation matrix of the camera optical center coordinate system relative to the world coordinate system, and T is the 3×1 translation matrix of the camera optical center coordinate system relative to the world coordinate system; (2)第二工业相机获取步骤二中第一工业相机和第二工业相机标定得到的内参数和外参数,利用步骤三和步骤四中得到的侧视图像特征点R像素坐标(u1,v1)和俯视图像特征点L像素坐标(u2,v2),分别代入步骤五(1)中的关系式,可以建立一对激光特征点像素坐标和该点三维世界坐标的方程组,通过最小二乘法解得世界坐标(X,Y,Z)从而还原激光特征点在世界坐标系中的真实位置,完成激光特征点匹配的三维重构过程,其中Z即为物流箱的高度数据;(2) The second industrial camera obtains the internal parameters and external parameters obtained by the calibration of the first industrial camera and the second industrial camera in step 2, and uses the R pixel coordinates (u1, v1) of the side-view image feature points obtained in step 3 and step 4 ) and the pixel coordinates (u2, v2) of the feature point L of the top-view image are respectively substituted into the relational formula in step 5 (1), and a pair of equations of the pixel coordinates of the laser feature point and the three-dimensional world coordinates of the point can be established, and the least square method Solve the world coordinates (X, Y, Z) to restore the real position of the laser feature point in the world coordinate system, and complete the three-dimensional reconstruction process of laser feature point matching, where Z is the height data of the logistics box; 步骤六,第二工业相机进行物流箱真实长宽数据计算,通过步骤四(2)得到的图像长宽数据l,w和预先测量的相机高度H和相机焦距f,根据光学成像模型中相似三角形的计算公式:Step six, the second industrial camera calculates the real length and width data of the logistics box, and the image length and width data l, w obtained in step four (2) and the pre-measured camera height H and camera focal length f, according to the similar triangle in the optical imaging model The formula for calculating: <mrow> <mfrac> <mrow> <mi>p</mi> <mi>i</mi> <mi>x</mi> <mo>*</mo> <mi>&amp;Delta;</mi> </mrow> <mrow> <mi>L</mi> <mrow> <mo>(</mo> <mi>W</mi> <mo>)</mo> </mrow> </mrow> </mfrac> <mo>=</mo> <mfrac> <mi>f</mi> <mrow> <mi>H</mi> <mo>-</mo> <mi>h</mi> </mrow> </mfrac> <mo>,</mo> </mrow> <mrow><mfrac><mrow><mi>p</mi><mi>i</mi><mi>x</mi><mo>*</mo><mi>&amp;Delta;</mi></mrow><mrow><mi>L</mi><mrow><mo>(</mo><mi>W</mi><mo>)</mo></mrow></mrow></mfrac><mo>=</mo><mfrac><mi>f</mi><mrow><mi>H</mi><mo>-</mo><mi>h</mi></mrow></mfrac><mo>,</mo></mrow> 其中pix表示图像中长或者宽的像素个数,Δ表示像素大小,图像长宽数据l或w的值为其各自对应的pix*Δ,即l=pix*Δ或者w=pix*Δ,f为焦距,H为相机距测量平台高度,h为物流箱高度,从而可计算得出物流箱实际长宽信息L和W,则物流箱体积V为V=L*W*Z,将物流箱体积信息传输给信号处理系统;Among them, pix represents the number of long or wide pixels in the image, Δ represents the pixel size, and the value of the image length and width data l or w is its corresponding pix*Δ, that is, l=pix*Δ or w=pix*Δ, f is the focal length, H is the height of the camera from the measurement platform, and h is the height of the logistics box, so that the actual length and width information L and W of the logistics box can be calculated, then the volume of the logistics box V is V=L*W*Z, the volume of the logistics box Information transmission to the signal processing system; 步骤七,信号处理系统的显示屏显示物流箱体积及重量信息,或者显示摆放错误的提示信息。In step seven, the display screen of the signal processing system displays the volume and weight information of the logistics box, or displays a prompt message indicating that it is placed incorrectly.
CN201710994098.0A 2017-10-23 2017-10-23 A binocular vision volume weight measurement system and its realization method Active CN107869954B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710994098.0A CN107869954B (en) 2017-10-23 2017-10-23 A binocular vision volume weight measurement system and its realization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710994098.0A CN107869954B (en) 2017-10-23 2017-10-23 A binocular vision volume weight measurement system and its realization method

Publications (2)

Publication Number Publication Date
CN107869954A true CN107869954A (en) 2018-04-03
CN107869954B CN107869954B (en) 2023-05-16

Family

ID=61752504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710994098.0A Active CN107869954B (en) 2017-10-23 2017-10-23 A binocular vision volume weight measurement system and its realization method

Country Status (1)

Country Link
CN (1) CN107869954B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109000563A (en) * 2018-07-19 2018-12-14 工极(北京)智能科技有限公司 Intelligent three-dimensional stereometer type instrument based on monocular cam combination
CN110558988A (en) * 2018-06-05 2019-12-13 北京远见医疗技术发展有限责任公司 head and face whole body parameter measuring method and equipment
CN110751620A (en) * 2019-08-28 2020-02-04 宁波海上鲜信息技术有限公司 Method for estimating volume and weight, electronic device, and computer-readable storage medium
CN111307659A (en) * 2020-03-11 2020-06-19 河南理工大学 Rapid density measuring system for irregular rigid object
CN111595264A (en) * 2020-05-29 2020-08-28 广西玉柴机器股份有限公司 Method for digital rapid detection and analysis of sand core
CN114313748A (en) * 2022-01-29 2022-04-12 浙江凯乐士科技集团股份有限公司 Automatic warehousing system
CN114755139A (en) * 2022-03-01 2022-07-15 南京旗硕物联科技有限公司 An automatic curve coding system with the function of measuring the moisture content of the curve block
CN114985304A (en) * 2022-05-25 2022-09-02 杭州电子科技大学 Waste television specification detection method based on machine vision
CN115035201A (en) * 2022-06-06 2022-09-09 易麦斯智能科技(无锡)有限公司 Automatic shoelace threading method and system based on 3D vision

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266131A (en) * 2008-04-08 2008-09-17 长安大学 An image-based volume measuring device and its measuring method
CN102063718A (en) * 2010-12-24 2011-05-18 江南大学 Field calibration and precision measurement method for spot laser measuring system
US20120218437A1 (en) * 2009-10-17 2012-08-30 Alexander Thomas Hermary Enhanced imaging method and apparatus
CN102679915A (en) * 2012-05-24 2012-09-19 河北工业大学 Method and system for measuring volumes and weights of continuously conveyed long objects based on optical measurement
CN202853580U (en) * 2012-08-28 2013-04-03 成都志诚弘毅科技有限公司 Apparatus for dynamic measurement of vehicle outer contour dimension and weight
CN104457574A (en) * 2014-12-11 2015-03-25 天津大学 Device for measuring volume of irregular object in non-contact measurement mode and method
CN104457569A (en) * 2014-11-27 2015-03-25 大连理工大学 Geometric parameter visual measurement method for large composite board
CN104655249A (en) * 2015-03-16 2015-05-27 武汉大学 System and method for automatically measuring dimension and weight of road vehicle
CN204630950U (en) * 2015-05-29 2015-09-09 杭州利珀科技有限公司 A kind of crown cap defect intelligent detection equipment
CN104897060A (en) * 2015-06-17 2015-09-09 大连理工大学 large Large field of view global measurement method using coordinates tracking control board
CN106052820A (en) * 2016-06-03 2016-10-26 广州市中崎商业机器股份有限公司 Logistic freight automatic calculating system and method
US20170154436A1 (en) * 2015-05-27 2017-06-01 Zhuhai Ritech Technology Co. Ltd. Stereoscopic vision three dimensional measurement method and system for calculating laser speckle as texture
CN106839975A (en) * 2015-12-03 2017-06-13 杭州海康威视数字技术股份有限公司 Volume measuring method and its system based on depth camera
CN107255498A (en) * 2017-06-02 2017-10-17 西安理工大学 Conveyer belt weight of material measuring system and measuring method based on binocular vision

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266131A (en) * 2008-04-08 2008-09-17 长安大学 An image-based volume measuring device and its measuring method
US20120218437A1 (en) * 2009-10-17 2012-08-30 Alexander Thomas Hermary Enhanced imaging method and apparatus
CN102063718A (en) * 2010-12-24 2011-05-18 江南大学 Field calibration and precision measurement method for spot laser measuring system
CN102679915A (en) * 2012-05-24 2012-09-19 河北工业大学 Method and system for measuring volumes and weights of continuously conveyed long objects based on optical measurement
CN202853580U (en) * 2012-08-28 2013-04-03 成都志诚弘毅科技有限公司 Apparatus for dynamic measurement of vehicle outer contour dimension and weight
CN104457569A (en) * 2014-11-27 2015-03-25 大连理工大学 Geometric parameter visual measurement method for large composite board
CN104457574A (en) * 2014-12-11 2015-03-25 天津大学 Device for measuring volume of irregular object in non-contact measurement mode and method
CN104655249A (en) * 2015-03-16 2015-05-27 武汉大学 System and method for automatically measuring dimension and weight of road vehicle
US20170154436A1 (en) * 2015-05-27 2017-06-01 Zhuhai Ritech Technology Co. Ltd. Stereoscopic vision three dimensional measurement method and system for calculating laser speckle as texture
CN204630950U (en) * 2015-05-29 2015-09-09 杭州利珀科技有限公司 A kind of crown cap defect intelligent detection equipment
CN104897060A (en) * 2015-06-17 2015-09-09 大连理工大学 large Large field of view global measurement method using coordinates tracking control board
CN106839975A (en) * 2015-12-03 2017-06-13 杭州海康威视数字技术股份有限公司 Volume measuring method and its system based on depth camera
CN106052820A (en) * 2016-06-03 2016-10-26 广州市中崎商业机器股份有限公司 Logistic freight automatic calculating system and method
CN107255498A (en) * 2017-06-02 2017-10-17 西安理工大学 Conveyer belt weight of material measuring system and measuring method based on binocular vision

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHANG WANG等: "Design of Dynamic Volume Measure System Based on Binocular Vision" *
QIONG LIU等: "Structural Parameters Optimal Design and Accuracy Analysis for Binocular Vision Measure System" *
毛佳红等: "基于线结构光的双目三维体积测量系统" *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110558988A (en) * 2018-06-05 2019-12-13 北京远见医疗技术发展有限责任公司 head and face whole body parameter measuring method and equipment
CN109000563B (en) * 2018-07-19 2024-04-09 工极(北京)智能科技有限公司 Intelligent three-dimensional measuring instrument based on monocular camera combination
CN109000563A (en) * 2018-07-19 2018-12-14 工极(北京)智能科技有限公司 Intelligent three-dimensional stereometer type instrument based on monocular cam combination
CN110751620A (en) * 2019-08-28 2020-02-04 宁波海上鲜信息技术有限公司 Method for estimating volume and weight, electronic device, and computer-readable storage medium
CN110751620B (en) * 2019-08-28 2021-03-16 宁波海上鲜信息技术有限公司 Method for estimating volume and weight, electronic device, and computer-readable storage medium
CN111307659A (en) * 2020-03-11 2020-06-19 河南理工大学 Rapid density measuring system for irregular rigid object
CN111595264A (en) * 2020-05-29 2020-08-28 广西玉柴机器股份有限公司 Method for digital rapid detection and analysis of sand core
CN114313748A (en) * 2022-01-29 2022-04-12 浙江凯乐士科技集团股份有限公司 Automatic warehousing system
CN114755139A (en) * 2022-03-01 2022-07-15 南京旗硕物联科技有限公司 An automatic curve coding system with the function of measuring the moisture content of the curve block
CN114755139B (en) * 2022-03-01 2025-01-24 南京旗硕物联科技有限公司 An automatic code system with moisture content measurement function for blocks
CN114985304A (en) * 2022-05-25 2022-09-02 杭州电子科技大学 Waste television specification detection method based on machine vision
CN114985304B (en) * 2022-05-25 2023-10-13 杭州电子科技大学 Machine vision-based waste television specification detection method
CN115035201A (en) * 2022-06-06 2022-09-09 易麦斯智能科技(无锡)有限公司 Automatic shoelace threading method and system based on 3D vision
CN115035201B (en) * 2022-06-06 2023-09-29 易麦斯智能科技(无锡)有限公司 Automatic shoelace threading method and system based on 3D vision

Also Published As

Publication number Publication date
CN107869954B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN107869954B (en) A binocular vision volume weight measurement system and its realization method
CN104713885B (en) A kind of structure light for pcb board on-line checking aids in binocular measuring method
CN103499302B (en) The camshaft diameter dimension On-line Measuring Method of structure based light Vision imaging system
CN106091984B (en) A method for acquiring 3D point cloud data based on line laser
CN103411553B (en) The quick calibrating method of multi-linear structured light vision sensors
CN107816943B (en) A logistics box volume and weight measurement system and its implementation method
CN109520436B (en) A machine vision-based automatic measuring system for three-dimensional size of butterfly spring and its measuring method
CN108550143A (en) A kind of measurement method of the vehicle length, width and height size based on RGB-D cameras
CN103175485A (en) Method for visually calibrating aircraft turbine engine blade repair robot
CN106485757A (en) A kind of Camera Calibration of Stereo Vision System platform based on filled circles scaling board and scaling method
CN109191520B (en) Plant leaf area measuring method and system based on color calibration
CN111366592B (en) Fragment automatic detection system based on industrial photogrammetry
CN110966956A (en) Binocular vision-based three-dimensional detection device and method
CN104655011A (en) Non-contact optical measurement method for volume of irregular convex-surface object
CN106289099B (en) A kind of single camera vision system and the three-dimensional dimension method for fast measuring based on the system
WO2022078442A1 (en) Method for 3d information acquisition based on fusion of optical scanning and smart vision
CN104990515A (en) Three-dimensional shape measurement system and method for large-size object
CN101551907B (en) Method for multi-camera automated high-precision calibration
CN107816942A (en) A kind of planar dimension measurement method based on cross structure light vision system
CN103615980A (en) Method and system for measuring parameters of round holes in plate
CN106996748A (en) Wheel diameter measuring method based on binocular vision
CN110260818B (en) A robust detection method for electronic connectors based on binocular vision
CN115014248B (en) Laser projection line identification and flatness judgment method
CN112561983A (en) Device and method for measuring and calculating surface weak texture and irregular stacking volume
CN112258455A (en) Detection method for detecting spatial position of part based on monocular vision

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant