摘要
为了获取目标物体在空间中的三维信息,本文在双目立体测量原理的基础上,采取OpenCV和Matlab相结合的方法,设计了一个基于双目立体视觉的目标物体测距系统。该系统采取张定友棋盘标定法,使用Matlab内置的工具箱完成双目相机标定,采用SGBM(Semi-Global Block Matching)立体匹配算法在VS2017环境下结合Opencv3.4.1库,对左右相机获得的图像进行立体匹配,生成视差图,将二维空间点重投影到三维空间中,实现二维坐标到三维坐标的转换,即可得到物体的三维点坐标。最终实现通过鼠标点选被测物体视差图后输出选定的空间三维坐标。实验结果显示,该系统的测量精度较高,并且在140 cm距离的测量精度最高。
To get the spatial three-dimensional information of the target object in space, this paper takes the approach of stereo vision measuring principle and designs a target object ranging system based on binocular stereo system. This system is accomplished by the combination of Opencv and Matlab. The binocular camera calibration was accomplished by using the built-in toolbox of Matlab based on the Zhang Dingyou chessboard calibration method. By conducting SGBM(Semi-global Block Matching) stereo matching algorithm adopted in VS2017 environment and Opencv3.4.1, images obtained by left and right cameras are matched in stereo, then parallax map is generated, 2 d space points are re-projected into 3 d space, 2 d coordinates are converted into 3 d coordinates, and 3 d point coordinates of objects can be obtained. Finally, select the parallax map of the measured object through the mouse and output the selected three-dimensional coordinates. Experimental results show that the measurement accuracy of the system is high, and the measurement accuracy is the highest at the distance of 140 cm.
作者
杨晨曦
华云松
YANG Chen-xi;HUA Yun-song(School of Optical-Electrical and Computer Engineering,University of Shanghai for Science and Technology,Shanghai 200093,China)
出处
《软件》
2020年第1期128-132,共5页
Software
关键词
双目视觉
目标测距
三维测量
相机标定
立体匹配
重投影
Binocular vision
Target ranging
Three-dimensional measurement
Camera calibration
Stereo matching
Reprojection