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: GONZ␓ALEZ-AUD␓ICANA, 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() ;
107 
108  //overload
109  const InputParameters& operator=( const InputParameters& params );
110 
111  //overload
112  AbstractParameters* clone() const;
113 
114  //overload
115  bool serialize ( AlgorithmParametersSerializer& serializer ) const;
116  };
117 
118  /*!
119  \class OutputParameters
120  \brief WisperFusion output parameters
121  */
123  {
124  public:
125 
126  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
127 
128  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
129 
130  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output fused raster.
131 
133 
135 
137 
138  //overload
139  void reset() ;
140 
141  //overload
142  const OutputParameters& operator=( const OutputParameters& params );
143 
144  //overload
145  AbstractParameters* clone() const;
146  };
147 
149 
151 
152  //overload
153  bool execute( AlgorithmOutputParameters& outputParams ) ;
154 
155  //overload
156  void reset() ;
157 
158  //overload
159  bool initialize( const AlgorithmInputParameters& inputParams ) ;
160 
161  //overload
162  bool isInitialized() const;
163 
164  protected:
165 
166  InputParameters m_inputParameters; //!< Input execution parameters.
167 
168  bool m_isInitialized; //!< Tells if this instance is initialized.
169  };
170 
171  } // end namespace rp
172 } // end namespace te
173 
174 #endif
175 
Raster Processing functions.
Generic template matrix.
Spectral Response Functions.
Raster Processing algorithm input parameters base interface.
Raster Processing algorithm output parameters base interface.
A class to standardize algorithm parameters serialization.
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
WisperFusion input parameters.
Definition: WisperFusion.h:66
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
boost::numeric::ublas::matrix< double > const * m_userWaveletFilterPtr
An optional pointer to an user filter.
Definition: WisperFusion.h:93
te::rst::Raster const * m_highResRasterPtr
Input high-resolution raster.
Definition: WisperFusion.h:77
InputParameters(const InputParameters &)
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
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
Definition: WisperFusion.h:79
unsigned int m_hiResRasterWaveletLevels
The number of wavelet decomposition levels to use (0-automatically found, default:0).
Definition: WisperFusion.h:85
AbstractParameters * clone() const
Create a clone copy of this instance.
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: WisperFusion.h:87
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: WisperFusion.h:89
bool serialize(AlgorithmParametersSerializer &serializer) const
Returns a parameter serialization object.
te::rp::srf::SensorType m_hiResRasterBandSensor
The high resolution band sensor.
Definition: WisperFusion.h:81
bool m_enableMultiThread
Enable/Disable the use of multi-threads (default:true).
Definition: WisperFusion.h:95
const InputParameters & operator=(const InputParameters &params)
std::vector< te::rp::srf::SensorType > m_lowResRasterBandSensors
The low resolution bands sensors.
Definition: WisperFusion.h:73
te::rp::WaveletAtrousFilterType m_waveletFilterType
The wavelet filter type to use (default: TriangleWAFilter);.
Definition: WisperFusion.h:91
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
bool m_autoAlignRasters
If true, the HR image will be clipped and reprojected to mach the LR image area.
Definition: WisperFusion.h:97
std::vector< unsigned int > m_lowResRasterBands
Bands to processe from the low resolution raster.
Definition: WisperFusion.h:71
te::rst::Raster const * m_lowResRasterPtr
Input low-resolution multi-band raster.
Definition: WisperFusion.h:69
WisperFusion output parameters.
Definition: WisperFusion.h:123
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:128
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
OutputParameters(const OutputParameters &)
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: WisperFusion.h:126
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output fused raster.
Definition: WisperFusion.h:130
const OutputParameters & operator=(const OutputParameters &params)
AbstractParameters * clone() const
Create a clone copy of this instance.
Fusion of a low-resolution multi-band image with a high resolution image using the WiSpeR method.
Definition: WisperFusion.h:58
InputParameters m_inputParameters
Input execution parameters.
Definition: WisperFusion.h:166
bool m_isInitialized
Tells if this instance is initialized.
Definition: WisperFusion.h:168
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
void reset()
Clear all internal allocated objects and reset the algorithm to its initial state.
bool isInitialized() const
Returns true if the algorithm instance is initialized and ready for execution.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
An abstract class for raster data strucutures.
Definition: Raster.h:72
WaveletAtrousFilterType
Wavelet Atrous Filter types.
Definition: Functions.h:75
SensorType
Satellite sensors
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Abstract algorithm.