资源简介
基于opencv2.4.9中的立体匹配三种算法,去掉了校正图像的步骤,可以直接使用校正好的标准图像进行实验,对比视差图的效果!环境是VS2010!
代码片段和文件信息
/*
* stereo_match.cpp
* calibration
*
* Created by Victor Eruhimov on 1/18/10.
* Copyright 2010 Argus Corp. All rights reserved.
*
*/
#include “opencv2/calib3d/calib3d.hpp“
#include “opencv2/imgproc/imgproc.hpp“
#include “opencv2/highgui/highgui.hpp“
#include “opencv2/contrib/contrib.hpp“
#include
using namespace cv;
static void print_help()
{
printf(“\nDemo stereo matching converting L and R images into disparity and point clouds\n“);
printf(“\nUsage: stereo_match [--algorithm=bm|sgbm|hh|var] [--blocksize=]\n“
“[--max-disparity=] [--scale=scale_factor>] [-i ] [-e ]\n“
“[--no-display] [-o ] [-p ]\n“);
}
static void saveXYZ(const char* filename const Mat& mat)
{
const double max_z = 1.0e4;
FILE* fp = fopen(filename “wt“);
for(int y = 0; y < mat.rows; y++)
{
for(int x = 0; x < mat.cols; x++)
{
Vec3f point = mat.at(y x);
if(fabs(point[2] - max_z) < FLT_EPSILON || fabs(point[2]) > max_z) continue;
fprintf(fp “%f %f %f\n“ point[0] point[1] point[2]);
}
}
fclose(fp);
}
int main(int argc char** argv)
{
argc=8;
argv[0]=“ex“;
argv[1]=“view1.png“;
argv[2]=“view5.png“;
//-----------此参数可调整立体匹配算法--------------------/
argv[3]=“--algorithm=bm“;
//----------共三种算法bm,sgbm,var---------------------/
argv[4]=“-i“;
// argv[5]=“intrinsics.txt“;
argv[6]=“-e“;
// argv[7]=“extrinsics.txt“;
const char* algorithm_opt = “--algorithm=“;
const char* maxdisp_opt = “--max-disparity=“;
const char* blocksize_opt = “--blocksize=“;
const char* nodisplay_opt = “--no-display“;
const char* scale_opt = “--scale=“;
if(argc < 3)
{
print_help();
return 0;
}
const char* img1_filename = 0;
const char* img2_filename = 0;
const char* intrinsic_filename = 0;
const char* extrinsic_filename = 0;
const char* disparity_filename = 0;
const char* point_cloud_filename = 0;
enum { STEREO_BM=0 STEREO_SGBM=1 STEREO_HH=2 STEREO_VAR=3 };
int alg = STEREO_SGBM;
int SADWindowSize = 0 numberOfDisparities = 0;
bool no_display = false;
float scale = 1.f;
StereoBM bm;
StereoSGBM sgbm;
StereoVar var;
for( int i = 1; i < argc; i++ )
{
if( argv[i][0] != ‘-‘ )
{
if( !img1_filename )
img1_filename = argv[i];
else
img2_filename = argv[i];
}
else if( strncmp(argv[i] algorithm_opt strlen(algorithm_opt)) == 0 )
{
char* _alg = argv[i] + strlen(algorithm_opt);
alg = strcmp(_alg “bm“) == 0 ? STEREO_BM :
strcmp(_alg “sgbm“) == 0 ? STEREO_SGBM :
strcmp(_alg “hh“) ==
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 61952 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\Debug\stereo_match.exe
文件 502568 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\Debug\stereo_match.ilk
文件 1305600 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\Debug\stereo_match.pdb
文件 54919168 2019-03-08 17:47 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\ipch\stereo_match-6b0451e3\stereo_match-132f894a.ipch
文件 758 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\cl.command.1.tlog
文件 15458 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\CL.read.1.tlog
文件 482 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\CL.write.1.tlog
文件 2 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 2 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 2 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 2 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 2 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 2 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 3562 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 9888 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 1014 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\li
文件 452 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\mt.command.1.tlog
文件 216 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\mt.read.1.tlog
文件 414 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\mt.write.1.tlog
文件 654 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\rc.command.1.tlog
文件 386 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\rc.read.1.tlog
文件 394 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\rc.write.1.tlog
文件 3171 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.Build.CppClean.log
文件 406 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.exe.em
文件 472 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.exe.em
文件 381 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.exe.intermediate.manifest
文件 74 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.lastbuildstate
文件 5276 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.log
文件 180542 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.obj
文件 0 2019-03-08 17:48 BM+SGBM+VAR\20190308-Testbm_match_2.4.9\stereo_match\Debug\stereo_match.write.1.tlog
............此处省略127个文件信息
- 上一篇:全国省级地市级县市级shp图层.zip
- 下一篇:公司员工考勤管理系统
相关资源
- 基于opencv的手写数字字符识别
- opencv数字识别更新
- MSChart+VS2010
- OpenCV 2.4.3编译生成的libdllinclude文件
- VS2010对Excel2010进行操作
- LearningOpenCV_Code.rar
- qt+opencv+人脸识别
- 《学习opencv中文版》于仕琪著 电子版
- 基于OpenCV的图像识别及跟踪程序
- opencv 2.4.10_vs2008_x86库
- opencv1.0Windows安装版
- opencv 3.4.0 安装需要的东西
- opencv4.2需要的文件.rar
- OpenCV资料
- opencv3.3需要的ippicv_2017u2_mac_intel64_20
- ippicv_2017u3_win_intel64_general_20180518.zip
- 2076个opencv分类器苹果样本及解释文件
- opencv+svm实现图像分类代码+训练图片
- cmake好的opencv
- opencv一维码识别
- opencv3_contrib_cmake_files
- 基于windows的蓝牙扫描、连接、通讯
- 最小二乘法求圆心和半径
- Qt OpenCV 播放及Socket发送视频流
- 基于特征点匹配的三维重建OpenCV+Ope
- opencv3.4+contrib编译好的文件
- OpenCV2.4x中文参考手册
- 编译好的worldwind1.4.0源码
- 基于qt4.8.6forVS2010的QGIS2.4.0的VS2010开发
- opencv 精解
评论
共有 条评论