stereo-example.txt
资源名称:estereo2.zip [点击查看]
上传用户:fengshi120
上传日期:2014-07-17
资源大小:6155k
文件大小:1k
源码类别:
3D图形编程
开发平台:
C/C++
- #include "estereo.h"
- StereoMatching* stereo = new StereoMatching();
- stereo->setImageSize(320,240);
- stereo->setHoropter(0);
- stereo->setNumDepth(32);
- stereo->initializeContext();
- stereo->setCorrelationWindowSize(9,9);
- stereo->setUndefinedDepthValue(0);
- stereo->setAcceptDisparityThreshold(5);
- stereo->setCameraParameters(focallength,baseline,u0,v0);
- int stereo_grow_ScoreValidation = 20;
- int stereo_grow_nb_passes = 3;
- // 8-bits B&W images
- uchar *leftImage, *rightImage, *topImage;
- do {
- // grab images
- .....
- // do stereo
- stereo->doStereo(leftImage, rightImage, topImage);
- // improve stereo (optional)
- stereo->doStereo_grow(1, stereo_grow_ScoreValidation, stereo_grow_nb_passes);
- // do 3-D reconstruction (uses sub-pixel disparity)
- stereo->doReconstruction();
- // use getDisparityImage() to access 8-bits disparity image
- // use getXlist(), getYlist() and getZlist() and getNumPoints() to get 3-D reconstructions
- } while (...)