diff --git a/DIP-src/DIP.pro b/DIP-src/DIP.pro index a093419..6db0983 100644 --- a/DIP-src/DIP.pro +++ b/DIP-src/DIP.pro @@ -5,14 +5,13 @@ TARGET = DIP CONFIG(release, debug|release): DESTDIR = ../bin -VERSION = 1.0.0 +VERSION = 1.0.1 QT += core gui charts greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 -#mac: CONFIG -= app_bundle # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings @@ -44,8 +43,3 @@ RESOURCES += \ win32: RC_ICONS = DIP.ico mac: ICON = DIP.icns - -#CONFIG(release, debug|release) { -# win32: QMAKE_POST_LINK += $$[QT_INSTALL_BINS]/windeployqt $$shell_path($$absolute_path($$DESTDIR)) $$escape_expand(\\n\\t) -# mac: QMAKE_POST_LINK += $$[QT_INSTALL_BINS]/macdeployqt $$shell_path($$absolute_path($$DESTDIR)) $$escape_expand(\\n\\t) -#} diff --git a/DIP-src/mainwindow.cpp b/DIP-src/mainwindow.cpp index 7c578ee..390de22 100644 --- a/DIP-src/mainwindow.cpp +++ b/DIP-src/mainwindow.cpp @@ -169,12 +169,13 @@ MainWindow::MainWindow(QWidget *parent) ui->toolBar->addAction(QIcon(":/rc/icon/information.png"), tr("关于"),[this]{ QMessageBox::about(this,tr("关于本程序"), - tr("

数字图像处理 - 作业

")+ + tr("

数字图像处理大作业

")+ tr("

局部统计特征增强

")+ tr("

并与全局直方图均衡化对比,用钨丝灰度图。

")+ tr("
")+ tr("

本程序基于Qt构建

")+ - tr("

图标由Good WareFreepik制作

")); + tr("

程序源码托管于GitHub

")+ + tr("

图标由Good WareFreepik制作

")); }); } // “关于”按钮 @@ -228,7 +229,7 @@ MainWindow::MainWindow(QWidget *parent) ui->tabWidget->setCurrentWidget(tab); auto splitter = tab->findChild(); Q_CHECK_PTR(splitter); - int prefSize = std::min(image.width(),splitter->height()); // 更换图像的时候调整显示区域尺寸 + int prefSize = std::min(image.width(),image.width()*splitter->height()/image.height()); // 更换图像的时候调整显示区域尺寸 splitter->setSizes({prefSize,splitter->width()-prefSize}); imageView->fitInView(scene->itemsBoundingRect(),Qt::KeepAspectRatio); imageView->updateGeometry(); @@ -286,9 +287,9 @@ MainWindow::MainWindow(QWidget *parent) setupViews(origin,ui->originView,ui->originHistView,ui->originTab, tr("原图像的灰度直方图"),&MainWindow::imageLoaded); setupViews(globalEnh,ui->globalEnhView,ui->globalEnhHistView,ui->globalEnhTab, - tr("全局直方图均衡化图像的灰度直方图"),&MainWindow::globalEnhUpdated); + tr("直方图均衡化结果的灰度直方图"),&MainWindow::globalEnhUpdated); setupViews(localEnh,ui->localEnhView,ui->localEnhHistView,ui->localEnhTab, - tr("局部统计增强图像的灰度直方图"),&MainWindow::localEnhUpdated); + tr("局部统计增强结果的灰度直方图"),&MainWindow::localEnhUpdated); } MainWindow::~MainWindow() diff --git a/DIP-src/mainwindow.h b/DIP-src/mainwindow.h index e4b276b..147023e 100644 --- a/DIP-src/mainwindow.h +++ b/DIP-src/mainwindow.h @@ -2,7 +2,6 @@ #define MAINWINDOW_H #include -#include QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } diff --git a/DIP-src/mainwindow.ui b/DIP-src/mainwindow.ui index 034605f..46d1809 100644 --- a/DIP-src/mainwindow.ui +++ b/DIP-src/mainwindow.ui @@ -14,9 +14,12 @@ true - 数字图像处理 - 作业 + 数字图像处理大作业 + + true + @@ -25,7 +28,7 @@ - 原图 + 原图像 @@ -85,7 +88,7 @@ - 局部直方图统计增强 + 基于局部统计特征的增强 diff --git a/report/report.tex b/report/report.tex index c6e54f5..e559e12 100644 --- a/report/report.tex +++ b/report/report.tex @@ -44,8 +44,7 @@ \section{题目} -局部统计特征增强 - +局部统计特征增强\\ 并与全局直方图均衡化对比,用钨丝灰度图。 \section{数学原理} @@ -115,7 +114,7 @@ \subsection{基于局部统计特征的增强} 则对于$x=0,1,\cdots,M-1,\,y=0,1,\cdots,N-1$,有 \begin{equation}\label{eq:local-enh} g(x,y)=\begin{cases} - E\cdot f(x,y) & m_{S_{x,y}}\le m_G\,\text{且}\,k_1\sigma_G\le\sigma_{S_{x,y}}\le k_2\sigma_G\\ + E\cdot f(x,y) & m_{S_{x,y}}\le m_G \land k_1\sigma_G\le\sigma_{S_{x,y}}\le k_2\sigma_G\\ f(x,y) & \text{其它} \end{cases} \end{equation} @@ -254,7 +253,7 @@ \section{结果分析与讨论} \begin{figure}[!htb] \centering - \includegraphics[width=0.8\linewidth]{tungsten-hist.png} + \includegraphics[width=0.9\linewidth]{tungsten-hist.png} \caption{原图像的灰度直方图} \label{fig:tungsten-origin-hist} \end{figure} @@ -267,14 +266,14 @@ \section{结果分析与讨论} \begin{figure}[!htb] \centering - \includegraphics[width=0.8\linewidth]{tungsten-global-hist.png} + \includegraphics[width=0.9\linewidth]{tungsten-global-hist.png} \caption{直方图均衡化结果的灰度直方图} \label{fig:tungsten-global-hist} \end{figure} \begin{figure}[!htb] \centering - \includegraphics[width=0.8\linewidth]{tungsten-local-hist.png} + \includegraphics[width=0.9\linewidth]{tungsten-local-hist.png} \caption{局部统计增强结果的灰度直方图} \label{fig:tungsten-local-hist} \end{figure} @@ -296,12 +295,13 @@ \section{结果分析与讨论} \section{算法源码} -程序使用 C++ 基于 Qt 框架开发,完整的源码见 GitHub 仓库:\\ +程序使用 C++ 语言基于 Qt 框架开发,完整的源码见 GitHub 仓库:\\ \url{https://github.com/miRoox/HIT-DigitalImageProcessing-Postgraduate} -代码仓库中也包含报告的 \LaTeX{} 源码和一个 \textsc{Matlab} 版代码。 +代码仓库中也包含报告的 \LaTeX{} 源码和一个 \textsc{Matlab} 版代码, +编译得到的可执行的程序可以在仓库的“releases”页面找到。 -下面只附上算法 C++ 实现的核心源码: +\noindent 下面只附上算法 C++ 实现的核心源码: \noindent 头文件\textbf{algorithms.h}: diff --git a/report/tungsten-global-hist.png b/report/tungsten-global-hist.png index b4a206c..9685abb 100644 Binary files a/report/tungsten-global-hist.png and b/report/tungsten-global-hist.png differ diff --git a/report/tungsten-local-hist.png b/report/tungsten-local-hist.png index 148dffb..ffb0976 100644 Binary files a/report/tungsten-local-hist.png and b/report/tungsten-local-hist.png differ