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"
106 AbstractParameters* clone() const;
136 AbstractParameters* clone() const;
153 bool isInitialized() const;
159 bool m_isInitialized;
167 bool getRGBRange(
double& rgbMin,
double& rgbMax ) const;
176 template< typename DataTypeT >
177 bool getStatistics( const
te::rp::
Matrix< DataTypeT >& matrix,
178 DataTypeT& mean, DataTypeT& variance,
179 DataTypeT& minimum, DataTypeT& maximum )
const
181 const unsigned int nRows = matrix.getLinesNumber();
182 const unsigned int nCols = matrix.getColumnsNumber();
184 if( ( nRows == 0 ) || ( nCols == 0 ) )
return false;
186 unsigned int col = 0;
187 unsigned int row = 0;
188 DataTypeT
const * rowPtr =
nullptr;
190 minimum = std::numeric_limits< DataTypeT >::max();
191 maximum = ((DataTypeT)-1) * std::numeric_limits< DataTypeT >::max();
194 for( row = 0 ; row < nRows ; ++row )
196 rowPtr = matrix[ row ];
198 for( col = 0 ; col < nCols ; ++col )
200 mean += rowPtr[ col ];
201 minimum = std::min( minimum, rowPtr[ col ] );
202 maximum = std::max( maximum, rowPtr[ col ] );
206 mean /= ( nCols * nRows );
208 DataTypeT diff = 0.0;
211 for( row = 0 ; row < nRows ; ++row )
213 rowPtr = matrix[ row ];
215 for( col = 0 ; col < nCols ; ++col )
217 diff = rowPtr[ col ] - mean;
218 variance += ( diff * diff );
239 const double& rgbMin,
241 const unsigned int maxSimultaneousLinesPerMatrix,
265 const double& rgbMin,
const double rgbMax,
269 const std::string& rType,
const std::map< std::string, std::string >& rInfo,
270 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.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
An abstract class for raster data strucutures.
bool swapIntensity(const te::rst::Raster &highResRaster, te::rp::Matrix< double > &intensityData)
Swap the intensity data by the high resolution image data.
Raster Processing algorithm base interface.
InterpolationMethod
Allowed interpolation methods.
bool loadIHSData(const te::rst::Raster &highResRaster, 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.
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.
OutputParameters(const OutputParameters &)
bool saveIHSData(const te::rst::Raster &highResRaster, 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.
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.