Skip to content

Commit

Permalink
Histogram matching for AVHRR( MetopA/B, NOAA19, GAC, HRP )
Browse files Browse the repository at this point in the history
  • Loading branch information
hvanruys committed Dec 30, 2017
1 parent 9b92192 commit 983421f
Show file tree
Hide file tree
Showing 14 changed files with 1,094 additions and 1,138 deletions.
27 changes: 8 additions & 19 deletions core/formimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ void FormImage::displayImage(eImageType channel)

void FormImage::slotMakeImage()
{
this->ComposeImage();
this->MakeImage();
}

void FormImage::ComposeImage()
void FormImage::MakeImage()
{

if(opts.buttonMetop || opts.buttonNoaa || opts.buttonHRP || opts.buttonGAC)
Expand Down Expand Up @@ -3389,12 +3389,12 @@ void FormImage::OverlayOLCI(QPainter *paint)
QPolygon copycoastline = segm->coastline.translated(0, heightinsegment);
paint->drawPoints(copycoastline);

if(opts.gridonolciimage)
{
paint->setPen(QColor(opts.projectionoverlaylonlatcolor));
QPolygon copylatlonline = segm->latlonline.translated(0, heightinsegment);
paint->drawPoints(copylatlonline);
}
// if(opts.gridonolciimage)
// {
// paint->setPen(QColor(opts.projectionoverlaylonlatcolor));
// QPolygon copylatlonline = segm->latlonline.translated(0, heightinsegment);
// paint->drawPoints(copylatlonline);
// }

heightinsegment += segm->GetNbrOfLines();
++segsel;
Expand Down Expand Up @@ -3560,17 +3560,6 @@ void FormImage::slotRepaintProjectionImage()
this->displayImage(this->channelshown);
}

void FormImage::setHistogramMethod(int histogrammethod, bool normalized)
{
segs->seglolciefr->setHistogramMethod(histogrammethod, normalized);
segs->seglolcierr->setHistogramMethod(histogrammethod, normalized);
}

void FormImage::setHistogramMethodSLSTR(int histogrammethod)
{
segs->seglslstr->setHistogramMethod(histogrammethod);
}

bool FormImage::SaveAsPNG48bits(bool mapto65535)
{
QString filestr;
Expand Down
4 changes: 1 addition & 3 deletions core/formimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ class FormImage : public QWidget
public:
explicit FormImage(QWidget *parent = 0, SatelliteList *satlist=0, AVHRRSatellite *seglist=0);
QLabel *returnimageLabelptr();
void ComposeImage();
void MakeImage();
bool ShowVIIRSMImage();
bool ShowVIIRSDNBImage();
bool ShowOLCIefrImage(int histogrammethod, bool normalized);
bool ShowOLCIerrImage(int histogrammethod, bool normalized);
bool ShowSLSTRImage(int histogrammethod);
void setHistogramMethod(int histogrammethod, bool normalized);
void setHistogramMethodSLSTR(int histogrammethod);
QSize getPictureSize() const;
void recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool> inversevector);
void recalculateCLAHEAvhrr(QVector<QString> spectrumvector, QVector<bool> inversevector);
Expand Down
1 change: 0 additions & 1 deletion core/formmapcyl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class FormMapCyl : public QWidget
explicit FormMapCyl(QWidget *parent = 0, MapFieldCyl *p_mapcyl = 0, Globe *p_globe = 0, FormToolbox *p_formtoolbox = 0, SatelliteList *satlist=0, AVHRRSatellite *seglist=0 );

void setCylOrGlobe(int ind);
bool ComposeImage();

private:
Ui::FormMapCyl *ui;
Expand Down
35 changes: 31 additions & 4 deletions core/formtoolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,14 @@ FormToolbox::FormToolbox(QWidget *parent, FormImage *p_formimage, FormGeostation
ui->cmbHistogramSLSTR->setCurrentIndex(CMB_HISTO_NONE_95);
ui->cmbHistogramGeo->addItems(lsthistogram);
ui->cmbHistogramGeo->setCurrentIndex(CMB_HISTO_NONE_95);
ui->cmbHistogramAVHRR->addItems(lsthistogram);
ui->cmbHistogramAVHRR->setCurrentIndex(CMB_HISTO_NONE_95);

lsthistogram.clear();
lsthistogram << "None 95%" << "None 100%" << "Equalize" << "Equalize Projection";
ui->cmbHistogramProj->addItems(lsthistogram);
ui->cmbHistogramProj->setCurrentIndex(CMB_HISTO_NONE_95);

ui->rdbGridOnOLCIimage->setChecked(opts.gridonolciimage);
ui->rbNadir->setChecked(true);
setAllWhatsThis();

Expand Down Expand Up @@ -5116,12 +5117,16 @@ void FormToolbox::fitCurve()

void FormToolbox::on_rdbOLCINormalized_toggled(bool checked)
{
formimage->setHistogramMethod(ui->cmbHistogram->currentIndex(), checked);
segs->seglolciefr->setHistogramMethod(ui->cmbHistogram->currentIndex(), checked);
segs->seglolcierr->setHistogramMethod(ui->cmbHistogram->currentIndex(), checked);

}

void FormToolbox::on_cmbHistogram_activated(int index)
{
formimage->setHistogramMethod(ui->cmbHistogram->currentIndex(), ui->rdbOLCINormalized->isChecked());
segs->seglolciefr->setHistogramMethod(ui->cmbHistogram->currentIndex(), ui->rdbOLCINormalized->isChecked());
segs->seglolcierr->setHistogramMethod(ui->cmbHistogram->currentIndex(), ui->rdbOLCINormalized->isChecked());


if(opts.buttonOLCIefr)
{
Expand Down Expand Up @@ -5152,9 +5157,26 @@ void FormToolbox::on_cmbHistogram_activated(int index)

}


void FormToolbox::on_cmbHistogramAVHRR_activated(int index)
{
//metopcount + noaacount + hrpcount + gaccount + metopAhrptcount + metopBhrptcount + noaa19hrptcount + M01hrptcount + M02hrptcount
segs->seglmetop->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglgac->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglhrp->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglnoaa->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglmetopAhrpt->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglmetopBhrpt->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglnoaa19hrpt->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglM01hrpt->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());
segs->seglM02hrpt->setHistogramMethod(ui->cmbHistogramAVHRR->currentIndex());

formimage->MakeImage();
}

void FormToolbox::on_cmbHistogramSLSTR_activated(int index)
{
formimage->setHistogramMethodSLSTR(ui->cmbHistogramSLSTR->currentIndex());
segs->seglslstr->setHistogramMethod(ui->cmbHistogramSLSTR->currentIndex());

if(opts.buttonSLSTR)
{
Expand Down Expand Up @@ -5438,3 +5460,8 @@ void FormToolbox::on_comboGeo16_currentIndexChanged(int index)
poi.strlComboGeo16.replace(this->geoindex, QString("%1").arg(index));
}


void FormToolbox::on_cmbHistogramGeo_activated(int index)
{

}
2 changes: 2 additions & 0 deletions core/formtoolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ private slots:
void on_comboGeo15_currentIndexChanged(int index);
void on_comboGeo16_currentIndexChanged(int index);

void on_cmbHistogramAVHRR_activated(int index);
void on_cmbHistogramGeo_activated(int index);
};


Expand Down
Loading

0 comments on commit 983421f

Please sign in to comment.