[TASK] Add small histogramm for original image, too.

This commit is contained in:
Jan Philipp Timme 2015-11-13 15:11:43 +01:00
parent c1f921d59f
commit bacc1b3567
2 changed files with 11 additions and 2 deletions

View File

@ -196,6 +196,7 @@ void ImageViewer::analyzeImage() {
QString result = QString("Intensity: Average: %1, Variance: %2").arg(working_copy->getIntensityAverage()).arg(working_copy->getIntensityVariance());
stats->setText(result);
histogramm_label->setPixmap(QPixmap::fromImage(*(working_copy->getHistogrammImage())));
original_histogramm_label->setPixmap(QPixmap::fromImage(*(original->getHistogrammImage())));
}
}
@ -368,6 +369,11 @@ void ImageViewer::generateControlPanels() {
task_tab2 = new QVBoxLayout();
task_tab_widget2->setLayout(task_tab2);
original_histogramm_label = new QLabel();
original_histogramm_label->setBackgroundRole(QPalette::Base);
original_histogramm_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
original_histogramm_label->setScaledContents(false);
histogramm_label = new QLabel();
histogramm_label->setBackgroundRole(QPalette::Base);
histogramm_label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
@ -377,7 +383,7 @@ void ImageViewer::generateControlPanels() {
stats->setText("Intensity will be shown here.");
analyze_image = new QPushButton();
analyze_image->setText("Analyze image");
analyze_image->setText("Update image statistics, redraw histogramms.");
QObject::connect(analyze_image, SIGNAL(clicked()), this, SLOT(analyzeImage()));
brightness_slider = new QSlider(Qt::Horizontal);
@ -401,7 +407,9 @@ void ImageViewer::generateControlPanels() {
QObject::connect(automatic_robust_contrast, SIGNAL(clicked()), this, SLOT(robustAutomaticContrastAdaption()));
task_tab2->addWidget(stats);
task_tab2->addWidget(new QLabel("Histogramm"));
task_tab2->addWidget(new QLabel("Histogramm of original image"));
task_tab2->addWidget(original_histogramm_label);
task_tab2->addWidget(new QLabel("Histogramm of working copy"));
task_tab2->addWidget(histogramm_label);
task_tab2->addWidget(analyze_image);
task_tab2->addWidget(new QLabel("Brightness"));

View File

@ -88,6 +88,7 @@ class ImageViewer : public QMainWindow {
QVBoxLayout* task_tab2;
QLabel* stats;
QLabel* original_histogramm_label;
QLabel* histogramm_label;
QPushButton* analyze_image;