卷帘功能版本3源代码链接:多时相遥感影像变化检测卷帘功能.zip-C++文档类资源-CSDN下载
输入的两张图片并行显示,通过拉杆,使一张图片移动,移动到两张图片完全重合时,显示变化检测效果;
输入的两张图片重叠显示,通过拉杆,边拉边显示变化检测效果;
版本3和版本2效果类似;
版本3相比版本2的优点:
(1)版本3大大压缩了代码量;
(2)在拉动拉杆显示变化检测效果时,效率上大大提高,版本2显示时略有延迟;
(3)版本3优化了版本2中的一些 bug;
(1)myPullcurtain.h 文件
#pragma once #pragma execution_character_set("utf-8") //防止界面中中文显示乱码 #include "ui_myPullcurtain.h" #include#include#include#include#include "opencv2\imgproc\types_c.h" #include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include const int IMAGE_ROW = 800; const int IMAGE_COL = 800; using namespace std; using namespace cv; class myPullcurtain : public QWidget { Q_OBJECT public: myPullcurtain(QWidget* parent = Q_NULLPTR); ~myPullcurtain(); //版本2 //初始化UI void initUI_1(); //初始化信号槽 void initSignalSlots_1(); //输入旧影像 void addOldImage_1(); //输入新影像 void addNewImage_1(); //拖动滑条槽函数 void pullCurttainSliderChanged_1(); //点击按钮槽函数 void pullCurttainSpinBoxChanged_1(double value); //移动图像 void imagePropotionChanged_1(double value); //重置图像 void pullCurttainReset_1(); private: Ui::myPullcurtain ui; //界面内容 QVBoxLayout* VLayout; QHBoxLayout* HLayout_1; QHBoxLayout* HLayout_2; QHBoxLayout* HLayout_3; QHBoxLayout* HLayout_4; QHBoxLayout* HLayout_5; QHBoxLayout* HLayout_6; //图像部分 QLabel* imageLabel_1; //文字说明 QLabel* imageLabel_2; //文字说明 QLineEdit* oldImageLine; QLineEdit* newImageLine; //QComboBox* imageComboBox; QPushButton* addOldImagePushButton; //添加新影像 QPushButton* addNewImagePushButton; //添加旧影像 QLabel* label_1; QLabel* label_2; QString imagePath_1; QString imagePath_2; Mat image2; //变化检测结果 Mat image_1, image_1_1; //图像处理 Mat image_2, image_2_2; //图例 QLabel* line_1; //用于显示变化检测后道路提示 QLabel* line_2; QLabel* line_3; QLabel* lineLabel_1; QLabel* lineLabel_2; QLabel* lineLabel_3; //拉杆部分 QLabel* pullCurttainLabel; QSlider* pullCurttainSlider; QSpinBox* pullCurttainSpinBox; QPushButton* pullCurttainResetPushButton; };
(2)myPullcurtain.cpp 文件
因涉及一些执行语句,禁止写入,请联系客服获取
注意:
(1)上述新建的是 Add QT Class 类;
(2)上述版本2中的个别路径需要读者自行修改;
Copyright © 2023 leiyu.cn. All Rights Reserved. 磊宇云计算 版权所有 许可证编号:B1-20233142/B2-20230630 山东磊宇云计算有限公司 鲁ICP备2020045424号
磊宇云计算致力于以最 “绿色节能” 的方式,让每一位上云的客户成为全球绿色节能和降低碳排放的贡献者