WisperFusion.h
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/rp/WisperFusion.h
22  \brief WiSpeR fusion.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_WISPERFUSION_H
26 #define __TERRALIB_RP_INTERNAL_WISPERFUSION_H
27 
28 #include "Algorithm.h"
29 #include "Matrix.h"
30 #include "../raster/Raster.h"
31 #include "../raster/Interpolator.h"
32 #include "Functions.h"
34 
35 #include <vector>
36 #include <map>
37 
38 namespace te
39 {
40  namespace rp
41  {
42  /*!
43  \class WisperFusion
44 
45  \brief Fusion of a low-resolution multi-band image with a high resolution image using the WiSpeR method.
46 
47  \note This algorithm expects both images to be aligned over the same geographic region. No reprojection or crop operations are performed.
48 
49  \note Reference: OTAZU, X.; GONZALEZ-AUDICANA, M.; FORS, O.; NUNEZ, J. Introduction of sensor spectral response into image fusion methods. application to wavelet-based methods. IEEE Transactions on Geoscience and Remote Sensing, v. 43, n. 10, p. 2376{2385, Oct. 2005. 21, 26, 36, 40.
50 
51  \note Reference: GONZALEZ-AUDICANA, M.; OTAZU, X.; FORS, O.; SECO, A. Comparison between Mallat's and the 'a trous' discrete wavelet transform based algorithms for the fusion of multispectral and panchromatic images. International Journal of Remote Sensing, Taylor & Francis, v. 26, n. 3, p. 595{614, 2005. 33.
52 
53  \note The spectral response functions must be in the form std::pair< double, double >( wavelength , response );
54 
55  \ingroup rp_fus
56  */
58  {
59  public:
60 
61  /*!
62  \class InputParameters
63  \brief WisperFusion input parameters
64  */
66  {
67  public:
68 
69  te::rst::Raster const* m_lowResRasterPtr; //!< Input low-resolution multi-band raster.
70 
71  std::vector< unsigned int > m_lowResRasterBands; //!< Bands to processe from the low resolution raster.
72 
73  std::vector< te::rp::srf::SensorType > m_lowResRasterBandSensors; //!< The low resolution bands sensors.
74 
75  std::vector< std::map< double, double > > m_lowResRasterBandsSRFs; //!< An optional vector of user supplied Spectral Response Functions for each low resolution band (The wavelength unit: Nanometers (nm) ).
76 
77  te::rst::Raster const* m_highResRasterPtr; //!< Input high-resolution raster.
78 
79  unsigned int m_highResRasterBand; //!< Band to process from the high-resolution raster.
80 
81  te::rp::srf::SensorType m_hiResRasterBandSensor; //!< The high resolution band sensor.
82 
83  std::map< double, double > m_hiResRasterBandsSRFs; //!< An optional vector of user supplied Spectral Response Functions for the high resolution band (The wavelength unit: Nanometers (nm) ).
84 
85  unsigned int m_hiResRasterWaveletLevels; //!< The number of wavelet decomposition levels to use (0-automatically found, default:0).
86 
87  bool m_enableProgress; //!< Enable/Disable the progress interface (default:false).
88 
89  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
90 
91  te::rp::WaveletAtrousFilterType m_waveletFilterType; //!< The wavelet filter type to use (default: TriangleWAFilter);
92 
93  boost::numeric::ublas::matrix< double > const* m_userWaveletFilterPtr; //!< An optional pointer to an user filter.
94 
95  bool m_enableMultiThread; //!< Enable/Disable the use of multi-threads (default:true).
96 
97  bool m_autoAlignRasters; //!< If true, the HR image will be clipped and reprojected to mach the LR image area.
98 
100 
102 
104 
105  //overload
106  void reset() throw( te::rp::Exception );
107 
108  //overload
109  const InputParameters& operator=( const InputParameters& params );
110 
111  //overload
112  AbstractParameters* clone() const;
113  };
114 
115  /*!
116  \class OutputParameters
117  \brief WisperFusion output parameters
118  */
120  {
121  public:
122 
123  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
124 
125  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
126 
127  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output fused raster.
128 
130 
132 
134 
135  //overload
136  void reset() throw( te::rp::Exception );
137 
138  //overload
139  const OutputParameters& operator=( const OutputParameters& params );
140 
141  //overload
142  AbstractParameters* clone() const;
143  };
144 
146 
148 
149  //overload
150  bool execute( AlgorithmOutputParameters& outputParams ) throw( te::rp::Exception );
151 
152  //overload
153  void reset() throw( te::rp::Exception );
154 
155  //overload
156  bool initialize( const AlgorithmInputParameters& inputParams ) throw( te::rp::Exception );
157 
158  //overload
159  bool isInitialized() const;
160 
161  protected:
162 
163  InputParameters m_inputParameters; //!< Input execution parameters.
164 
165  bool m_isInitialized; //!< Tells if this instance is initialized.
166  };
167 
168  } // end namespace rp
169 } // end namespace te
170 
171 #endif
172 
te::rp::WisperFusion::OutputParameters::m_rInfo
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
Definition: WisperFusion.h:125
te::rp::WisperFusion::OutputParameters::~OutputParameters
~OutputParameters()
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::AlgorithmOutputParameters
Raster Processing algorithm output parameters base interface.
Definition: AlgorithmOutputParameters.h:40
te::rp::WisperFusion::InputParameters::m_hiResRasterBandsSRFs
std::map< double, double > m_hiResRasterBandsSRFs
An optional vector of user supplied Spectral Response Functions for the high resolution band (The wav...
Definition: WisperFusion.h:83
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::rp::AlgorithmInputParameters
Raster Processing algorithm input parameters base interface.
Definition: AlgorithmInputParameters.h:40
te::rp::WisperFusion::InputParameters::m_lowResRasterBands
std::vector< unsigned int > m_lowResRasterBands
Bands to processe from the low resolution raster.
Definition: WisperFusion.h:71
te::rp::WisperFusion::InputParameters::m_enableMultiThread
bool m_enableMultiThread
Enable/Disable the use of multi-threads (default:true).
Definition: WisperFusion.h:95
te::rp::WisperFusion::InputParameters::m_waveletFilterType
te::rp::WaveletAtrousFilterType m_waveletFilterType
The wavelet filter type to use (default: TriangleWAFilter);.
Definition: WisperFusion.h:91
Matrix.h
Generic template matrix.
te::rp::WisperFusion::InputParameters::m_highResRasterPtr
te::rst::Raster const * m_highResRasterPtr
Input high-resolution raster.
Definition: WisperFusion.h:77
te::rp::WisperFusion::InputParameters::reset
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::WisperFusion::InputParameters::m_lowResRasterBandsSRFs
std::vector< std::map< double, double > > m_lowResRasterBandsSRFs
An optional vector of user supplied Spectral Response Functions for each low resolution band (The wav...
Definition: WisperFusion.h:75
te::rp::WisperFusion
Fusion of a low-resolution multi-band image with a high resolution image using the WiSpeR method.
Definition: WisperFusion.h:58
te::rp::WisperFusion::InputParameters::InputParameters
InputParameters(const InputParameters &)
te::rp::Algorithm
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
te::rp::WisperFusion::OutputParameters::m_rType
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: WisperFusion.h:123
te::rp::WisperFusion::InputParameters::m_hiResRasterWaveletLevels
unsigned int m_hiResRasterWaveletLevels
The number of wavelet decomposition levels to use (0-automatically found, default:0).
Definition: WisperFusion.h:85
te::rp::WisperFusion::InputParameters::m_lowResRasterPtr
te::rst::Raster const * m_lowResRasterPtr
Input low-resolution multi-band raster.
Definition: WisperFusion.h:69
te::rp::WisperFusion::InputParameters::m_interpMethod
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: WisperFusion.h:89
te::rp::WaveletAtrousFilterType
WaveletAtrousFilterType
Wavelet Atrous Filter types.
Definition: Functions.h:75
te::rst::InterpolationMethod
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
te::rp::WisperFusion::InputParameters::InputParameters
InputParameters()
te::rp::WisperFusion::OutputParameters::m_outputRasterPtr
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output fused raster.
Definition: WisperFusion.h:127
te::rp::WisperFusion::InputParameters
WisperFusion input parameters.
Definition: WisperFusion.h:66
te::Exception
Base exception class for plugin module.
Definition: Exception.h:42
te::rp::WisperFusion::InputParameters::m_highResRasterBand
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
Definition: WisperFusion.h:79
TERPEXPORT
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
te::rp::WisperFusion::OutputParameters::OutputParameters
OutputParameters(const OutputParameters &)
te::rp::WisperFusion::InputParameters::m_enableProgress
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: WisperFusion.h:87
te::rp::WisperFusion::InputParameters::m_lowResRasterBandSensors
std::vector< te::rp::srf::SensorType > m_lowResRasterBandSensors
The low resolution bands sensors.
Definition: WisperFusion.h:73
Algorithm.h
Abstract algorithm.
te::rp::WisperFusion::OutputParameters
WisperFusion output parameters.
Definition: WisperFusion.h:120
te::rp::WisperFusion::InputParameters::~InputParameters
~InputParameters()
te::rp::WisperFusion::InputParameters::m_hiResRasterBandSensor
te::rp::srf::SensorType m_hiResRasterBandSensor
The high resolution band sensor.
Definition: WisperFusion.h:81
te::rp::WisperFusion::OutputParameters::reset
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::WisperFusion::InputParameters::m_userWaveletFilterPtr
boost::numeric::ublas::matrix< double > const * m_userWaveletFilterPtr
An optional pointer to an user filter.
Definition: WisperFusion.h:93
Functions.h
Raster Processing functions.
te::rp::srf::SensorType
SensorType
Satellite sensors
Definition: SpectralResponseFunctions.h:48
te::rp::WisperFusion::OutputParameters::OutputParameters
OutputParameters()
te::rp::WisperFusion::InputParameters::m_autoAlignRasters
bool m_autoAlignRasters
If true, the HR image will be clipped and reprojected to mach the LR image area.
Definition: WisperFusion.h:97
SpectralResponseFunctions.h
Spectral Response Functions.