资源简介
提供四步相移的接口,可用于完整工程。主要利用Opencv::Mat类进行矩阵运算和索引,实现包裹相位的计算提取、多频解相进行解包裹、滤除噪声点。

代码片段和文件信息
#include “rebuildhandle.h“
#include
rebuildHandle::rebuildHandle(Qobject *parent): Qobject(parent)
{
}
void rebuildHandle::perform()
{
readSourceImg();
performStep4();
}
void rebuildHandle::readSourceImg()
{
QDir sourceImgDir(“../CtrlGUI/cal/after“);
QStringList filter(“*.bmp“);
QFileInfoList imgInfoList = sourceImgDir.entryInfoList(filterQDir::FilesQDir::Time|QDir::Reversed);
for (int i = 0; i < imgInfoList.count(); i++)
{
sourceImgs.append(imread(imgInfoList.at(i).filePath().toStdString()0));
}
}
void rebuildHandle::performStep4()
{
Mat_ target(9641292CV_64FC1);//最终相位
// 求出三个频率的相位主值
for(int i=0;i<964;i++)
{
for(int j=0;j<1292;j++)
{
double indexHigh=0;double indexMid=0;double indexLow=0;
indexHigh = atan2((sourceImgs.at(3).ptr(i)[j]-sourceImgs.at(1).ptr(i)[j])
(sourceImgs.at(2).ptr(i)[j]-sourceImgs.at(0).ptr(i)[j]));
indexMid = atan2((sourceImgs.at(7).ptr(i)[j]-sourceImgs.at(5).ptr(i)[j])
(sourceImgs.at(6).ptr(i)[j]-sourceImgs.at(4).ptr(i)[j]));
indexLow = atan2((sourceImgs.at(11).ptr(i)[j]-sourceImgs.at(9).ptr(i)[j])
(sourceImgs.at(10).ptr(i)[j]-sourceImgs.at(8).ptr(i)[j]));
QCoreApplication::processEvents();
indexHigh += 3.14159;
indexMid += 3.14159;
indexLow += 3.14159;
double indexTmp1=0;double indexTmp2=0;
indexTmp1=round((indexMid*5-indexHigh)/(2*3.14159));
indexTmp2=indexHigh+indexTmp1*2*3.14159;
double indexTarget1=0;double indexTarget2=0;
indexTarget1=round((indexLow*20-indexTmp2)/(10*3.14159));
indexTarget2=indexTmp2+indexTarget1*10*3.14159;
target.ptr(i)[j] = indexTarget2;
}
}
fitPhase(target);
}
void rebuildHandle::fitPhase(Mat &sourceMat)
{
Mat height(sourceMat.rowssourceMat.colsCV_8UC1);//最终显示结果
QFile dataFile(“../CtrlGUI/cal/pointCloud.txt“);
QTextStream stream;
stream.setDevice(&dataFile);
dataFile.open(QIODevice::Text|QIODevice::ReadWrite);
for(int i=0;i {
for(int j=0;j {
double tmpa = pow((sourceImgs.at(3).ptr(i)[j]-sourceImgs.at(1).ptr(i)[j])2);
double tmpb = pow((sourceImgs.at(2).ptr(i)[j]-sourceImgs.at(0).ptr(i)[j])2);
if(sqrt(tmpa+tmpb)<=30)
{
height.ptr(i)[j] = 0;
}
else
{
height.ptr(i)[j] = 5-sourceMat.ptr(i)[j];
stream< }
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 592 2020-04-25 07:27 rebuildhandle.h
文件 3155 2020-04-25 07:38 rebuildhandle.cpp
----------- --------- ---------- ----- ----
3747 2
- 上一篇:前推回代潮流计算
- 下一篇:多界面切换2.rar
相关资源
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- C 餐厅叫号系统(QT平)
- QT 实现文件下载
- qt图像处理
- 基于OpenCV的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- QT,JPEG解码源代码(已完成)
- Qt 播放音频文件
- Qt 读取16进制的data文件
- opencv环境配置
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- win10 64位下编译的opencv4.5.5库,opencv
- MQTT推送Demo
- 基于Linux、QT的视频监控系统的设计与
- Qt 百度地图 定位
- QT酷炫界面开发指南《QmlBook》
- Ubuntu下操作Excel,qt代码
- Qt图片浏览器 --基于Qt的Graphics View f
- qtnribbon2破解
- Qt软件开发 完整项目代码
- MQTT_3.1protocol_Specific中文版
- 在QT中使用RTP进行视频的采集和传输
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- Mini6410 Qt4和Qtopia编程开发指南
评论
共有 条评论