文件名称:Source code
介绍说明--下载内容均来自于网络,请自行研究使用
在opencv上实现双目测距主要步骤是:
1.双目校正和标定,获得摄像头的参数矩阵:
进行标定得出俩摄像头的参数矩阵
cvStereoRectify 执行双目校正
initUndistortRectifyMap 分别生成两个图像校正所需的像素映射矩阵
cvremap 分别对两个图像进行校正
2.立体匹配,获得视差图:
stereoBM生成视差图
预处理: 图像归一化,减少亮度差别,增强纹理
匹配过程: 滑动sad窗口,沿着水平线进行匹配搜索,由于校正后左右图片平行,左图的特征可以在右图对应行找到最佳匹配
再过滤: 去除坏的匹配点 通过uniquenessratio
输出视差图disparity:如果左右匹配点比较稠密,匹配点多,得到的图像与原图相似度比较大, 如果匹配点比较稀疏,得到的点与原图 相似度比较小
3.得出测距:
把生成的视差图输入 reprojectImageTo3D()函数,生成3D点云,3D点云中保存有2D图像的三维坐标,再读出每帧图像的三维坐标中的z轴的值,就得出了距离数据。(Binocular distance measurement implemented on OpenCV)
1.双目校正和标定,获得摄像头的参数矩阵:
进行标定得出俩摄像头的参数矩阵
cvStereoRectify 执行双目校正
initUndistortRectifyMap 分别生成两个图像校正所需的像素映射矩阵
cvremap 分别对两个图像进行校正
2.立体匹配,获得视差图:
stereoBM生成视差图
预处理: 图像归一化,减少亮度差别,增强纹理
匹配过程: 滑动sad窗口,沿着水平线进行匹配搜索,由于校正后左右图片平行,左图的特征可以在右图对应行找到最佳匹配
再过滤: 去除坏的匹配点 通过uniquenessratio
输出视差图disparity:如果左右匹配点比较稠密,匹配点多,得到的图像与原图相似度比较大, 如果匹配点比较稀疏,得到的点与原图 相似度比较小
3.得出测距:
把生成的视差图输入 reprojectImageTo3D()函数,生成3D点云,3D点云中保存有2D图像的三维坐标,再读出每帧图像的三维坐标中的z轴的值,就得出了距离数据。(Binocular distance measurement implemented on OpenCV)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Source code\Debug\Projeect3.exe
Source code\Debug\Projeect3.ilk
Source code\Debug\Projeect3.pdb
Source code\Debug\Stereo Vision.exe
Source code\Debug\Stereo Vision.ilk
Source code\Debug\Stereo Vision.pdb
Source code\Projeect3\CalibFile\Backup\0517\CamData.yml
Source code\Projeect3\CalibFile\Backup\0517\M1.yml
Source code\Projeect3\CalibFile\Backup\0517\M2.yml
Source code\Projeect3\CalibFile\Backup\0517\mx1.yml
Source code\Projeect3\CalibFile\Backup\0517\mx2.yml
Source code\Projeect3\CalibFile\Backup\0517\my1.yml
Source code\Projeect3\CalibFile\Backup\0517\my2.yml
Source code\Projeect3\CalibFile\Backup\0517\Q.yml
Source code\Projeect3\CalibFile\Backup\0517\T.yml
Source code\Projeect3\CalibFile\Backup\0518\M1.yml
Source code\Projeect3\CalibFile\Backup\0518\M2.yml
Source code\Projeect3\CalibFile\Backup\0518\mx1.yml
Source code\Projeect3\CalibFile\Backup\0518\mx2.yml
Source code\Projeect3\CalibFile\Backup\0518\my1.yml
Source code\Projeect3\CalibFile\Backup\0518\my2.yml
Source code\Projeect3\CalibFile\Backup\0518\Q.yml
Source code\Projeect3\CalibFile\Backup\0518\T.yml
Source code\Projeect3\CalibFile\Backup\0520\CamData.yml
Source code\Projeect3\CalibFile\Backup\0520\M1.yml
Source code\Projeect3\CalibFile\Backup\0520\M2.yml
Source code\Projeect3\CalibFile\Backup\0520\mx1.yml
Source code\Projeect3\CalibFile\Backup\0520\mx2.yml
Source code\Projeect3\CalibFile\Backup\0520\my1.yml
Source code\Projeect3\CalibFile\Backup\0520\my2.yml
Source code\Projeect3\CalibFile\Backup\0520\Q.yml
Source code\Projeect3\CalibFile\Backup\0520\T.yml
Source code\Projeect3\CalibFile\Backup\0520_2\CamData.yml
Source code\Projeect3\CalibFile\Backup\0520_2\M1.yml
Source code\Projeect3\CalibFile\Backup\0520_2\M2.yml
Source code\Projeect3\CalibFile\Backup\0520_2\mx1.yml
Source code\Projeect3\CalibFile\Backup\0520_2\mx2.yml
Source code\Projeect3\CalibFile\Backup\0520_2\my1.yml
Source code\Projeect3\CalibFile\Backup\0520_2\my2.yml
Source code\Projeect3\CalibFile\Backup\0520_2\Q.yml
Source code\Projeect3\CalibFile\Backup\0520_2\T.yml
Source code\Projeect3\CalibFile\Backup\0520_3\CamData.yml
Source code\Projeect3\CalibFile\Backup\0520_3\M1.yml
Source code\Projeect3\CalibFile\Backup\0520_3\M2.yml
Source code\Projeect3\CalibFile\Backup\0520_3\mx1.yml
Source code\Projeect3\CalibFile\Backup\0520_3\mx2.yml
Source code\Projeect3\CalibFile\Backup\0520_3\my1.yml
Source code\Projeect3\CalibFile\Backup\0520_3\my2.yml
Source code\Projeect3\CalibFile\Backup\0520_3\Q.yml
Source code\Projeect3\CalibFile\Backup\0520_3\T.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\CamData.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\M1.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\M2.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\mx1.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\mx2.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\my1.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\my2.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\Q.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\T.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\CamData.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\M1.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\M2.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\mx1.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\mx2.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\my1.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\my2.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\Q.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\T.yml
Source code\Projeect3\CalibFile\CamData.yml
Source code\Projeect3\CalibFile\M1.yml
Source code\Projeect3\CalibFile\M2.yml
Source code\Projeect3\CalibFile\mx1.yml
Source code\Projeect3\CalibFile\mx2.yml
Source code\Projeect3\CalibFile\my1.yml
Source code\Projeect3\CalibFile\my2.yml
Source code\Projeect3\CalibFile\Q.yml
Source code\Projeect3\CalibFile\T.yml
Source code\Projeect3\CorrelationParams.txt
Source code\Projeect3\Debug\BuildLog.htm
Source code\Projeect3\Debug\Interpolation.obj
Source code\Projeect3\Debug\mt.dep
Source code\Projeect3\Debug\Projeect3.exe.embed.manifest
Source code\Projeect3\Debug\Projeect3.exe.embed.manifest.res
Source code\Projeect3\Debug\Projeect3.exe.intermediate.manifest
Source code\Projeect3\Debug\Projeect3.pch
Source code\Projeect3\Debug\stdafx.obj
Source code\Projeect3\Debug\Stereo Vision.exe.embed.manifest
Source code\Projeect3\Debug\Stereo Vision.exe.embed.manifest.res
Source code\Projeect3\Debug\Stereo Vision.exe.intermediate.manifest
Source code\Projeect3\Debug\Stereo Vision.pch
Source code\Projeect3\Debug\StereoFunctions.obj
Source code\Projeect3\Debug\StereoGrabber.obj
Source code\Projeect3\Debug\StereoMain.obj
Source code\Projeect3\Debug\vc90.idb
Source code\Projeect3\Debug\vc90.pdb
Source code\Projeect3\Disparities\DisparityMap.jpeg
Source code\Projeect3\Disparities\DisparityMap.jpg
Source code\Projeect3\Distance\DisparityMap.jpeg
Source code\Projeect3\Distance\Distance.dat
Source code\Projeect3\Distance\Img1r.jpeg
Source code\Debug\Projeect3.ilk
Source code\Debug\Projeect3.pdb
Source code\Debug\Stereo Vision.exe
Source code\Debug\Stereo Vision.ilk
Source code\Debug\Stereo Vision.pdb
Source code\Projeect3\CalibFile\Backup\0517\CamData.yml
Source code\Projeect3\CalibFile\Backup\0517\M1.yml
Source code\Projeect3\CalibFile\Backup\0517\M2.yml
Source code\Projeect3\CalibFile\Backup\0517\mx1.yml
Source code\Projeect3\CalibFile\Backup\0517\mx2.yml
Source code\Projeect3\CalibFile\Backup\0517\my1.yml
Source code\Projeect3\CalibFile\Backup\0517\my2.yml
Source code\Projeect3\CalibFile\Backup\0517\Q.yml
Source code\Projeect3\CalibFile\Backup\0517\T.yml
Source code\Projeect3\CalibFile\Backup\0518\M1.yml
Source code\Projeect3\CalibFile\Backup\0518\M2.yml
Source code\Projeect3\CalibFile\Backup\0518\mx1.yml
Source code\Projeect3\CalibFile\Backup\0518\mx2.yml
Source code\Projeect3\CalibFile\Backup\0518\my1.yml
Source code\Projeect3\CalibFile\Backup\0518\my2.yml
Source code\Projeect3\CalibFile\Backup\0518\Q.yml
Source code\Projeect3\CalibFile\Backup\0518\T.yml
Source code\Projeect3\CalibFile\Backup\0520\CamData.yml
Source code\Projeect3\CalibFile\Backup\0520\M1.yml
Source code\Projeect3\CalibFile\Backup\0520\M2.yml
Source code\Projeect3\CalibFile\Backup\0520\mx1.yml
Source code\Projeect3\CalibFile\Backup\0520\mx2.yml
Source code\Projeect3\CalibFile\Backup\0520\my1.yml
Source code\Projeect3\CalibFile\Backup\0520\my2.yml
Source code\Projeect3\CalibFile\Backup\0520\Q.yml
Source code\Projeect3\CalibFile\Backup\0520\T.yml
Source code\Projeect3\CalibFile\Backup\0520_2\CamData.yml
Source code\Projeect3\CalibFile\Backup\0520_2\M1.yml
Source code\Projeect3\CalibFile\Backup\0520_2\M2.yml
Source code\Projeect3\CalibFile\Backup\0520_2\mx1.yml
Source code\Projeect3\CalibFile\Backup\0520_2\mx2.yml
Source code\Projeect3\CalibFile\Backup\0520_2\my1.yml
Source code\Projeect3\CalibFile\Backup\0520_2\my2.yml
Source code\Projeect3\CalibFile\Backup\0520_2\Q.yml
Source code\Projeect3\CalibFile\Backup\0520_2\T.yml
Source code\Projeect3\CalibFile\Backup\0520_3\CamData.yml
Source code\Projeect3\CalibFile\Backup\0520_3\M1.yml
Source code\Projeect3\CalibFile\Backup\0520_3\M2.yml
Source code\Projeect3\CalibFile\Backup\0520_3\mx1.yml
Source code\Projeect3\CalibFile\Backup\0520_3\mx2.yml
Source code\Projeect3\CalibFile\Backup\0520_3\my1.yml
Source code\Projeect3\CalibFile\Backup\0520_3\my2.yml
Source code\Projeect3\CalibFile\Backup\0520_3\Q.yml
Source code\Projeect3\CalibFile\Backup\0520_3\T.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\CamData.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\M1.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\M2.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\mx1.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\mx2.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\my1.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\my2.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\Q.yml
Source code\Projeect3\CalibFile\Backup\Range 40cm\T.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\CamData.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\M1.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\M2.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\mx1.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\mx2.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\my1.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\my2.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\Q.yml
Source code\Projeect3\CalibFile\Backup\Range 80cm\T.yml
Source code\Projeect3\CalibFile\CamData.yml
Source code\Projeect3\CalibFile\M1.yml
Source code\Projeect3\CalibFile\M2.yml
Source code\Projeect3\CalibFile\mx1.yml
Source code\Projeect3\CalibFile\mx2.yml
Source code\Projeect3\CalibFile\my1.yml
Source code\Projeect3\CalibFile\my2.yml
Source code\Projeect3\CalibFile\Q.yml
Source code\Projeect3\CalibFile\T.yml
Source code\Projeect3\CorrelationParams.txt
Source code\Projeect3\Debug\BuildLog.htm
Source code\Projeect3\Debug\Interpolation.obj
Source code\Projeect3\Debug\mt.dep
Source code\Projeect3\Debug\Projeect3.exe.embed.manifest
Source code\Projeect3\Debug\Projeect3.exe.embed.manifest.res
Source code\Projeect3\Debug\Projeect3.exe.intermediate.manifest
Source code\Projeect3\Debug\Projeect3.pch
Source code\Projeect3\Debug\stdafx.obj
Source code\Projeect3\Debug\Stereo Vision.exe.embed.manifest
Source code\Projeect3\Debug\Stereo Vision.exe.embed.manifest.res
Source code\Projeect3\Debug\Stereo Vision.exe.intermediate.manifest
Source code\Projeect3\Debug\Stereo Vision.pch
Source code\Projeect3\Debug\StereoFunctions.obj
Source code\Projeect3\Debug\StereoGrabber.obj
Source code\Projeect3\Debug\StereoMain.obj
Source code\Projeect3\Debug\vc90.idb
Source code\Projeect3\Debug\vc90.pdb
Source code\Projeect3\Disparities\DisparityMap.jpeg
Source code\Projeect3\Disparities\DisparityMap.jpg
Source code\Projeect3\Distance\DisparityMap.jpeg
Source code\Projeect3\Distance\Distance.dat
Source code\Projeect3\Distance\Img1r.jpeg