【双目视觉探索路3】分析整理Learning OpenCV3书中立体标定、校正以及对应代码(1)之总体

----------------------------------------------------------------------------------------------

*******由于本部分内容太长,建议同时打开两个窗口进行阅读***********

----------------------------------------------------------------------------------------------



其实上一篇还没写完,但网上各种参考资源交杂于OpenCV1.0和OpenCV3之间,看的脑袋有点乱,个人不太喜欢先扔一大段原理,然后没有程序示意的方式;倾向于简单粗暴的直接展示的模式

想了下还是先分析书上的源码可能比较靠谱。

配置

VS2017+OpenCV3.3

配置方法参见:OpenCV3.3.0在Visual Studio 2017上的配置

本部分内容为

基本原理+书上代码

书上down下来的源代码有点错误,在调试的过程中不断更改


基本原理

回顾一下立体视觉的基本内容

代码

代码来源:书上Stereo Calibration,Rectification and Correspondence Code Example

Raw Data

包含一个读取名称流的.txt文件,以及畸变很大的左右棋盘格图像各14幅

书上的代码样例,进行一段一段的分析:


#include <opencv2/opencv.hpp>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

using namespace std;

void help(char *argv[]) {
  cout
      << "\n\nExample 19-3. Stereo calibration, rectification, and "
         "correspondence"
      << "\n    Reads in list of locations of a sequence of checkerboard "
         "calibration"
      << "\n    objects from a left,right stereo camera pair. Calibrates, "
         "rectifies and then"
      << "\n    does stereo correspondence."
      << "\n"
      << "\n    This program will run on default parameters assuming you "
         "created a build directory"
      << "\n    directly below the Learning-OpenCV-3 directory and are "
         "running programs there.   NOTE: the list_of_stereo_pairs> must"
      << "\n    give the full path name to the left right images, in "
         "alternating"
      << "\n    lines: left image, right image, one path/filename per line, see"
      << "\n    stereoData/example_19-03_list.txt file, you can comment out "
         "lines"
      << "\n    there by starting them with #."
      << "\n"
      << "\nDefault Call (with parameters: board_w = 9, board_h = 6, list = "
         "../stereoData_19-03_list.txt):"
      << "\n" << argv[0] << "\n"
      << "\nManual call:"
      << "\n" << argv[0] << " [<board_w> <board_h> <path/list_of_stereo_pairs>]"
      << "\n\n PRESS ANY KEY TO STEP THROUGH RESULTS AT EACH 
  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值