关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

【变化检测】多时相遥感影像变化检测 Qt界面可视化 / 实现卷帘功能(附有完整代码)

发布时间:2023-06-26 15:00:32

由于数据具有保密性,这里就不贴效果图了,源代码是使用 c++ 实现的;

         卷帘功能版本3源代码链接:多时相遥感影像变化检测卷帘功能.zip-C++文档类资源-CSDN下载


1、卷帘功能版本1,实现效果如下: 


        输入的两张图片并行显示,通过拉杆,使一张图片移动,移动到两张图片完全重合时,显示变化检测效果;


2、卷帘功能版本2,实现效果如下: 


         输入的两张图片重叠显示,通过拉杆,边拉边显示变化检测效果;


3、卷帘功能版本3,实现效果如下: 


         版本3和版本2效果类似;

        版本3相比版本2的优点:

      (1)版本3大大压缩了代码量;

        (2)在拉动拉杆显示变化检测效果时,效率上大大提高,版本2显示时略有延迟;

        (3)版本3优化了版本2中的一些 bug;


4、下面给出版本2的代码


 (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中的个别路径需要读者自行修改;


/template/Home/leiyu/PC/Static