Add interface for multiple quality metrics into the side bar

This commit is contained in:
jfmcarreira committed 2014-10-03 01:05:55 +01:00
1 parent cde9a8c339
commit 074091340c
4 files changed
+32 -4

No files matched your search

+24 -4
View File
@@ -38,20 +38,30 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, QMdiArea
// Side bar area -----------------------------------------------------
QLabel *MetricLabel = new QLabel( tr( "Metric:" ) );
MetricLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
QLabel *RefLabel = new QLabel( tr( "Ref:" ) );
RefLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
QLabel *RecLabel = new QLabel( tr( "Rec:" ) );
RecLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
m_comboBoxMetric = new QComboBox;
m_comboBoxMetric->insertItems( 0, PlaYUVerFrame::supportedQualityMetricsList());
m_comboBoxMetric->setSizeAdjustPolicy( QComboBox::AdjustToContents );
m_comboBoxMetric->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
m_comboBoxRef = new QComboBox;
m_comboBoxRef->setSizeAdjustPolicy( QComboBox::AdjustToMinimumContentsLength );
m_comboBoxRef->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
updateSubWindowList();
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget( RefLabel, 0, 0, Qt::AlignLeft );
mainLayout->addWidget( m_comboBoxRef, 0, 1, Qt::AlignLeft );
mainLayout->addWidget( MetricLabel, 0, 0, Qt::AlignLeft );
mainLayout->addWidget( m_comboBoxMetric, 0, 1, Qt::AlignLeft );
mainLayout->addWidget( RefLabel, 1, 0, Qt::AlignLeft );
mainLayout->addWidget( m_comboBoxRef, 1, 1, Qt::AlignLeft );
m_ppcLabelQualityLabel[LUMA] = new QLabel( "PSNR Y:" );
m_ppcLabelQualityLabel[LUMA]->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
@@ -76,7 +86,8 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, QMdiArea
qualityResultsLayout->addWidget( m_ppcLabelQualityLabel[CHROMA_V], 2, 0 );
qualityResultsLayout->addWidget( m_ppcLabelQualityValue[CHROMA_V], 2, 1 );
QGroupBox *statisticsGroup = new QGroupBox( tr( "Quality" ) );
//QGroupBox *statisticsGroup = new QGroupBox( tr( "Quality" ) );
QGroupBox *statisticsGroup = new QGroupBox;
statisticsGroup->setLayout( qualityResultsLayout );
statisticsGroup->setWhatsThis( tr( "<p>Here you can see the quality results calculated for the "
"selected windows." ) );
@@ -87,6 +98,7 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, QMdiArea
setLayout( mainLayout );
connect( m_comboBoxRef, SIGNAL( activated(int) ), this, SLOT( slotReferenceChanged(int) ) );
connect( m_comboBoxMetric, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotQualityMetricChanged() ) );
}
@@ -159,7 +171,7 @@ Void QualityMeasurementSidebar::updateSidebarData()
for( Int component = 0; component < 3; component++ )
{
quality = currFrame->getPSNR( refFrame, component );
quality = currFrame->getQuality( m_comboBoxMetric->currentIndex(), refFrame, component );
m_ppcLabelQualityValue[component]->setText( value.setNum( quality, 'f', 2 ) );
}
return;
@@ -198,5 +210,13 @@ Void QualityMeasurementSidebar::slotReferenceChanged( Int index )
}
}
Void QualityMeasurementSidebar::slotQualityMetricChanged()
{
QString labelQuality = PlaYUVerFrame::supportedQualityMetricsList().at( m_comboBoxMetric->currentIndex() );
m_ppcLabelQualityLabel[LUMA]->setText( labelQuality + " Y");
m_ppcLabelQualityLabel[CHROMA_U]->setText( labelQuality + " U");
m_ppcLabelQualityLabel[CHROMA_V]->setText( labelQuality + " V");
updateSidebarData();
}
} // NAMESPACE
+3
View File
@@ -63,6 +63,8 @@ private:
SubWindowHandle *m_pcCurrentSubWindow;
QComboBox *m_comboBoxMetric;
QComboBox *m_comboBoxRef;
QComboBox *m_comboBoxRec;
@@ -73,6 +75,7 @@ private:
private Q_SLOTS:
void slotReferenceChanged( int );
void slotQualityMetricChanged();
};
+3
View File
@@ -746,6 +746,9 @@ Double PlaYUVerFrame::getQuality( Int Metric, PlaYUVerFrame* Org, Int component
case PSNR_METRIC:
return getPSNR( Org, component );
break;
case MSE_METRIC:
return getMSE( Org, component );
break;
case SSIM_METRIC:
return getSSIM( Org, component );
break;
+2
View File
@@ -150,6 +150,7 @@ public:
{
NO_METRIC = -1,
PSNR_METRIC = 0,
MSE_METRIC,
SSIM_METRIC,
NUMBER_METRICS,
};
@@ -158,6 +159,7 @@ public:
{
QStringList metrics;
metrics << "PSNR"
<< "MSE"
<< "SSIM" // SSIM
;
assert( metrics.size() == NUMBER_METRICS );