吉林大学学报(信息科学版) ›› 2014, Vol. 32 ›› Issue (2): 188-194.

• 论文 • 上一篇    下一篇

基于OpenCV的双目测距系统

王浩, 许志闻, 谢坤, 李杰, 宋成璐   

  1. 吉林大学 计算机科学与技术学院, 长春 130012
  • 出版日期:2014-03-25 发布日期:2014-06-12
  • 作者简介:王浩(1989—), 男, 河北邢台人, 吉林大学硕士研究生, 主要从事图像处理和机器视觉研究, (Tel)86-15143088608(E-mail)wunhao@foxmail.com; 通讯作者;许志闻(1965—), 男, 长春人, 吉林大学教授, 博士生导师, 主要从事网络流媒体、 计算机图形学与图像处理和生物信息学研究(Tel)86-013904310477(E-mail)xuzw@jlu.edu.cn。
  • 基金资助:

    国家自然科学基金资助项目(60973091); 吉林省科技发展基金资助项目(20130101166JC)

Binocular Measuring System Based on OpenCV

WANG Hao, XU Zhiwen, XIE Kun, LI Jie, SONG Chenglu   

  1. College of Computer Science and Technology, Jilin University, Changchun 130012, China
  • Online:2014-03-25 Published:2014-06-12

摘要:

为解决利用双目设备实现测距并使测距时间控制在毫秒级的问题, 研究了摄像机标定、 立体校正、 极线约束下的块匹配和三维重建等关键技术。使用立体相机将拍摄多个角度的棋盘照片保存到计算机中进行角点检测和标定, 以获得摄像机参数。使用Bouguet标定立体校正算法\, 立体匹配使用块匹配方法。得到视差图后求出三维点云, 进行三维重建, 根据三角相似原理计算目标物体的距离。使用OpenCV2.4.3, 在VS2010编译环境下, 用VC++编程实现。该系统只需普通立体相机采集图像, 成本低, 与其他立体匹配方法相比, 块匹配方案测距速度快且准确度满足应用的要求。

关键词: 开源计算机视觉库, 块匹配, 立体视觉, 三维重建, 测距

Abstract:

The main research is to get the distance by use of 3Dcamera. This article will explain some key technologies, such as camera calibration, stereo rectification, SAD(Sum of Absolute Differences), three-dimensional reconstruction and so on. The chessboard pictures are taken by the 3D camera from different angles, then saved to computer, and used to corner detection and camera calibration in order to get the parameters of the camera. Bouguet algorithm is selected as the stereo rectification algorithm. Stereo matching use SAD method. When we get the disparity map and the points clouds we start three-dimensional reconstruction work, then the distance between the target and camera is calculated based on similar triangles principle. The experiment is finished by OpenCV2.4.3(C++) and VS2010. This system only need an ordinary 3D-camera,which is not expensive. This system is time-saving and accurate when it is used.

Key words: OpenCV, sum of absolute differences(SAD), stereo vision, three-dimensional reconstruction, distance measurement

中图分类号: 

  • TP317.4