Home > other >  Small white solving opencv StereoBM and StereoSGBM cannot use.
Small white solving opencv StereoBM and StereoSGBM cannot use.

Time:09-25

# include "stdafx. H"
# include "CV. H"
# include "highgui. H"
# include "cvaux. H"
# include
# include
# include
# include

using namespace std;
Using the namespace CV;


# undef _GLIBCXX_DEBUG

# include "cxmisc. H"
#include
#include
#include
#include
#include

The static void StereoCalib (const char * imageList, int useUncalibrated);
Mx1 CvMat *;
My1 CvMat *;
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.0 e4.
////the FILE * fp=fopen (filename, "wt");
////fprintf (fp, "" X \ \ "" Y \ " \ "Z" \ n ");
////for (int y=0; Y & lt; Mat. Rows; Y++)
////{
////for (int x=0; X & lt; Mat. Cols; X++)
////{
////Vec3f point=mat. At////if (fabs (point [2] - max_z) & lt; FLT_EPSILON | | fabs (point [2]) & gt; Max_z) continue;
////fprintf (fp, "% f, % f, % f \ n", point [0] * 1000, point [1] * 1000, point [2] * 1000);
////}
////}
////fclose (fp);
////}

Int main (int arg c, char * * argv)
{
Const char * imageList="E: \ \ cOpenCVPro \ \ hellochess \ \ MyStereo_vision \ \ res \ \ Calibration TXT".
StereoCalib (imageList, 0);

Printf (" display depth map!==============");
//IplImage * srcLeft=cvLoadImage (" E: \ \ Trash \ \ L.j pg ", 1);
//IplImage * srcRight=cvLoadImage (" E: \ \ Trash \ \ R.j pg ", 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";

//=====================create calibration image display window===============================
/* cvNamedWindow (" rectified!" );
if (! IsVerticalStereo)
Pair=cvCreateMat (imageSize. Height, imageSize. Width * 2, CV_8UC3);
The 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, run the code, prompt E0322 are not allowed to use an abstract class type "CV: : StereoBM" object, how to solve ah
  • Related