te::rp::TiePointsLocatorSURFStrategy Class Reference

Tie-points locator SURF strategy. More...

#include <TiePointsLocatorSURFStrategy.h>

Inheritance diagram for te::rp::TiePointsLocatorSURFStrategy:
te::rp::TiePointsLocatorStrategy

Classes

class  ExecuteMatchingByEuclideanDistThreadEntryParams
 The parameters passed to the executeMatchingByEuclideanDistThreadEntry method. More...
 
class  Parameters
 TiePointsLocator SURF strategy parameters. More...
 
class  SurfLocatorThreadParams
 The parameters passed to the surfLocatorThreadEntry method. More...
 

Public Member Functions

void getDefaultSpecStrategyParams (std::auto_ptr< TiePointsLocatorStrategyParameters > &defaultSpecParamsPtr) const
 Returns a sub-sampled version of the given locator strategy specific input parameters. More...
 
void getSubSampledSpecStrategyParams (const double subSampleOptimizationRescaleFactor, const TiePointsLocatorStrategyParameters &inputSpecParams, std::auto_ptr< TiePointsLocatorStrategyParameters > &subSampledSpecParamsPtr) const
 Returns a sub-sampled version of the given locator strategy specific input parameters. More...
 
 ~TiePointsLocatorSURFStrategy ()
 

Protected Types

typedef te::rp::Matrix< double > DoublesMatrix
 A matrix do store double values. More...
 
typedef te::rp::Matrix< float > FloatsMatrix
 A matrix do store float values. More...
 
typedef std::list< InterestPointTInterestPointsListT
 
typedef std::multiset< InterestPointTInterestPointsSetT
 
typedef std::multiset< MatchedInterestPointsTMatchedInterestPointsSetT
 
typedef te::rp::Matrix< unsigned char > UCharsMatrix
 A matrix do store unsigned char values. More...
 

Protected Member Functions

bool executeMatchingByEuclideanDist (const FloatsMatrix &featuresSet1, const FloatsMatrix &featuresSet2, const InterestPointsSetT &interestPointsSet1, const InterestPointsSetT &interestPointsSet2, te::gm::GeometricTransformation const *const raster1ToRaster2TransfPtr, const double raster1ToRaster2TransfDMapError, MatchedInterestPointsSetT &matchedPoints) const
 Match each feature using eucliean distance. More...
 
unsigned int getAutoMaxTiePointsNumber () const
 Returns a automatically calculated optimum maximum amount tie-points following the current parameters. More...
 
bool getMatchedInterestPoints (te::gm::GeometricTransformation const *const raster1ToRaster2TransfPtr, const double raster1ToRaster2TransfDMapError, MatchedInterestPointsSetT &matchedInterestPoints)
 Try to find matched interest points. More...
 
bool initialize (const te::rp::TiePointsLocatorInputParameters &inputParameters)
 Initialize the strategy. More...
 
bool locateSurfInterestPoints (const unsigned int maxInterestPoints, const FloatsMatrix &integralRasterData, UCharsMatrix const *maskRasterDataPtr, InterestPointsSetT &interestPoints) const
 SURF interest points locator. More...
 
void reset ()
 Clear all internal allocated resources and go back to the initial not-initialized state. More...
 
 TiePointsLocatorSURFStrategy ()
 

Static Protected Member Functions

static bool checkForDuplicatedInterestPoints (const InterestPointsSetT &interestPoints, double &x, double &y)
 Check for duplicated interest points. More...
 
static bool createIntegralImage (const FloatsMatrix &inputData, FloatsMatrix &outputData)
 Create an integral image. More...
 
static void createTifFromMatrix (const FloatsMatrix &rasterData, const InterestPointsSetT &interestPoints, const std::string &tifFileName)
 Moravec interest points locator. More...
 
static void executeMatchingByEuclideanDistThreadEntry (ExecuteMatchingByEuclideanDistThreadEntryParams *paramsPtr)
 Correlation/Euclidean match thread entry. More...
 
static void features2Tiff (const DoublesMatrix &features, const InterestPointsSetT &interestPoints, const std::string &fileNameBeginning)
 Save the generated features to tif files. More...
 
static bool generateSurfFeatures (const InterestPointsSetT &interestPoints, const FloatsMatrix &integralRasterData, InterestPointsSetT &validInterestPoints, FloatsMatrix &features)
 Generate a Surf features matrix for the given interes points. More...
 
template<typename BufferType >
static float getHaarXVectorIntensity (BufferType &buffer, const unsigned int &centerX, const unsigned int &centerY, const unsigned int &radius)
 Return a Haar X intesity vector for the window centered at the given point. More...
 
template<typename BufferType >
static float getHaarYVectorIntensity (BufferType &buffer, const unsigned int &centerX, const unsigned int &centerY, const unsigned int &radius)
 Return a Haar Y intesity vector for the window centered at the given point. More...
 
template<typename BufferType >
static float getIntegralBoxSum (BufferType &buffer, const unsigned int &upperLeftX, const unsigned int &upperLeftY, const unsigned int &lowerRightX, const unsigned int &lowerRightY)
 Return a sum of all pixels inside a box over the given integral image buffer. More...
 
static float getSurfDxxDerivative (float **bufferPtr, const unsigned int &centerX, const unsigned int &centerY, const unsigned int &lobeWidth, const unsigned int &lobeRadius)
 Return a SURF box filter Dyy derivative centered over the given position from the given integral image buffer. More...
 
static float getSurfDxyDerivative (float **bufferPtr, const unsigned int &centerX, const unsigned int &centerY, const unsigned int &lobeWidth)
 Return a SURF box filter Dxy derivative centered over the given position from the given integral image buffer. More...
 
static float getSurfDyyDerivative (float **bufferPtr, const unsigned int &centerX, const unsigned int &centerY, const unsigned int &lobeWidth, const unsigned int &lobeRadius)
 Return a SURF box filter Dxx derivative centered over the given position from the given integral image buffer. More...
 
static unsigned int getSurfFilterSize (const unsigned int &octaveIndex, const unsigned int &scaleIndex)
 Return the surf octave filter size (width). More...
 
static unsigned int getSurfOctaveBaseFilterSize (const unsigned int &octaveIndex)
 Return the surf octave base filter size (width). More...
 
static unsigned int getSurfOctaveFilterStepSize (const unsigned int &octaveIndex)
 Return the surf octave filter step size (width). More...
 
static bool loadRasterData (te::rst::Raster const *rasterPtr, const std::vector< unsigned int > &rasterBands, te::rst::Raster const *maskRasterPtr, const unsigned int maskRasterBand, const unsigned int rasterTargetAreaLineStart, const unsigned int rasterTargetAreaColStart, const unsigned int rasterTargetAreaWidth, const unsigned int rasterTargetAreaHeight, const double desiredRescaleFactorX, const double desiredRescaleFactorY, const te::rst::Interpolator::Method rasterInterpMethod, const unsigned char maxMemPercentUsage, std::vector< boost::shared_ptr< FloatsMatrix > > &loadedRasterData, UCharsMatrix &loadedMaskRasterData, double &achievedRescaleFactorX, double &achievedRescaleFactorY)
 Load rasters data (normalized between 0 and 1). More...
 
static void locateSurfInterestPointsThreadEntry (SurfLocatorThreadParams *paramsPtr)
 Surf locator thread entry. More...
 
template<typename BufferElementT >
static void roolUpBuffer (BufferElementT **bufferPtr, const unsigned int &bufferLinesNumber)
 RoolUp a buffer of lines. More...
 

Protected Attributes

te::rp::TiePointsLocatorInputParameters m_inputParameters
 Input parameters. More...
 
bool m_isInitialized
 true if this instance is initialized. More...
 

Friends

class TiePointsLocatorSURFStrategyFactory
 

Detailed Description

Tie-points locator SURF strategy.

Definition at line 44 of file TiePointsLocatorSURFStrategy.h.

Member Typedef Documentation

A matrix do store double values.

Definition at line 92 of file TiePointsLocatorStrategy.h.

A matrix do store float values.

Definition at line 86 of file TiePointsLocatorStrategy.h.

Interest points list container type

Definition at line 149 of file TiePointsLocatorStrategy.h.

typedef std::multiset< InterestPointT > te::rp::TiePointsLocatorStrategy::InterestPointsSetT
protectedinherited

Interest points set container type

Definition at line 145 of file TiePointsLocatorStrategy.h.

Matched interest points container type

Definition at line 192 of file TiePointsLocatorStrategy.h.

A matrix do store unsigned char values.

Definition at line 98 of file TiePointsLocatorStrategy.h.

Constructor & Destructor Documentation

te::rp::TiePointsLocatorSURFStrategy::~TiePointsLocatorSURFStrategy ( )
te::rp::TiePointsLocatorSURFStrategy::TiePointsLocatorSURFStrategy ( )
protected

Member Function Documentation

static bool te::rp::TiePointsLocatorStrategy::checkForDuplicatedInterestPoints ( const InterestPointsSetT interestPoints,
double &  x,
double &  y 
)
staticprotectedinherited

Check for duplicated interest points.

Parameters
xThe duplicated tie-points X coord.
yThe duplicated tie-points Y coord.
Returns
false if duplicated interest points were found.
static bool te::rp::TiePointsLocatorSURFStrategy::createIntegralImage ( const FloatsMatrix inputData,
FloatsMatrix outputData 
)
staticprotected

Create an integral image.

Parameters
inputDataThe input data.
outputDataThe output data.
Note
The entry of an integral image IΣ(x) at a location x = (x, y) represents the sum of all pixels in the input image I of a rectangular region formed by the point x and the origi.
Returns
true if ok, false on errors.
static void te::rp::TiePointsLocatorStrategy::createTifFromMatrix ( const FloatsMatrix rasterData,
const InterestPointsSetT interestPoints,
const std::string &  tifFileName 
)
staticprotectedinherited

Moravec interest points locator.

Parameters
rasterDataThe loaded raster data.
interestPointsThe found raster 1 interest points (coords related to rasterData lines/cols).
tifFileNameTif file name.
bool te::rp::TiePointsLocatorSURFStrategy::executeMatchingByEuclideanDist ( const FloatsMatrix featuresSet1,
const FloatsMatrix featuresSet2,
const InterestPointsSetT interestPointsSet1,
const InterestPointsSetT interestPointsSet2,
te::gm::GeometricTransformation const *const  raster1ToRaster2TransfPtr,
const double  raster1ToRaster2TransfDMapError,
MatchedInterestPointsSetT matchedPoints 
) const
protected

Match each feature using eucliean distance.

Parameters
featuresSet1Features set 1.
featuresSet2Features set 2.
interestPointsSet1The interest pionts set 1 (full raster 1 indexed coods reference)..
interestPointsSet2The interest pionts set 2 (full raster 1 indexed coods reference)..
raster1ToRaster2TransfPtrA pointer to a transformation direct mapping raster 1 indexed coords into raster 2 indexed coords, of an empty pointer if there is no transformation avaliable.
raster1ToRaster2TransfDMapErrorThe expected transformation error.
matchedPointsThe matched points.
Note
Each matched point feature value ( MatchedInterestPoint::m_feature ) will be set to the distance value between both features.
static void te::rp::TiePointsLocatorSURFStrategy::executeMatchingByEuclideanDistThreadEntry ( ExecuteMatchingByEuclideanDistThreadEntryParams paramsPtr)
staticprotected

Correlation/Euclidean match thread entry.

Parameters
paramsPtrA pointer to the thread parameters.
static void te::rp::TiePointsLocatorStrategy::features2Tiff ( const DoublesMatrix features,
const InterestPointsSetT interestPoints,
const std::string &  fileNameBeginning 
)
staticprotectedinherited

Save the generated features to tif files.

Parameters
featuresThe features to be saved.
validInteresPointsThe interest pionts related to each feature inside the features matrix.
fileNameStartThe output file name beginning.
static bool te::rp::TiePointsLocatorSURFStrategy::generateSurfFeatures ( const InterestPointsSetT interestPoints,
const FloatsMatrix integralRasterData,
InterestPointsSetT validInterestPoints,
FloatsMatrix features 
)
staticprotected

Generate a Surf features matrix for the given interes points.

Parameters
interestPointsThe interest points (coords related to rasterData lines/cols).
integralRasterDataThe integral raster data.
validInterestPointsThe valid interest points.
featuresThe generated features matrix (one feature per line, one feature per interest point).
Returns
true if ok, false on errors.
unsigned int te::rp::TiePointsLocatorSURFStrategy::getAutoMaxTiePointsNumber ( ) const
protectedvirtual

Returns a automatically calculated optimum maximum amount tie-points following the current parameters.

Returns
Returns a automatically calculated optimum maximum amount tie-points following the current parameters.

Implements te::rp::TiePointsLocatorStrategy.

void te::rp::TiePointsLocatorSURFStrategy::getDefaultSpecStrategyParams ( std::auto_ptr< TiePointsLocatorStrategyParameters > &  defaultSpecParamsPtr) const
virtual

Returns a sub-sampled version of the given locator strategy specific input parameters.

Parameters
subSampleOptimizationRescaleFactorSub-sampled optimization tie-points search rescale factor.
inputSpecParamsInput parameters (sub-sample factor 1).
subSampledSpecParamsSub-sampled parameters.

Implements te::rp::TiePointsLocatorStrategy.

template<typename BufferType >
static float te::rp::TiePointsLocatorSURFStrategy::getHaarXVectorIntensity ( BufferType &  buffer,
const unsigned int &  centerX,
const unsigned int &  centerY,
const unsigned int &  radius 
)
inlinestaticprotected

Return a Haar X intesity vector for the window centered at the given point.

Parameters
bufferIntegral image buffer.
centerXCenter X.
centerYCenter Y.
radiusWindow radius.

Definition at line 435 of file TiePointsLocatorSURFStrategy.h.

template<typename BufferType >
static float te::rp::TiePointsLocatorSURFStrategy::getHaarYVectorIntensity ( BufferType &  buffer,
const unsigned int &  centerX,
const unsigned int &  centerY,
const unsigned int &  radius 
)
inlinestaticprotected

Return a Haar Y intesity vector for the window centered at the given point.

Parameters
bufferIntegral image buffer.
centerXCenter X.
centerYCenter Y.
radiusWindow radius.

Definition at line 467 of file TiePointsLocatorSURFStrategy.h.

template<typename BufferType >
static float te::rp::TiePointsLocatorSURFStrategy::getIntegralBoxSum ( BufferType &  buffer,
const unsigned int &  upperLeftX,
const unsigned int &  upperLeftY,
const unsigned int &  lowerRightX,
const unsigned int &  lowerRightY 
)
inlinestaticprotected

Return a sum of all pixels inside a box over the given integral image buffer.

Parameters
bufferPtrBuffer pointer.
upperLeftXBox upper left X.
upperLeftYBox upper left Y.
lowerRightXBox lower right X.
lowerRightYBox lower right X.

Definition at line 298 of file TiePointsLocatorSURFStrategy.h.

bool te::rp::TiePointsLocatorSURFStrategy::getMatchedInterestPoints ( te::gm::GeometricTransformation const *const  raster1ToRaster2TransfPtr,
const double  raster1ToRaster2TransfDMapError,
MatchedInterestPointsSetT matchedInterestPoints 
)
protectedvirtual

Try to find matched interest points.

Parameters
matchedInterestPointsThe matched interest points.
raster1ToRaster2TransfPtrA pointer to a transformation (estimation) direct mapping raster 1 indexed coords into raster 2 indexed coords, of an empty pointer if there is no transformation avaliable.
raster1ToRaster2TransfDMapErrorThe expected transformation error.
Returns
true if OK, false on errors.

Implements te::rp::TiePointsLocatorStrategy.

void te::rp::TiePointsLocatorSURFStrategy::getSubSampledSpecStrategyParams ( const double  subSampleOptimizationRescaleFactor,
const TiePointsLocatorStrategyParameters inputSpecParams,
std::auto_ptr< TiePointsLocatorStrategyParameters > &  subSampledSpecParamsPtr 
) const
virtual

Returns a sub-sampled version of the given locator strategy specific input parameters.

Parameters
subSampleOptimizationRescaleFactorSub-sampled optimization tie-points search rescale factor.
inputSpecParamsInput parameters (sub-sample factor 1).
subSampledSpecParamsPtrSub-sampled parameters.

Implements te::rp::TiePointsLocatorStrategy.

static float te::rp::TiePointsLocatorSURFStrategy::getSurfDxxDerivative ( float **  bufferPtr,
const unsigned int &  centerX,
const unsigned int &  centerY,
const unsigned int &  lobeWidth,
const unsigned int &  lobeRadius 
)
inlinestaticprotected

Return a SURF box filter Dyy derivative centered over the given position from the given integral image buffer.

Parameters
bufferPtrBuffer pointer.
centerXCenter X.
centerYCenter Y.
lobeWidthFilter lobe width.
lobeRadiusFilter lobe radius.

Definition at line 354 of file TiePointsLocatorSURFStrategy.h.

static float te::rp::TiePointsLocatorSURFStrategy::getSurfDxyDerivative ( float **  bufferPtr,
const unsigned int &  centerX,
const unsigned int &  centerY,
const unsigned int &  lobeWidth 
)
inlinestaticprotected

Return a SURF box filter Dxy derivative centered over the given position from the given integral image buffer.

Parameters
bufferPtrBuffer pointer.
centerXCenter X.
centerYCenter Y.
lobeWidthFilter lobe width.

Definition at line 385 of file TiePointsLocatorSURFStrategy.h.

static float te::rp::TiePointsLocatorSURFStrategy::getSurfDyyDerivative ( float **  bufferPtr,
const unsigned int &  centerX,
const unsigned int &  centerY,
const unsigned int &  lobeWidth,
const unsigned int &  lobeRadius 
)
inlinestaticprotected

Return a SURF box filter Dxx derivative centered over the given position from the given integral image buffer.

Parameters
bufferPtrBuffer pointer.
centerXCenter X.
centerYCenter Y.
lobeWidthFilter lobe width.
lobeRadiusFilter lobe radius.

Definition at line 321 of file TiePointsLocatorSURFStrategy.h.

static unsigned int te::rp::TiePointsLocatorSURFStrategy::getSurfFilterSize ( const unsigned int &  octaveIndex,
const unsigned int &  scaleIndex 
)
inlinestaticprotected

Return the surf octave filter size (width).

Parameters
octaveIndexOctave index (starting from zero).
scaleIndexScale index (starting from zero).

Definition at line 514 of file TiePointsLocatorSURFStrategy.h.

static unsigned int te::rp::TiePointsLocatorSURFStrategy::getSurfOctaveBaseFilterSize ( const unsigned int &  octaveIndex)
inlinestaticprotected

Return the surf octave base filter size (width).

Parameters
octaveIndexOctave index (starting from zero).

Definition at line 502 of file TiePointsLocatorSURFStrategy.h.

static unsigned int te::rp::TiePointsLocatorSURFStrategy::getSurfOctaveFilterStepSize ( const unsigned int &  octaveIndex)
inlinestaticprotected

Return the surf octave filter step size (width).

Parameters
octaveIndexOctave index (starting from zero).

Definition at line 492 of file TiePointsLocatorSURFStrategy.h.

bool te::rp::TiePointsLocatorSURFStrategy::initialize ( const te::rp::TiePointsLocatorInputParameters inputParameters)
protectedvirtual

Initialize the strategy.

Parameters
inputParametersInput parameters.
Returns
true if OK, false on errors.

Implements te::rp::TiePointsLocatorStrategy.

static bool te::rp::TiePointsLocatorStrategy::loadRasterData ( te::rst::Raster const *  rasterPtr,
const std::vector< unsigned int > &  rasterBands,
te::rst::Raster const *  maskRasterPtr,
const unsigned int  maskRasterBand,
const unsigned int  rasterTargetAreaLineStart,
const unsigned int  rasterTargetAreaColStart,
const unsigned int  rasterTargetAreaWidth,
const unsigned int  rasterTargetAreaHeight,
const double  desiredRescaleFactorX,
const double  desiredRescaleFactorY,
const te::rst::Interpolator::Method  rasterInterpMethod,
const unsigned char  maxMemPercentUsage,
std::vector< boost::shared_ptr< FloatsMatrix > > &  loadedRasterData,
UCharsMatrix loadedMaskRasterData,
double &  achievedRescaleFactorX,
double &  achievedRescaleFactorY 
)
staticprotectedinherited

Load rasters data (normalized between 0 and 1).

Parameters
rasterPtrInput raster pointer.
rasterBandsInput raster bands.
maskRasterPtrThe related input mask raster pointer (or zero, if no mask raster is avaliable).
maskRasterBandThe input mask raster band to use.
rasterTargetAreaLineStartThe raster target area initial line.
rasterTargetAreaColStartThe raster target area initial column.
rasterTargetAreaWidthThe raster target area width.
rasterTargetAreaHeightThe raster target area height.
desiredRescaleFactorXThe desired Scale factor to be applied on the loaded data.
desiredRescaleFactorYThe desired Scale factor to be applied on the loaded data.
rasterInterpMethodThe interpolation used when loading the input raster.
maxMemPercentUsageThe maximum amount (percent) of memory to use for the loaded data [0,100].
loadedRasterDataThe loaded raster data.
loadedMaskRasterDataThe loaded mask raster data.
desiredRescaleFactorXThe real achieved Scale factor.
desiredRescaleFactorYThe real achieved Scale factor.
Returns
true if ok, false on errors.
bool te::rp::TiePointsLocatorSURFStrategy::locateSurfInterestPoints ( const unsigned int  maxInterestPoints,
const FloatsMatrix integralRasterData,
UCharsMatrix const *  maskRasterDataPtr,
InterestPointsSetT interestPoints 
) const
protected

SURF interest points locator.

Parameters
maxInterestPointsThe maximum number of interest points to find.
integralRasterDataIntegral image raster data.
maskRasterDataPtrThe loaded mask raster data pointer (or zero if no mask is avaliable).
interestPointsThe found interest points (coords related to rasterData lines/cols).
Returns
true if ok, false on errors.
Note
InterestPointT::m_feature1 will be sum of differences between the hessian matrix determinant each pixel and its neighborhoods (always a positive value).
InterestPointT::m_feature2 will be used filter width (pixels).
InterestPointT::m_feature3 will 1 if the laplacian sign is positive, or zero if negative.
static void te::rp::TiePointsLocatorSURFStrategy::locateSurfInterestPointsThreadEntry ( SurfLocatorThreadParams paramsPtr)
staticprotected

Surf locator thread entry.

Parameters
paramsPtrA pointer to the thread parameters.
void te::rp::TiePointsLocatorSURFStrategy::reset ( )
protectedvirtual

Clear all internal allocated resources and go back to the initial not-initialized state.

Implements te::rp::TiePointsLocatorStrategy.

template<typename BufferElementT >
static void te::rp::TiePointsLocatorStrategy::roolUpBuffer ( BufferElementT **  bufferPtr,
const unsigned int &  bufferLinesNumber 
)
inlinestaticprotectedinherited

RoolUp a buffer of lines.

Parameters
bufferPtrBuffer pointer.
bufferLinesNumberBuffer lines number.

Definition at line 290 of file TiePointsLocatorStrategy.h.

Friends And Related Function Documentation

Definition at line 46 of file TiePointsLocatorSURFStrategy.h.

Member Data Documentation

te::rp::TiePointsLocatorInputParameters te::rp::TiePointsLocatorSURFStrategy::m_inputParameters
protected

Input parameters.

Definition at line 162 of file TiePointsLocatorSURFStrategy.h.

bool te::rp::TiePointsLocatorSURFStrategy::m_isInitialized
protected

true if this instance is initialized.

Definition at line 160 of file TiePointsLocatorSURFStrategy.h.


The documentation for this class was generated from the following file: