Go to the documentation of this file.
25 #ifndef __TERRALIB_RP_INTERNAL_IHSFUSION_H
26 #define __TERRALIB_RP_INTERNAL_IHSFUSION_H
30 #include "../raster/Raster.h"
31 #include "../raster/Interpolator.h"
104 AbstractParameters* clone() const;
134 AbstractParameters* clone() const;
151 bool isInitialized() const;
157 bool m_isInitialized;
165 bool getRGBRange(
double& rgbMin,
double& rgbMax ) const;
174 template< typename DataTypeT >
175 bool getStatistics( const
te::rp::
Matrix< DataTypeT >& matrix,
176 DataTypeT& mean, DataTypeT& variance,
177 DataTypeT& minimum, DataTypeT& maximum )
const
179 const unsigned int nRows = matrix.getLinesNumber();
180 const unsigned int nCols = matrix.getColumnsNumber();
182 if( ( nRows == 0 ) || ( nCols == 0 ) )
return false;
184 unsigned int col = 0;
185 unsigned int row = 0;
186 DataTypeT
const * rowPtr =
nullptr;
188 minimum = std::numeric_limits< DataTypeT >::max();
189 maximum = ((DataTypeT)-1) * std::numeric_limits< DataTypeT >::max();
192 for( row = 0 ; row < nRows ; ++row )
194 rowPtr = matrix[ row ];
196 for( col = 0 ; col < nCols ; ++col )
198 mean += rowPtr[ col ];
199 minimum = std::min( minimum, rowPtr[ col ] );
200 maximum = std::max( maximum, rowPtr[ col ] );
204 mean /= ( nCols * nRows );
206 DataTypeT diff = 0.0;
209 for( row = 0 ; row < nRows ; ++row )
211 rowPtr = matrix[ row ];
213 for( col = 0 ; col < nCols ; ++col )
215 diff = rowPtr[ col ] - mean;
216 variance += ( diff * diff );
235 const double& rgbMin,
237 const unsigned int maxSimultaneousLinesPerMatrix,
261 const std::string& rType,
const std::map< std::string, std::string >& rInfo,
262 std::unique_ptr< te::rst::Raster >& outputRasterPtr )
const;
Fusion of a low-resolution multi-band image with a high resolution image using the IHS method.
A generic template matrix.
Raster Processing algorithm output parameters base interface.
bool swapIntensity(te::rp::Matrix< double > &intensityData)
Swap the intensity data by the high resolution image data.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
An abstract class for raster data strucutures.
bool loadIHSData(const double &rgbMin, const double rgbMax, const unsigned int maxSimultaneousLinesPerMatrix, te::rp::Matrix< double > &intensityData, te::rp::Matrix< float > &hueData, te::rp::Matrix< float > &saturationData) const
Load resampled IHS data from the input image.
Raster Processing algorithm base interface.
InterpolationMethod
Allowed interpolation methods.
Base exception class for plugin module.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output fused raster.
bool saveIHSData(const double &rgbMin, const double rgbMax, const te::rp::Matrix< double > &intensityData, const te::rp::Matrix< float > &hueData, const te::rp::Matrix< float > &saturationData, const std::string &rType, const std::map< std::string, std::string > &rInfo, std::unique_ptr< te::rst::Raster > &outputRasterPtr) const
Save resampled IHS data as RGB data to the output image.
OutputParameters(const OutputParameters &)
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
IHSFusion output parameters.