TiePointsLocatorAdvancedDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/widgets/rp/TiePointsLocatorAdvancedDialog.cpp
22 
23  \brief A dialog used to execute tie points location advanced options.
24 */
25 
26 
28 #include "../Exception.h"
29 #include "../../../geometry/GTFactory.h"
30 #include "../../../rp/TiePointsLocatorMoravecStrategy.h"
31 #include "../../../rp/TiePointsLocatorSURFStrategy.h"
32 
33 #include <ui_TiePointsLocatorAdvancedForm.h>
34 
35 #include <QtCore/QString>
36 #include <QCheckBox>
37 #include <QComboBox>
38 
39 namespace te
40 {
41  namespace qt
42  {
43  namespace widgets
44  {
46  QWidget* parent, Qt::WindowFlags f )
47  : QDialog( parent, f )
48  {
49  m_uiPtr = new Ui::TiePointsLocatorAdvancedForm;
50  m_uiPtr->setupUi(this);
51 
52  // Signals & slots
53  connect(m_uiPtr->m_okPushButton, SIGNAL(clicked()), this, SLOT(on_okPushButton_clicked()));
54 
55  // fill form
56 
57 
58  }
59 
61  {
62  delete m_uiPtr;
63  }
64 
66  {
67  m_uiPtr->m_enableGeometryFilterCheckBox->setChecked(
69 
70  m_uiPtr->m_enableMultiThreadCheckBox->setChecked(
72 
74  {
75  m_uiPtr->m_interesPointsLocationStrategyComboBox->setCurrentIndex(
76  m_uiPtr->m_interesPointsLocationStrategyComboBox->findText( "SURF" ) );
77  }
78  else
79  {
80  m_uiPtr->m_interesPointsLocationStrategyComboBox->setCurrentIndex(
81  m_uiPtr->m_interesPointsLocationStrategyComboBox->findText( "Moravec" ) );
82  }
83 
88  while( gtItB != gtItE )
89  {
90  m_uiPtr->m_geomTransfNameComboBox->addItem( QString( gtItB->first.c_str() ) );
91  ++gtItB;
92  }
93  m_uiPtr->m_geomTransfNameComboBox->setCurrentIndex(
94  m_uiPtr->m_geomTransfNameComboBox->findText(
96 
97  m_uiPtr->m_geometryFilterAssuranceLineEdit->setText( QString::number(
99 
100  m_uiPtr->m_geomTransfMaxErrorLineEdit->setText( QString::number(
102 
104  {
105  case te::rst::Bilinear :
106  {
107  m_uiPtr->m_interpMethodComboBox->setCurrentIndex(
108  m_uiPtr->m_interpMethodComboBox->findText( "Bilinear" ) );
109  break;
110  }
111  case te::rst::Bicubic :
112  {
113  m_uiPtr->m_interpMethodComboBox->setCurrentIndex(
114  m_uiPtr->m_interpMethodComboBox->findText( "Bicubic" ) );
115  break;
116  }
117  default:
118  {
119  m_uiPtr->m_interpMethodComboBox->setCurrentIndex(
120  m_uiPtr->m_interpMethodComboBox->findText( "NearestNeighbor" ) );
121  }
122  }
123 
124  m_uiPtr->m_maxTiePointsLineEdit->setText( QString::number(
126 
128  {
130  {
134 
135  m_uiPtr->m_correlationWindowWidthLineEdit->setText( QString::number(
136  specParsPtr->m_moravecCorrelationWindowWidth ) );
137 
138  m_uiPtr->m_gaussianFilterIterationsLineEdit->setText( QString::number(
139  specParsPtr->m_moravecNoiseFilterIterations ) );
140 
141  m_uiPtr->m_minAbsCorrelationLineEdit->setText( QString::number(
142  specParsPtr->m_moravecMinAbsCorrelation ) );
143 
144  m_uiPtr->m_moravecWindowWidthLineEdit->setText( QString::number(
145  specParsPtr->m_moravecWindowWidth ) );
146  }
148  {
152 
153  m_uiPtr->m_maxNormEuclideanDistLineEdit->setText( QString::number(
154  specParsPtr->m_surfMaxNormEuclideanDist ) );
155 
156  m_uiPtr->m_octavesNumberLineEdit->setText( QString::number(
157  specParsPtr->m_surfOctavesNumber ) );
158 
159  m_uiPtr->m_scalesNumberLineEdit->setText( QString::number(
160  specParsPtr->m_surfScalesNumber ) );
161  }
162  }
163  }
164 
166  {
168  m_uiPtr->m_enableGeometryFilterCheckBox->isChecked();
169 
171  m_uiPtr->m_enableMultiThreadCheckBox->isChecked();
172 
173  if( m_uiPtr->m_interesPointsLocationStrategyComboBox->currentText() ==
174  "SURF" )
175  {
177  }
178  else
179  {
181  }
182 
184  m_uiPtr->m_geomTransfNameComboBox->currentText().toUtf8().data();
185 
187  m_uiPtr->m_geometryFilterAssuranceLineEdit->text().toDouble();
188 
190  m_uiPtr->m_geomTransfMaxErrorLineEdit->text().toDouble();
191 
192  if( m_uiPtr->m_interpMethodComboBox->currentText() == "Bilinear" )
193  {
195  }
196  else if( m_uiPtr->m_interpMethodComboBox->currentText() == "Bicubic" )
197  {
199  }
200  else
201  {
203  }
204 
206  m_uiPtr->m_maxTiePointsLineEdit->text().toUInt();
207 
209  {
211 
213  m_uiPtr->m_correlationWindowWidthLineEdit->text().toUInt();
214 
216  m_uiPtr->m_gaussianFilterIterationsLineEdit->text().toUInt();
217 
218  specPars.m_moravecMinAbsCorrelation =
219  m_uiPtr->m_minAbsCorrelationLineEdit->text().toDouble();
220 
221  specPars.m_moravecWindowWidth =
222  m_uiPtr->m_moravecWindowWidthLineEdit->text().toUInt();
223 
225  }
227  {
229 
230  specPars.m_surfMaxNormEuclideanDist =
231  m_uiPtr->m_maxNormEuclideanDistLineEdit->text().toDouble();
232 
233  specPars.m_surfOctavesNumber =
234  m_uiPtr->m_octavesNumberLineEdit->text().toUInt();
235 
236  specPars.m_surfScalesNumber =
237  m_uiPtr->m_scalesNumberLineEdit->text().toUInt();
238 
240  }
241 
242  hide();
243  }
244  }
245  }
246 }
247 
Near neighborhood interpolation method.
unsigned int m_surfScalesNumber
The number of sub-sampling scales to generate, when applicable (default:3, minimum:3).
te::rp::TiePointsLocator::InputParameters m_inputParameters
The current parameters.
Ui::TiePointsLocatorAdvancedForm * m_uiPtr
User interface.
TiePointsLocatorStrategyParameters const * getSpecStrategyParams() const
Returns a pointer to the internal specific tie-points locator strategy parameters.
double m_geomTransfMaxError
The maximum allowed transformation error (pixel units, default:2).
static dictionary_type & getDictionary()
It returns a reference to the internal dictionary of concrete factories.
TiePointsLocator SURF strategy parameters.
unsigned int m_moravecWindowWidth
The Moravec window width used to locate canditate tie-points (minimum 3, default: 21...
std::string m_interesPointsLocationStrategyName
The strategy used to locate interest points (default:Moravec).
void setSpecStrategyParams(const TiePointsLocatorStrategyParameters &specStratParams)
Set specific tie-points locator strategy parameters.
unsigned int m_maxTiePoints
The maximum number of tie-points to generate (0:Automatically calculated, default:2500).
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator const_iterator
A dialog used to execute tie points location advanced options.
double m_geometryFilterAssurance
Geometry assurance (the error-free selection percent assurance) - Use Lower values for good tie-point...
bool m_enableGeometryFilter
Enable/disable the geometry filter/outliers remotion (default:true).
unsigned int m_surfOctavesNumber
The number of octaves to generate, when applicable (default: 2, minimum:2).
URI C++ Library.
Definition: Attributes.h:37
TiePointsLocator Moravec strategy parameters.
TiePointsLocatorAdvancedDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic dialog which is a child of parent, with widget flags set to f. ...
unsigned int m_moravecCorrelationWindowWidth
The correlation window width used to correlate points between the images (minimum 3...
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator end() const
It returns an iterator to the end of the container.
Bicubic interpolation method.
unsigned int m_moravecNoiseFilterIterations
The number of noise filter iterations, when applicable (used to remove image noise, zero will disable the noise Filter, default:1).
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator begin() const
It returns an iterator to the first stored factory.
bool m_enableMultiThread
Enable/Disable the use of multi-threads (default:true).
Bilinear interpolation method.
std::string m_geomTransfName
The name of the geometric transformation used to ensure tie-points consistency (see each te::gm::GTFa...
double m_surfMaxNormEuclideanDist
The maximum acceptable euclidean distance when matching features (when applicable), default:0.75, valid range: [0,1].
double m_moravecMinAbsCorrelation
The minimum acceptable absolute correlation value when matching features (when applicable), default:0.25, valid range: [0,1].
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).