资源简介
三步相移法(VS2010)-相位计算
代码片段和文件信息
#include “three_step_phase_shift.h“
#include
/****************************************************
功能:构造函数
日期:2016-09-22
作者:lyang
备注:
准备操作-一致性判断,相关初始化
*****************************************************/
ThreeStepPhaseShift::ThreeStepPhaseShift(
IplImage *imgPhase1
IplImage *imgPhase2
IplImage *imgPhase3):
imgPhase1(imgPhase1)
imgPhase2(imgPhase2)
imgPhase3(imgPhase3)
mask(0)
process(0)
{
//一致性判断
width = imgPhase1->width;
height = imgPhase1->height;
if( width != imgPhase2->width ||
width != imgPhase3->width ||
height != imgPhase2->height ||
height != imgPhase3->height ) {
throw “invalid arguments: input images must have same dimension!“;
}
//创建四副图像,用于显示
int size = width*height;
imgColor = cvCreateImage(cvGetSize(imgPhase1)IPL_DEPTH_8U3);
imgPhase1Gray = cvCreateImage(cvGetSize(imgPhase1)IPL_DEPTH_8U1);
imgWrappedPhase = cvCreateImage(cvGetSize(imgPhase1)IPL_DEPTH_32F1);
imgUnwrappedPhase = cvCreateImage(cvGetSize(imgPhase1)IPL_DEPTH_32F1);
//变量定义
mask = new bool [size];
process = new bool [size];
quality = new float [size];
range = new float [size];
depth = new float [size];
// initilize matrices
noiseThreshold = 0.1;
zscale = 130;
zskew = 24;
// init step width for color and single channel images
step = width;
cout << “width: “ << width << “\nheight: “ << height << endl;
cout << “size “ << size << endl;
}
/****************************************************
功能:析构函数
日期:2016-09-22
作者:lyang
备注:
*****************************************************/
ThreeStepPhaseShift::~ThreeStepPhaseShift()
{
cvReleaseImage(&imgPhase1);
cvReleaseImage(&imgPhase2);
cvReleaseImage(&imgPhase3);
cvReleaseImage(&imgColor);
cvReleaseImage(&imgWrappedPhase);
delete[] mask;
delete[] process;
delete[] quality;
delete[] depth;
}
/****************************************************
功能:相位解算
日期:2016-09-22
作者:lyang
备注:
*****************************************************/
void ThreeStepPhaseShift::phaseDecode()
{
// Some initializing and optimization( only the sqrt thing )
float sqrt3 = sqrt(3.);
//int step = imgPhase1->widthStep;
uchar* ptrPhase1 = (uchar *)imgPhase1->imageData;
uchar* ptrPhase2 = (uchar *)imgPhase2->imageData;
uchar* ptrPhase3 = (uchar *)imgPhase3->imageData;
uchar* ptrColor = (uchar *)imgColor->imageData;
uchar* ptrGray = (uchar *)imgPhase1Gray->imageData;
float* ptrWrappedPhase = (float *)imgWrappedPhase->imageData;
int iiiic;
float phi1;
float phi2;
float phi3;
float phiSum;
float phiRange;
float phiMax;
float phiMin;
float noise;
float twoPi = CV_PI * 2;
int stepc = imgPhase1->widthStep;
cout << “step “ << step<< endl;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-09-22 19:12 Vision_Project_CV\
目录 0 2016-09-22 11:00 Vision_Project_CV\Debug\
文件 79360 2016-09-22 11:06 Vision_Project_CV\Debug\Vision_Project.exe
文件 570200 2016-09-22 11:06 Vision_Project_CV\Debug\Vision_Project.ilk
文件 1920000 2016-09-22 11:06 Vision_Project_CV\Debug\Vision_Project.pdb
目录 0 2016-09-22 11:05 Vision_Project_CV\Vision_Project\
目录 0 2016-09-22 11:07 Vision_Project_CV\Vision_Project\Debug\
文件 140436 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\CL.read.1.tlog
文件 4090 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\CL.write.1.tlog
文件 406 2016-04-18 21:03 Vision_Project_CV\Vision_Project\Debug\Vision_Project.exe.em
文件 472 2016-09-22 11:03 Vision_Project_CV\Vision_Project\Debug\Vision_Project.exe.em
文件 381 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\Vision_Project.exe.intermediate.manifest
文件 77 2016-09-22 11:07 Vision_Project_CV\Vision_Project\Debug\Vision_Project.lastbuildstate
文件 939 2016-09-22 11:07 Vision_Project_CV\Vision_Project\Debug\Vision_Project.log
文件 713 2016-04-18 21:56 Vision_Project_CV\Vision_Project\Debug\Vision_Project.vcxprojResolveAssemblyReference.cache
文件 0 2016-04-18 21:02 Vision_Project_CV\Vision_Project\Debug\Vision_Project.write.1.tlog
文件 218 2016-04-18 21:02 Vision_Project_CV\Vision_Project\Debug\Vision_Project_manifest.rc
文件 5334 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\cl.command.1.tlog
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
文件 2 2016-09-22 11:06 Vision_Project_CV\Vision_Project\Debug\li
............此处省略58个文件信息
- 上一篇:SFMtoolKit3工程
- 下一篇:POJ离线版题目
评论
共有 条评论