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 
98 
100 
101  ~InputParameters();
102 
103  //overload
104  void reset() throw( te::rp::Exception );
105 
106  //overload
107  const InputParameters& operator=( const InputParameters& params );
108 
109  //overload
110  AbstractParameters* clone() const;
111  };
112 
113  /*!
114  \class OutputParameters
115  \brief WisperFusion output parameters
116  */
118  {
119  public:
120 
121  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
122 
123  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
124 
125  std::auto_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output fused raster.
126 
128 
130 
131  ~OutputParameters();
132 
133  //overload
134  void reset() throw( te::rp::Exception );
135 
136  //overload
137  const OutputParameters& operator=( const OutputParameters& params );
138 
139  //overload
140  AbstractParameters* clone() const;
141  };
142 
143  WisperFusion();
144 
145  ~WisperFusion();
146 
147  //overload
148  bool execute( AlgorithmOutputParameters& outputParams ) throw( te::rp::Exception );
149 
150  //overload
151  void reset() throw( te::rp::Exception );
152 
153  //overload
154  bool initialize( const AlgorithmInputParameters& inputParams ) throw( te::rp::Exception );
155 
156  //overload
157  bool isInitialized() const;
158 
159  protected:
160 
161  InputParameters m_inputParameters; //!< Input execution parameters.
162 
163  bool m_isInitialized; //!< Tells if this instance is initialized.
164  };
165 
166  } // end namespace rp
167 } // end namespace te
168 
169 #endif
170 
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
The generated output fused raster.
Definition: WisperFusion.h:125
Raster Processing functions.
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: WisperFusion.h:87
te::rst::Raster const * m_lowResRasterPtr
Input low-resolution multi-band raster.
Definition: WisperFusion.h:69
Fusion of a low-resolution multi-band image with a high resolution image using the WiSpeR method...
Definition: WisperFusion.h:57
Base exception class for plugin module.
Definition: Exception.h:42
Raster Processing algorithm output parameters base interface.
Spectral Response Functions.
unsigned int m_hiResRasterWaveletLevels
The number of wavelet decomposition levels to use (0-automatically found, default:0).
Definition: WisperFusion.h:85
Raster Processing algorithm base interface class.
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
WisperFusion output parameters.
Definition: WisperFusion.h:117
SensorType
Satellite sensors.
Raster Processing algorithm base interface.
Definition: Algorithm.h:41
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
Definition: WisperFusion.h:79
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: WisperFusion.h:89
WisperFusion input parameters.
Definition: WisperFusion.h:65
An abstract class for raster data strucutures.
Definition: Raster.h:71
WaveletAtrousFilterType
Wavelet Atrous Filter types.
Definition: Functions.h:73
URI C++ Library.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
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
std::vector< unsigned int > m_lowResRasterBands
Bands to processe from the low resolution raster.
Definition: WisperFusion.h:71
bool m_enableMultiThread
Enable/Disable the use of multi-threads (default:true).
Definition: WisperFusion.h:95
te::rst::Raster const * m_highResRasterPtr
Input high-resolution raster.
Definition: WisperFusion.h:77
Generic template matrix.
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:123
te::rp::srf::SensorType m_hiResRasterBandSensor
The high resolution band sensor.
Definition: WisperFusion.h:81
boost::numeric::ublas::matrix< double > const * m_userWaveletFilterPtr
An optional pointer to an user filter.
Definition: WisperFusion.h:93
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
Raster Processing algorithm input parameters base interface.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: WisperFusion.h:121
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