[TASK] Begin implementing unsharp masking.

This commit is contained in:
Jan Philipp Timme 2016-01-05 17:55:16 +01:00
parent 998fbe3d2e
commit e3fedb76ad
2 changed files with 18 additions and 0 deletions

View File

@ -715,6 +715,17 @@ void ImageViewer::runCannyEdgeThirdStep(void) {
canny_edge_machine->doThirdStep(); canny_edge_machine->doThirdStep();
updateImageDisplay(); updateImageDisplay();
} }
/**
* Apply results of canny edge using unsharp masking.
*
* @brief ImageViewer::doUnsharpMasking
*/
void ImageViewer::doUnsharpMasking(void) {
logFile << "Doing USM ..." << std::endl;
renewLogging();
updateImageDisplay();
}
/**************************************************************************************** /****************************************************************************************
* *
* GUI elements related to the tasks are set up here. * GUI elements related to the tasks are set up here.
@ -1005,6 +1016,9 @@ void ImageViewer::generateControlPanels() {
t_high_spinbox->setDecimals(5); t_high_spinbox->setDecimals(5);
t_high_spinbox->setValue(4.0); t_high_spinbox->setValue(4.0);
run_usm = new QPushButton("Apply unsharp masking!");
QObject::connect(run_usm, SIGNAL(clicked()), this, SLOT(doUnsharpMasking()));
task_tab5_scrolllayout->addWidget(new QLabel("Gauss filter size (NxN)")); task_tab5_scrolllayout->addWidget(new QLabel("Gauss filter size (NxN)"));
task_tab5_scrolllayout->addWidget(gauss_filter_size); task_tab5_scrolllayout->addWidget(gauss_filter_size);
task_tab5_scrolllayout->addWidget(new QLabel("Gauss filter sigma")); task_tab5_scrolllayout->addWidget(new QLabel("Gauss filter sigma"));
@ -1017,6 +1031,8 @@ void ImageViewer::generateControlPanels() {
task_tab5_scrolllayout->addWidget(t_high_spinbox); task_tab5_scrolllayout->addWidget(t_high_spinbox);
task_tab5_scrolllayout->addWidget(run_canny_edge_third_step); task_tab5_scrolllayout->addWidget(run_canny_edge_third_step);
task_tab5_scrolllayout->addWidget(run_canny_edge); task_tab5_scrolllayout->addWidget(run_canny_edge);
task_tab5_scrolllayout->addWidget(new QLabel("Unsharp masking"));
task_tab5_scrolllayout->addWidget(run_usm);
tabWidget->addTab(task_tab5_widget, "Task #5"); tabWidget->addTab(task_tab5_widget, "Task #5");

View File

@ -155,6 +155,7 @@ class ImageViewer : public QMainWindow {
QPushButton* run_canny_edge_first_step; QPushButton* run_canny_edge_first_step;
QPushButton* run_canny_edge_second_step; QPushButton* run_canny_edge_second_step;
QPushButton* run_canny_edge_third_step; QPushButton* run_canny_edge_third_step;
QPushButton* run_usm;
// "My" space for storing data/results // "My" space for storing data/results
LazyImage* original; LazyImage* original;
@ -184,6 +185,7 @@ class ImageViewer : public QMainWindow {
void runCannyEdgeFirstStep(void); void runCannyEdgeFirstStep(void);
void runCannyEdgeSecondStep(void); void runCannyEdgeSecondStep(void);
void runCannyEdgeThirdStep(void); void runCannyEdgeThirdStep(void);
void doUnsharpMasking(void);
void open(); void open();
void openReference(); void openReference();