Go to the documentation of this file.
25 #ifndef __TERRALIB_RP_INTERNAL_TIEPOINTSLOCATORSURFSTRATEGY_H
26 #define __TERRALIB_RP_INTERNAL_TIEPOINTSLOCATORSURFSTRATEGY_H
32 #include <boost/thread.hpp>
77 AbstractParameters* clone() const;
83 void getSubSampledSpecStrategyParams(
84 const
double subSampleOptimizationRescaleFactor,
89 void getDefaultSpecStrategyParams(
176 const double raster1ToRaster2TransfDMapError,
217 const unsigned int maxInterestPoints,
273 const double raster1ToRaster2TransfDMapError,
297 template<
typename BufferType >
299 const unsigned int& upperLeftX,
const unsigned int& upperLeftY,
300 const unsigned int& lowerRightX,
const unsigned int& lowerRightY )
302 return buffer[ lowerRightY ][ lowerRightX ]
303 - ( ( upperLeftY ) ? buffer[ upperLeftY - 1 ][ lowerRightX ] : 0 )
304 - ( ( upperLeftX ) ? buffer[ lowerRightY ][ upperLeftX - 1 ] : 0 )
305 + ( ( ( upperLeftX != 0 ) && ( upperLeftY != 0 ) ) ? buffer[ upperLeftY - 1 ][ upperLeftX - 1 ] : 0 );
322 const unsigned int& centerX,
const unsigned int& centerY,
323 const unsigned int& lobeWidth,
const unsigned int& lobeRadius )
328 ( centerX + 1 - lobeWidth ),
329 ( centerY - lobeWidth - lobeRadius ),
330 ( centerX + lobeWidth - 1 ),
331 ( centerY + lobeWidth + lobeRadius ) )
335 ( centerX + 1 - lobeWidth ),
336 ( centerY - lobeRadius ),
337 ( centerX + lobeWidth - 1 ),
338 ( centerY + lobeRadius ) ) );
355 const unsigned int& centerX,
const unsigned int& centerY,
356 const unsigned int& lobeWidth,
const unsigned int& lobeRadius )
361 ( centerX - lobeWidth - lobeRadius ),
362 ( centerY + 1 - lobeWidth ),
363 ( centerX + lobeWidth + lobeRadius ),
364 ( centerY + lobeWidth - 1 ) )
368 ( centerX - lobeRadius ),
369 ( centerY + 1 - lobeWidth ),
370 ( centerX + lobeRadius ),
371 ( centerY + lobeWidth - 1 ) );
386 const unsigned int& centerX,
const unsigned int& centerY,
387 const unsigned int& lobeWidth )
393 ( centerX - lobeWidth ),
394 ( centerY - lobeWidth ),
403 ( centerX + lobeWidth ),
404 ( centerY + lobeWidth ) )
410 ( centerY - lobeWidth ),
411 ( centerX + lobeWidth ),
417 ( centerX - lobeWidth ),
420 ( centerY + lobeWidth ) );
434 template<
typename BufferType >
436 const unsigned int& centerX,
const unsigned int& centerY,
437 const unsigned int& radius )
443 ( centerY - radius ),
444 ( centerX + radius ),
445 ( centerY + radius ) )
449 ( centerX - radius ),
450 ( centerY - radius ),
452 ( centerY + radius ) );
466 template<
typename BufferType >
468 const unsigned int& centerX,
const unsigned int& centerY,
469 const unsigned int& radius )
474 ( centerX - radius ),
475 ( centerY - radius ),
476 ( centerX + radius ),
481 ( centerX - radius ),
483 ( centerX + radius ),
484 ( centerY + radius ) );
494 return (
unsigned int)std::pow( 2.0, (
double)(octaveIndex + 1) );
504 return 3 + ( 3 * getSurfOctaveFilterStepSize( octaveIndex ) );
515 const unsigned int& scaleIndex )
517 return getSurfOctaveBaseFilterSize( octaveIndex ) +
518 ( 3 * ( getSurfOctaveFilterStepSize( octaveIndex ) * scaleIndex ) );
FloatsMatrix const * m_featuresSet2Ptr
~TiePointsLocatorSURFStrategyFactory()
A generic template matrix.
unsigned int * m_nextFeatureIdx1ToProcessPtr
~ExecuteMatchingByEuclideanDistThreadEntryParams()
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
unsigned int m_tiePointsSubSectorsSplitFactor
The number of sectors along each direction.
unsigned int m_octavesNumber
The number of octaves to generate (minimum:1).
FloatsMatrix const * m_featuresSet1Ptr
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)
Match each feature using eucliean distance.
unsigned int m_maxInterestPointsBySubSector
The maximum number of interest points by sub-sector.
bool getMatchedInterestPoints(te::gm::GeometricTransformation const *const raster1ToRaster2TransfPtr, const double raster1ToRaster2TransfDMapError, MatchedInterestPointsSetT &matchedInterestPoints)
Try to find matched interest points.
~SurfLocatorThreadParams()
bool locateSurfInterestPoints(const unsigned int maxInterestPoints, const FloatsMatrix &integralRasterData, UCharsMatrix const *maskRasterDataPtr, InterestPointsSetT &interestPoints) const
SURF interest points locator.
TiePointsLocatorSURFStrategyFactory()
TiePointsLocator SURF strategy parameters.
unsigned int m_surfScalesNumber
The number of sub-sampling scales to generate, when applicable (default:3, minimum:3).
std::vector< InterestPointsSetT > * m_interestPointsSubSectorsPtr
A pointer to a valid interest points container (one element by subsector)..
static float getSurfDxxDerivative(float **bufferPtr, const unsigned int ¢erX, const unsigned int ¢erY, const unsigned int &lobeWidth, const unsigned int &lobeRadius)
Return a SURF box filter Dyy derivative centered over the given position from the given integral imag...
InterestPointT const * m_interestPointsSet2Ptr
static float getHaarXVectorIntensity(BufferType &buffer, const unsigned int ¢erX, const unsigned int ¢erY, const unsigned int &radius)
Return a Haar X intesity vector for the window centered at the given point.
bool m_isInitialized
true if this instance is initialized.
te::rp::TiePointsLocatorStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects.
Raster tie points locator strategy factory base class.
SurfLocatorThreadParams()
unsigned int m_processingBlocksNumber
The raster data will be splitted into this number of blocks for processing.
Tie-Pointsr locator strategy.
static float getSurfDxyDerivative(float **bufferPtr, const unsigned int ¢erX, const unsigned int ¢erY, const unsigned int &lobeWidth)
Return a SURF box filter Dxy derivative centered over the given position from the given integral imag...
bool initialize(const te::rp::TiePointsLocatorInputParameters &inputParameters)
Initialize the strategy.
Tie-points locator SURF strategy.
static float getHaarYVectorIntensity(BufferType &buffer, const unsigned int ¢erX, const unsigned int ¢erY, const unsigned int &radius)
Return a Haar Y intesity vector for the window centered at the given point.
The parameters passed to the surfLocatorThreadEntry method.
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.
Tie Points Locator strategy parameters.
Raster tie-points locator strategy factory base class.
Base exception class for plugin module.
boost::mutex * m_rastaDataAccessMutexPtr
A pointer to a valid mutex to controle raster data access.
static unsigned int getSurfOctaveFilterStepSize(const unsigned int &octaveIndex)
Return the surf octave filter step size (width).
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
FloatsMatrix const * m_integralRasterDataPtr
The integral image raster data.
TiePointsLocator strategy parameters.
std::multiset< InterestPointT > InterestPointsSetT
Tie-points locator strategy.
static void locateSurfInterestPointsThreadEntry(SurfLocatorThreadParams *paramsPtr)
Surf locator thread entry.
unsigned int m_surfOctavesNumber
The number of octaves to generate, when applicable (default: 2, minimum:2).
unsigned int m_scalesNumber
Thread return value pointer.
void reset()
Clear all internal allocated resources and go back to the initial not-initialized state.
Parameters(const Parameters &)
boost::mutex * m_syncMutexPtr
static unsigned int getSurfOctaveBaseFilterSize(const unsigned int &octaveIndex)
Return the surf octave base filter size (width).
double m_surfMaxNormEuclideanDist
The maximum acceptable euclidean distance when matching features (when applicable),...
SURF tie-points locator strategy factory.
unsigned int * m_nextRasterLinesBlockToProcessValuePtr
A pointer to a valid counter to control the blocks processing sequence.
std::multiset< MatchedInterestPointsT > MatchedInterestPointsSetT
TiePointsLocatorSURFStrategy()
boost::mutex * m_interestPointsAccessMutexPtr
A pointer to a valid mutex to control the output interest points container access.
The parameters passed to the executeMatchingByEuclideanDistThreadEntry method.
unsigned int getAutoMaxTiePointsNumber() const
Returns a automatically calculated optimum maximum amount tie-points following the current parameters...
te::gm::GeometricTransformation const * m_raster1ToRaster2TransfPtr
A pointer to a transformation direct mapping raster 1 indexed coords into raster 2 indexed coords,...
static unsigned int getSurfFilterSize(const unsigned int &octaveIndex, const unsigned int &scaleIndex)
Return the surf octave filter size (width).
te::rp::TiePointsLocatorInputParameters m_inputParameters
Input parameters.
static void executeMatchingByEuclideanDistThreadEntry(ExecuteMatchingByEuclideanDistThreadEntryParams *paramsPtr)
Correlation/Euclidean match thread entry.
static float getSurfDyyDerivative(float **bufferPtr, const unsigned int ¢erX, const unsigned int ¢erY, const unsigned int &lobeWidth, const unsigned int &lobeRadius)
Return a SURF box filter Dxx derivative centered over the given position from the given integral imag...
InterestPointT const * m_interestPointsSet1Ptr
ExecuteMatchingByEuclideanDistThreadEntryParams()
static bool generateSurfFeatures(const InterestPointsSetT &interestPoints, const FloatsMatrix &integralRasterData, InterestPointsSetT &validInterestPoints, FloatsMatrix &features)
Generate a Surf features matrix for the given interes points.
double m_searchOptTreeSearchRadius
Optimization tree search radius (pixels).
UCharsMatrix const * m_maskRasterDataPtr
The loaded mask raster data pointer (or zero if no mask is avaliable).
static bool createIntegralImage(const FloatsMatrix &inputData, FloatsMatrix &outputData)
Create an integral image.
FloatsMatrix * m_distMatrixPtr