#include <QtGui>
#include <QtWidgets>
#include <string>
#include <QMainWindow>
#include "ui_mainwindow.h"
#include "mainwindow.h"
#include <QString>
#include <QFileDialog>
#include <QMessageBox>
#include <opencv2/core.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/photo.hpp>
#include <QTextCodec>
#include<QSlider>
#include<cmath>
#include<opencv2/imgproc.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/imgproc/types_c.h>
#include<math.h>
#include"paintwidget.h"
#include<qframe.h>
using namespace cv;
using namespace std;
QImage image;
QDockWidget *dock_Image; // 图像窗口
QDockWidget* dock_Tool;// 工具箱窗口
QDockWidget* dock_Geom;// 几何变换窗口
QDockWidget* dock_Gray;// 灰度变换窗口
QDockWidget* dock_Enhance;// 图像增强窗口
QDockWidget* dock_Morp;// 形态学处理窗口
QDockWidget* dock_Color;// 颜色模型窗口
QDockWidget* dock_Output;// 输出窗口
QScrollArea* scrollArea;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
Menu_File(); // 文件菜单
ToolWin();
InitImage(); // 初始化图像QLabel
setline();
setWindowTitle("photoshop");
// 软件图标
setWindowIcon(QIcon(":/2/ps.png"));
// 界面大小
resize(QApplication::desktop()->width()*0.9, QApplication::desktop()->height()*0.9);
move(QApplication::desktop()->width()*0.05, QApplication::desktop()->height()*0.01);
/* QWidget* p = takeCentralWidget(); //删除中央窗体
if (p)
delete p;*/
setDockNestingEnabled(true);
setCentralWidget(dock_Image);
//dock_Tool = new QDockWidget(tr("工具箱"), this);
addDockWidget(Qt::LeftDockWidgetArea, dock_Tool);
dock_Geom = new QDockWidget(tr("几何变换"), this); // 几何变换窗口
dock_Gray = new QDockWidget(tr("灰度变换"), this); // 灰度变换窗口
dock_Enhance = new QDockWidget(tr("图像增强"), this); // 图像增强窗口
dock_Morp = new QDockWidget(tr("形态学处理"), this); // 形态学处理窗口
//dock_Prop = new QDockWidget(tr("属性"), this); // 属性窗口
dock_Output = new QDockWidget(tr("输出直方图"), this); // 输出窗口
addDockWidget(Qt::BottomDockWidgetArea, dock_Output);
addDockWidget(Qt::RightDockWidgetArea, dock_Geom);
addDockWidget(Qt::RightDockWidgetArea, dock_Gray);
addDockWidget(Qt::RightDockWidgetArea, dock_Enhance);
addDockWidget(Qt::RightDockWidgetArea, dock_Morp);
//addDockWidget(Qt::RightDockWidgetArea, dock_Prop);
splitDockWidget(dock_Tool, dock_Image, Qt::Horizontal); // 水平
splitDockWidget(dock_Geom, dock_Output, Qt::Vertical); // 垂直
tabifyDockWidget(dock_Geom, dock_Gray);
tabifyDockWidget(dock_Gray, dock_Enhance);
tabifyDockWidget(dock_Enhance, dock_Morp);
tabifyDockWidget(dock_Morp, dock_Output);
///////////////////////////////几何变换////////////////////////////////////
QLabel *label2 = new QLabel(tr("反转图像"), dock_Geom);
QPushButton *button4 = new QPushButton(tr("图像反转"),dock_Geom);
connect(button4, SIGNAL(clicked()), this, SLOT(fanzhuan()));
QVBoxLayout *hlayout3 = new QVBoxLayout();
hlayout3->addWidget(label2);
hlayout3->addWidget(button4);
hlayout3->addSpacing(20);
QLabel *label10 = new QLabel(tr("旋转图像"), dock_Geom);
QPushButton *button30 = new QPushButton(tr("图像旋转30°"),dock_Geom);
QPushButton *button60 = new QPushButton(tr("图像旋转60°"),dock_Geom);
QPushButton *button90 = new QPushButton(tr("图像旋转90°"),dock_Geom);
connect(button30, SIGNAL(clicked()), this, SLOT(xuanzhuan30()));
connect(button60, SIGNAL(clicked()), this, SLOT(xuanzhuan60()));
connect(button90, SIGNAL(clicked()), this, SLOT(xuanzhuan90()));
QVBoxLayout *hlayoutfanzhuan = new QVBoxLayout();
hlayoutfanzhuan->addWidget(label10);
hlayoutfanzhuan->addWidget(button30);
hlayoutfanzhuan->addWidget(button60);
hlayoutfanzhuan->addWidget(button90);
hlayoutfanzhuan->addSpacing(20);
QVBoxLayout *pLayout7 = new QVBoxLayout(); // 使用垂直布局作为主布局
pLayout7->addStretch();
pLayout7->addLayout(hlayout3);
pLayout7->addSpacing(10);
pLayout7->addStretch();
pLayout7->addLayout(hlayoutfanzhuan);
pLayout7->addSpacing(10);
pLayout7->addStretch(); // 增加弹簧
setLayout(pLayout7);
QWidget *pWidget7 = new QWidget(dock_Geom);
pWidget7->setLayout(pLayout7);
dock_Geom->setWidget(pWidget7);
////////////////////////////灰度变换//////////////////////////////////////////
QLabel *label = new QLabel(tr("二值图像"), dock_Gray);
QPushButton *button1 = new QPushButton(tr("黑底二值化"),dock_Gray); // QPushButton按钮
connect(button1, SIGNAL(clicked()), this, SLOT(erzhihua1()));
QPushButton *button2 = new QPushButton(tr("白底二值化"),dock_Gray);
connect(button2, SIGNAL(clicked()), this, SLOT(erzhihua2()));
QVBoxLayout *hlayout = new QVBoxLayout();
hlayout->addWidget(label);
hlayout->addWidget(button1);
hlayout->addWidget(button2);
hlayout->addSpacing(20);
QLabel *label1 = new QLabel(tr("灰度图像"), dock_Gray);
QPushButton *button3 = new QPushButton(tr("灰度变换"),dock_Gray); // QPushButton按钮
connect(button3, SIGNAL(clicked()), this, SLOT(huidu()));
QVBoxLayout *hlayout2 = new QVBoxLayout();
hlayout->addWidget(label1);
hlayout->addWidget(button3);
hlayout->addSpacing(20);
QLabel *label3 = new QLabel(tr("直方图"), dock_Gray);
QPushButton *button5 = new QPushButton(tr("直方图均衡化"),dock_Gray); // QPushButton按钮
connect(button5, SIGNAL(clicked()), this, SLOT(junheng()));
QVBoxLayout *hlayout4 = new QVBoxLayout();
hlayout->addWidget(label3);
hlayout->addWidget(button5);
hlayout->addSpacing(20);
QVBoxLayout *pLayout = new QVBoxLayout(); // 使用垂直布局作为主布局
pLayout->addStretch();
pLayout->addLayout(hlayout);
pLayout->addSpacing(10);
pLayout->addStretch();
pLayout->addLayout(hlayout2);
pLayout->addSpacing(10);
pLayout->addStretch(); // 增加弹簧
pLayout->addLayout(hlayout4);
pLayout->addSpacing(10);
pLayout->addStretch();
setLayout(pLayout);
QWidget *pWidget = new QWidget(dock_Gray);
pWidget->setLayout(pLayout);
dock_Gray->setWidget(pWidget);
///////////////////////////图像增强//////////////////////////////////////////
QLabel *label4 = new QLabel(tr("图像平滑"), dock_Enhance);
QPushButton *button6 = new QPushButton(tr("高斯滤波"),dock_Enhance);
connect(button6, SIGNAL(clicked()), this, SLOT(gaosi()));
QPushButton *button7 = new QPushButton(tr("均值滤波"),dock_Enhance);
connect(button7, SIGNAL(clicked()), this, SLOT(junzhi()));
QPushButton *button8 = new QPushButton(tr("方框滤波"),dock_Enhance);
connect(button8, SIGNAL(clicked()), this, SLOT(fangkuang()));
QVBoxLayout *hlayout5 = new QVBoxLayout();
hlayout5->addWidget(label4);
hlayout5->addWidget(button6);
hlayout5->addWidget(button7);
hlayout5->addWidget(button8);
hlayout5->addSpacing(20);
QLabel *label5 = new QLabel(tr("图像锐化"), dock_Enhance);
QPushButton *button11 = new QPushButton(tr("图像锐化"),dock_Enhance);
connect(button11, SIGNAL(clicked()), this, SLOT(ruihua()));
QVBoxLayout *hlayout6 = new QVBoxLayout();
hlayout6->addWidget(label5);
hlayout6->addWidget(button11);
hlayout6->addSpacing(20);
QLabel *label6 = new QLabel(
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于qtc++的图像处理软件设计.rar (39个子文件)
windowt2
mainwindow.ui 18KB
windowt2.pro 2KB
mainwindow.cpp 38KB
2
liu.png 6KB
tuoyuan.png 5KB
4.png 5KB
xian.png 2KB
lingcun.png 4KB
零_白菊_雾化.png 326KB
图片1_刻蚀.png 989KB
2.jpg 3.71MB
零_白菊.jpg 36KB
6.jpg 3.21MB
baocun.png 4KB
guanbi.png 6KB
pen.png 6KB
1.jpg 518KB
7.png 5.86MB
dakai.png 3KB
sanjiao.png 5KB
lingxing.png 3KB
5.jpg 1.13MB
图像1_雾化.png 1.87MB
图片1_光晕.png 1.36MB
zhengfang.png 3KB
xinjian.png 3KB
changfang.png 4KB
tuichu.png 3KB
yuan.png 9KB
图片1.jpg 208KB
ps.png 2KB
3.jpg 4.12MB
main.cpp 183B
课程设计.doc 3.05MB
mainwindow.h 2KB
windowt2.pro.user 24KB
paintwidget.h 1KB
paintwidget.cpp 5KB
res.qrc 618B
共 39 条
- 1
Neuroses
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页