#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "cvaux.h"
#include<iostream>
#include<direct.h>
#include<opencv2\opencv.hpp>
#include<opencv2\calib3d.hpp>
using namespace std;
using namespace cv;
#undef _GLIBCXX_DEBUG
#include "cxmisc.h"
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <ctype.h>
static void StereoCalib(const char* imageList, int useUncalibrated);
CvMat* mx1;
CvMat* my1;
CvMat* mx2;
CvMat* my2;
CvMat matQ;
bool isVerticalStereo = false;
//CvMat* pair;
CvSize imageSize = {0,0};
//cvMat part;
////void saveXYZ(const char* filename, const Mat& mat)
////{
//// const double max_z = 1.0e4;
//// FILE* fp = fopen(filename, "wt");
//// fprintf(fp, "\"X\" \"Y\" \"Z\"\n");
//// for(int y = 0; y < mat.rows; y++)
//// {
//// for(int x = 0; x < mat.cols; x++)
//// {
//// Vec3f point = mat.at<Vec3f>(y, x);
//// if(fabs(point[2] - max_z) < FLT_EPSILON || fabs(point[2]) > max_z) continue;
//// fprintf(fp, "%f %f %f\n", point[0]*1000, point[1]*1000, point[2]*1000);
//// }
//// }
//// fclose(fp);
////}
int main(int argc,char** argv)
{
const char* imageList = "E:\\cOpenCVPro\\hellochess\\MyStereo_vision\\res\\Calibration.txt";
StereoCalib(imageList,0);
printf("顯示深度圖!==============");
//IplImage* srcLeft = cvLoadImage("E:\\Trash\\L.jpg",1);
//IplImage* srcRight = cvLoadImage("E:\\Trash\\R.jpg",1);
const char* img1_filename = "E:\\cOpenCVPro\\hellochess\\MyStereo_vision\\res\\left01.jpg";
const char* img2_filename = "E:\\cOpenCVPro\\hellochess\\MyStereo_vision\\res\\right01.jpg";
const char* disparity_filename = "E:\\cOpenCVPro\\hellochess\\MyStereo_vision\\res\\disparity_filename.yml";
const char* point_cloud_filename = "E:\\cOpenCVPro\\hellochess\\MyStereo_vision\\res\\point_cloud_filename.yml";
//=====================創建顯示校正圖片的視窗===============================
/*cvNamedWindow("rectified!");
if (!isVerticalStereo)
pair = cvCreateMat(imageSize.height, imageSize.width*2, CV_8UC3);
else
pair = cvCreateMat(imageSize.height*2, imageSize.width, CV_8UC3);*/
enum { STEREO_BM=0, STEREO_SGBM=1, STEREO_HH=2 };
int alg = STEREO_SGBM;
int SADWindowSize = 0, numberOfDisparities = 0;
bool no_display = false;
StereoBM bm;
StereoSGBM sgbm;
VS2017+opencv3.4.1,運行代碼的時候,提示E0322 不允許使用抽象型別別 "cv::StereoBM" 的物件,怎么解決啊
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/73572.html
標籤:OpenCV
下一篇:指標實作 Treap
