TerraLib 4.1

Blended pixel value calculation for two overlaped rasters. More...

#include <TePDIBlender.hpp>

List of all members.

Public Types

enum  BlendMethod { NoBlendMethod = 1, MeanBlendMethod = 2, EuclideanBlendMethod = 3 }
typedef TeSharedPtr< TePDIBlenderpointer

Public Member Functions

 TePDIBlender ()
 ~TePDIBlender ()
bool init (const TePDITypes::TePDIRasterPtrType &raster1Ptr, const std::vector< unsigned int > raster1ChannelsVec, const TePDITypes::TePDIRasterPtrType &raster2Ptr, const std::vector< unsigned int > raster2ChannelsVec, BlendMethod blendMethod, TePDIInterpolator::InterpMethod interpMethod, const TeGTParams &transParams, const double &dummyValue, const std::vector< double > &pixelOffsets1, const std::vector< double > &pixelScales1, const std::vector< double > &pixelOffsets2, const std::vector< double > &pixelScales2, const TePolygon &raster1Pol=TePolygon(), const TePolygon &raster2Pol=TePolygon())
 Initiate this instance.
void blend (const double &line, const double &col, const unsigned int &rasterChannelsVecsIdx, double &value)
 Blend a pixel value using the current parameters.

Protected Types

typedef void(TePDIBlender::* BlendFunctPtr )(const double &line, const double &col, const unsigned int &band, double &value)
 Type definition for the a bleding function pointer.

Protected Member Functions

void reset ()
 Reset this instance cleaning all allocated resources.
void noBlendMethodImp (const double &line, const double &col, const unsigned int &rasterChannelsVecsIdx, double &value)
void eucBlendMethodImp (const double &line, const double &col, const unsigned int &rasterChannelsVecsIdx, double &value)
void meanBlendMethodImp (const double &line, const double &col, const unsigned int &rasterChannelsVecsIdx, double &value)

Protected Attributes

double dummyValue_
 Current dummy value (default:0).
BlendFunctPtr blendFunctPtr_
 The current blending method pointer (default:noBlendMethod).
BlendMethod blendMethod_
 Current blending method (default:NoBlendMethod).
short relation_
 The relation between the two rasters boinding box - raster 1 indexed reference (default:0)
TeGeometricTransformation::pointer transPrt_
 Current geometrical transformation pointer.
TePDITypes::TePDIRasterPtrType raster1Ptr_
 Input raster 1 pointer.
std::vector< unsigned int > raster1ChannelsVec_
 Input raster 1 used channels vector.
TePDITypes::TePDIRasterPtrType raster2Ptr_
 Input raster 2 pointer.
std::vector< unsigned int > raster2ChannelsVec_
 Input raster 2 used channels vector.
TePDIInterpolator interp1Instance_
 Input raster 1 internal interpolator instance.
TePDIInterpolator interp2Instance_
 Input raster 2 internal interpolator instance.
TeCoord2D noBlendMethodImp_coord1_
TeCoord2D noBlendMethodImp_coord2_
TeCoord2D eucBlendMethodImp_coord1_
TeCoord2D eucBlendMethodImp_coord2_
double eucBlendMethodImp_value1_
double eucBlendMethodImp_value2_
double eucBlendMethodImp_weight1_
double eucBlendMethodImp_weight2_
double eucBlendMethodImp_minDistToR1_
double eucBlendMethodImp_minDistToR2_
TeCoord2D eucBlendMethodImp_curCoord_
TeCoord2D eucBlendMethodImp_dummyCoord_
double eucBlendMethodImp_currDist_
unsigned int eucBlendMethodImp_iLSIdx_
TeCoord2D meanBlendMethodImp_coord1_
TeCoord2D meanBlendMethodImp_coord2_
double meanBlendMethodImp_value1_
double meanBlendMethodImp_value2_
TePolygon interPolR1IdxRef_
 Intersection polygon between the two images (indexed - raster 1 indexed reference )
TeLineSet interLineSetInR1_
 Intersection polygon line sets that are inside the raster 1 bounding box (raster 1 indexed reference)
TeLineSet interLineSetInR2_
 Intersection polygon line sets that are inside the raster 2 bounding box (raster 1 indexed reference)
std::vector< double > pixelOffsets1_
 The values offsets to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
std::vector< double > pixelScales1_
 pixelScale1 The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
std::vector< double > pixelOffsets2_
 pixelOff2 The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
std::vector< double > pixelScales2_

Detailed Description

Blended pixel value calculation for two overlaped rasters.

The overlap between the two images is modeled by the given geometric transformation direct mapping input raster 1 indexed coords (line, column) to input raster 2 indexed coords.

Author:
Emiliano F. Castejon <castejon@dpi.inpe.br>
Examples:

TePDIBlender_test.cpp.


Member Typedef Documentation

typedef void(TePDIBlender::* TePDIBlender::BlendFunctPtr)(const double &line, const double &col, const unsigned int &band, double &value) [protected]

Type definition for the a bleding function pointer.

Parameters:
lineLine.
colColumn.
bandBand.
valueInterpolated value.

Type definition for a instance pointer


Member Enumeration Documentation

Enumerator:
NoBlendMethod 

No blending performed.

MeanBlendMethod 

Mean of overlapped pixels method.

EuclideanBlendMethod 

Euclidean distance based blending method.


Constructor & Destructor Documentation

TePDIBlender::TePDIBlender ( )
TePDIBlender::~TePDIBlender ( )

Member Function Documentation

void TePDIBlender::blend ( const double &  line,
const double &  col,
const unsigned int &  rasterChannelsVecsIdx,
double &  value 
) [inline]

Blend a pixel value using the current parameters.

Parameters:
lineLine (raster 1 reference).
colColumn (raster 1 reference).
rasterChannelsVecsIdxVector index (the index to search the correct band/channel for each input raster from raster1ChannelsVec and raster2ChannelsVec).
valueBlended value.
Note:
The caller of this method must be aware that the returned blended value may be outside the original input rasters valid values range.
Examples:
TePDIBlender_test.cpp.
void TePDIBlender::eucBlendMethodImp ( const double &  line,
const double &  col,
const unsigned int &  rasterChannelsVecsIdx,
double &  value 
) [protected]
bool TePDIBlender::init ( const TePDITypes::TePDIRasterPtrType raster1Ptr,
const std::vector< unsigned int >  raster1ChannelsVec,
const TePDITypes::TePDIRasterPtrType raster2Ptr,
const std::vector< unsigned int >  raster2ChannelsVec,
BlendMethod  blendMethod,
TePDIInterpolator::InterpMethod  interpMethod,
const TeGTParams transParams,
const double &  dummyValue,
const std::vector< double > &  pixelOffsets1,
const std::vector< double > &  pixelScales1,
const std::vector< double > &  pixelOffsets2,
const std::vector< double > &  pixelScales2,
const TePolygon raster1Pol = TePolygon(),
const TePolygon raster2Pol = TePolygon() 
)

Initiate this instance.

Parameters:
raster1PtrInput raster 1 pointer.
raster1ChannelsVecInput raster 1 bands/channels.
raster2PtrInput raster 2 pointer.
raster2ChannelsVecInput raster 2 bands/channels.
blendMethodBlending method.
interpMethodInterpolation method.
transParamsTransformation parameters.
dummyValueThe value to be returned for cases where there is no raster data to blend.
pixelOffsets1The values offset to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
pixelScales1The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).
pixelOffsets2The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
pixelScales2The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
raster1PolA polygon (raster 1 indexed coords - line, col) delimiting the raster region with valid data (if an empty polygon is given the entire raster will be considered).
raster2PolA polygon (raster 2 indexed coords - line, col) delimiting the raster region with valid data (if an empty polygon is given the entire raster will be considered).
Returns:
true if OK, false on errors.
Note:
Transformation tie-points: TeCoordPair::pt1 are raster 1 indexed (line, column) coordinates and TeCoordPair::pt2 are raster 2 indexed (line, column) coordinates.
raster1ChannelsVec, raster2ChannelsVec, pixelOffsets1, pixelScales1, pixelOffsets2 and pixelScales2 must have the same number of elements.
Examples:
TePDIBlender_test.cpp.
void TePDIBlender::meanBlendMethodImp ( const double &  line,
const double &  col,
const unsigned int &  rasterChannelsVecsIdx,
double &  value 
) [protected]
void TePDIBlender::noBlendMethodImp ( const double &  line,
const double &  col,
const unsigned int &  rasterChannelsVecsIdx,
double &  value 
) [protected]
void TePDIBlender::reset ( ) [protected]

Reset this instance cleaning all allocated resources.


Member Data Documentation

The current blending method pointer (default:noBlendMethod).

Current blending method (default:NoBlendMethod).

double TePDIBlender::dummyValue_ [protected]

Current dummy value (default:0).

unsigned int TePDIBlender::eucBlendMethodImp_iLSIdx_ [protected]

Intersection polygon line sets that are inside the raster 1 bounding box (raster 1 indexed reference)

Intersection polygon line sets that are inside the raster 2 bounding box (raster 1 indexed reference)

Input raster 1 internal interpolator instance.

Input raster 2 internal interpolator instance.

Intersection polygon between the two images (indexed - raster 1 indexed reference )

std::vector< double > TePDIBlender::pixelOffsets1_ [protected]

The values offsets to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).

std::vector< double > TePDIBlender::pixelOffsets2_ [protected]

pixelOff2 The values offset to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).

std::vector< double > TePDIBlender::pixelScales1_ [protected]

pixelScale1 The values scale to be applied to raster 1 pixel values before the blended value calcule (one element for each used raster channel/band).

std::vector< double > TePDIBlender::pixelScales2_ [protected]
Parameters:
pixelScale2The values scale to be applied to raster 2 pixel values before the blended value calcule (one element for each used raster channel/band).
std::vector< unsigned int > TePDIBlender::raster1ChannelsVec_ [protected]

Input raster 1 used channels vector.

Input raster 1 pointer.

std::vector< unsigned int > TePDIBlender::raster2ChannelsVec_ [protected]

Input raster 2 used channels vector.

Input raster 2 pointer.

short TePDIBlender::relation_ [protected]

The relation between the two rasters boinding box - raster 1 indexed reference (default:0)

Current geometrical transformation pointer.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines