Loading...
Searching...
No Matches
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
38namespace 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
99 std::vector< double > m_outputNoDataValues; //!< A vector of output raster band no-data values or an empty vector to use low-resolution raster no-data values.
100
102
104
106
107 //overload
108 void reset() ;
109
110 //overload
112
113 //overload
114 AbstractParameters* clone() const;
115
116 //overload
117 bool serialize ( AlgorithmParametersSerializer& serializer ) const;
118 };
119
120 /*!
121 \class OutputParameters
122 \brief WisperFusion output parameters
123 */
125 {
126 public:
127
128 std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
129
130 std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
131
132 std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output fused raster.
133
135
137
139
140 //overload
141 void reset() ;
142
143 //overload
145
146 //overload
147 AbstractParameters* clone() const;
148 };
149
151
153
154 //overload
155 bool execute( AlgorithmOutputParameters& outputParams ) ;
156
157 //overload
158 void reset() ;
159
160 //overload
161 bool initialize( const AlgorithmInputParameters& inputParams ) ;
162
163 //overload
164 bool isInitialized() const;
165
166 protected:
167
168 InputParameters m_inputParameters; //!< Input execution parameters.
169
170 bool m_isInitialized; //!< Tells if this instance is initialized.
171 };
172
173 } // end namespace rp
174} // end namespace te
175
176#endif
177
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.
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.
te::rst::Raster const * m_highResRasterPtr
Input high-resolution raster.
InputParameters(const InputParameters &)
const InputParameters & operator=(const InputParameters &params)
std::map< double, double > m_hiResRasterBandsSRFs
An optional vector of user supplied Spectral Response Functions for the high resolution band (The wav...
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
unsigned int m_hiResRasterWaveletLevels
The number of wavelet decomposition levels to use (0-automatically found, default:0).
bool m_enableProgress
Enable/Disable the progress interface (default:false).
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
AbstractParameters * clone() const
Create a clone copy of this instance.
bool serialize(AlgorithmParametersSerializer &serializer) const
Returns a parameter serialization object.
te::rp::srf::SensorType m_hiResRasterBandSensor
The high resolution band sensor.
std::vector< double > m_outputNoDataValues
A vector of output raster band no-data values or an empty vector to use low-resolution raster no-data...
bool m_enableMultiThread
Enable/Disable the use of multi-threads (default:true).
std::vector< te::rp::srf::SensorType > m_lowResRasterBandSensors
The low resolution bands sensors.
te::rp::WaveletAtrousFilterType m_waveletFilterType
The wavelet filter type to use (default: TriangleWAFilter);.
std::vector< std::map< double, double > > m_lowResRasterBandsSRFs
An optional vector of user supplied Spectral Response Functions for each low resolution band (The wav...
bool m_autoAlignRasters
If true, the HR image will be clipped and reprojected to mach the LR image area.
std::vector< unsigned int > m_lowResRasterBands
Bands to processe from the low resolution raster.
te::rst::Raster const * m_lowResRasterPtr
Input low-resolution multi-band raster.
WisperFusion output parameters.
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
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 ).
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output fused raster.
AbstractParameters * clone() const
Create a clone copy of this instance.
const OutputParameters & operator=(const OutputParameters &params)
Fusion of a low-resolution multi-band image with a high resolution image using the WiSpeR method.
InputParameters m_inputParameters
Input execution parameters.
bool m_isInitialized
Tells if this instance is initialized.
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.