All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TiePointsLocator.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/TiePointsLocator.h
22  \brief TiePointsLocator locator.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_TIEPOINTSLOCATOR_H
26 #define __TERRALIB_RP_INTERNAL_TIEPOINTSLOCATOR_H
27 
28 #include "Algorithm.h"
29 #include "Matrix.h"
30 #include "../raster/Raster.h"
31 #include "../raster/Interpolator.h"
32 #include "../geometry/GeometricTransformation.h"
33 #include "../geometry/GTParameters.h"
34 #include "../sam/rtree.h"
35 #include "../common/progress/TaskProgress.h"
36 
37 #include <vector>
38 #include <set>
39 #include <string>
40 #include <list>
41 
42 #include <boost/thread.hpp>
43 #include <boost/shared_ptr.hpp>
44 
45 namespace te
46 {
47  namespace rp
48  {
49  /*!
50  \class TiePointsLocator
51  \brief Tie points locator.
52  \details Designed to find tie-points inside raster areas.
53  \ingroup rp_match
54  */
56  {
57  public:
58 
59  /*!
60  \class InputParameters
61  \brief TiePointsLocator input parameters
62  */
64  {
65  public:
66 
67  /**
68  * \name Global parameters
69  */
70  /**@{*/
71 
72  /*! \enum The strategy used to locate tie points.*/
74  {
75  InvalidStrategyT = 0, /*!< Invalid strategy. */
76  MoravecStrategyT = 1, /*!< Modified Moravec Interest Operator based image area matching - Reference: Extration of GCP chips from GeoCover using Modified Moravec Interest Operator (MMIO) algorithm, The United States Geological Survey. */
77  SurfStrategyT = 2 /*!< SURF based image area matching - Reference: SURF: Speeded Up Robust Features, Herbert Bay. */
78  };
79 
80  InteresPointsLocationStrategyType m_interesPointsLocationStrategy; //!< The strategy used to locate interest points (default:SurfStrategyT).
81 
82  te::rst::Raster const* m_inRaster1Ptr; //!< Input raster 1.
83 
84  te::rst::Raster const* m_inMaskRaster1Ptr; //!< Optional one band input mask raster 1 (tie-points will not be generated inside mask image areas marked with zeroes).
85 
86  std::vector< unsigned int > m_inRaster1Bands; //!< Bands to be used from the input raster 1.
87 
88  unsigned int m_raster1TargetAreaLineStart; //!< The first line of the raster 1 target area to process (default:0 - The entire raster will be considered).
89 
90  unsigned int m_raster1TargetAreaColStart; //!< The first column of the raster 2 target area to process (default:0 - The entire raster will be considered).
91 
92  unsigned int m_raster1TargetAreaWidth; //!< The raster 1 target area width (default:0 - The entire raster will be considered).
93 
94  unsigned int m_raster1TargetAreaHeight; //!< The raster 1 target area height (default:0 - The entire raster will be considered).
95 
96  te::rst::Raster const* m_inRaster2Ptr; //!< Input raster 2.
97 
98  te::rst::Raster const* m_inMaskRaster2Ptr; //!< Optional one band input mask raster 2 (tie-points will not be generated inside mask image areas marked with zeroes).
99 
100  std::vector< unsigned int > m_inRaster2Bands; //!< Bands to be used from the input raster 2.
101 
102  unsigned int m_raster2TargetAreaLineStart; //!< The first line of the raster 2 target area to process (default:0 - The entire raster will be considered).
103 
104  unsigned int m_raster2TargetAreaColStart; //!< The first column of the raster 2 target area to process (default:0 - The entire raster will be considered).
105 
106  unsigned int m_raster2TargetAreaWidth; //!< The raster 2 target area width (default:0 - The entire raster will be considered).
107 
108  unsigned int m_raster2TargetAreaHeight; //!< The raster 2 target area height (default:0 - The entire raster will be considered).
109 
110  bool m_enableMultiThread; //!< Enable/Disable the use of multi-threads (default:true).
111 
112  bool m_enableProgress; //!< Enable/Disable the progress interface (default:false).
113 
114  unsigned int m_maxTiePoints; //!< The maximum number of tie-points to generate (default=0 - Automatically found).
115 
116  double m_pixelSizeXRelation; //!< The pixel resolution relation m_pixelSizeXRelation = raster1_pixel_res_x / raster2_pixel_res_x (default=1.0).
117 
118  double m_pixelSizeYRelation; //!< The pixel resolution relation m_pixelSizeYRelation = raster1_pixel_res_y / raster2_pixel_res_y (default=1.0).
119 
120  std::string m_geomTransfName; //!< The name of the geometric transformation used to ensure tie-points consistency (see each te::gm::GTFactory inherited classes to find each factory key/name, default:Affine).
121 
122  double m_geomTransfMaxError; //!< The maximum allowed transformation error (pixel units, default:2).
123 
124  unsigned int m_maxR1ToR2Offset; //!< The maximum offset (pixels units) between a raster 1 point end the respective raster 2 point (default:0 - no offset restriction).
125 
126  bool m_enableGeometryFilter; //!< Enable/disable the geometry filter/outliers remotion (default:true).
127 
128  double m_geometryFilterAssurance; //!< Geometry assurance (the error-free selection percent assurance) - valid range (0-1) - default:0.1 - Use 0-zero to let this number be automatically found.
129 
130  double m_rastersRescaleFactor; //!< Global rescale factor to apply to all input rasters (default:1, valid range: non-zero positive values).
131 
132  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
133 
134  //@}
135 
136  /**
137  * \name Moravec parameters
138  */
139  /**@{*/
140 
141  unsigned int m_moravecCorrelationWindowWidth; //!< The correlation window width used to correlate points between the images (minimum 3, default: 11).
142 
143  unsigned int m_moravecWindowWidth; //!< The Moravec window width used to locate canditate tie-points (minimum 3, default: 5 ).
144 
145  unsigned int m_moravecGaussianFilterIterations; //!< The number of noise Gaussin iterations, when applicable (used to remove image noise, zero will disable the Gaussian Filter, default:1).
146 
147  double m_moravecMinAbsCorrelation; //!< The minimum acceptable absolute correlation value when matching features (when applicable), default:0.5, valid range: [0,1].
148 
149  //@}
150 
151  /**
152  * \name SURF parameters
153  */
154  /**@{*/
155 
156  unsigned int m_surfScalesNumber; //!< The number of sub-sampling scales to generate, when applicable (default:4, minimum:3).
157 
158  unsigned int m_surfOctavesNumber; //!< The number of octaves to generate, when applicable (default: 3, minimum:1).
159 
160  double m_surfMaxNormEuclideanDist; //!< The maximum acceptable euclidean distance when matching features (when applicable), default:0.5, valid range: [0,1].
161 
162  //@}
163 
164  InputParameters();
165 
167 
168  ~InputParameters();
169 
170  //overload
171  void reset() throw( te::rp::Exception );
172 
173  //overload
174  const InputParameters& operator=( const InputParameters& params );
175 
176  //overload
177  AbstractParameters* clone() const;
178  };
179 
180  /*!
181  \class OutputParameters
182  \brief TiePointsLocator output parameters
183  */
185  {
186  public:
187 
188  std::vector< te::gm::GTParameters::TiePoint > m_tiePoints; //!< The generated tie-pionts (te::gm::GTParameters::TiePoint::first are raster 1 line/column indexes, te::gm::GTParameters::TiePoint::second are raster 2 line/column indexes).
189 
190  std::auto_ptr< te::gm::GeometricTransformation > m_transformationPtr; //!< The generated geometric transformation with the base mininum required tie-points set ( depending on the tie-points, a valid transformation may not exist, in this case, this pointer will be null).
191 
193 
195 
196  ~OutputParameters();
197 
198  //overload
199  void reset() throw( te::rp::Exception );
200 
201  //overload
202  const OutputParameters& operator=( const OutputParameters& params );
203 
204  //overload
205  AbstractParameters* clone() const;
206  };
207 
209 
210  ~TiePointsLocator();
211 
212  //overload
213  bool execute( AlgorithmOutputParameters& outputParams ) throw( te::rp::Exception );
214 
215  //overload
216  void reset() throw( te::rp::Exception );
217 
218  //overload
219  bool initialize( const AlgorithmInputParameters& inputParams ) throw( te::rp::Exception );
220 
221  bool isInitialized() const;
222 
223  protected:
224 
225  /*!
226  \typedef FloatsMatrix
227  \brief A matrix do store float values.
228  */
229  typedef te::rp::Matrix< float > FloatsMatrix;
230 
231  /*!
232  \typedef DoublesMatrix
233  \brief A matrix do store double values.
234  */
235  typedef te::rp::Matrix< double > DoublesMatrix;
236 
237  /*!
238  \typedef UCharsMatrix
239  \brief A matrix do store unsigned char values.
240  */
241  typedef te::rp::Matrix< unsigned char > UCharsMatrix;
242 
243  /*! Interest point type */
245  {
246  public :
247  unsigned int m_x; //!< Point X coord.
248 
249  unsigned int m_y; //!< Point Y coord.
250 
251  float m_feature1; //!< Interest point feature 1 value.
252 
253  float m_feature2; //!< Interest point feature 2 value.
254 
255  float m_feature3; //!< Interest point feature 3 value.
256 
258  : m_x( 0 ), m_y( 0 ), m_feature1( 0 ), m_feature2( 0 ),
259  m_feature3( 0 )
260  {
261  };
262 
263  InterestPointT( const InterestPointT& other )
264  {
265  operator=( other );
266  };
267 
269 
270  bool operator<( const InterestPointT& other ) const
271  {
272  return ( m_feature1 < other.m_feature1 );
273  };
274 
275  const InterestPointT& operator=( const InterestPointT& other )
276  {
277  m_x = other.m_x;
278  m_y = other.m_y;
279  m_feature1 = other.m_feature1;
280  m_feature2 = other.m_feature2;
281  m_feature3 = other.m_feature3;
282  return other;
283  };
284  };
285 
286  /*! Interest points set container type
287  */
288  typedef std::multiset< InterestPointT > InterestPointsSetT;
289 
290  /*! Interest points list container type
291  */
292  typedef std::list< InterestPointT > InterestPointsListT;
293 
294  /*! Matched Interest point type */
296  {
297  public :
298 
299  InterestPointT m_point1; //!< Interest point 1
300 
301  InterestPointT m_point2; //!< Interest point 2
302 
303  float m_feature; //!< Matched interest feature.
304 
306 
308  {
309  operator=( other );
310  };
311 
313  const InterestPointT& point2, const float& feature ) :
314  m_point1( point1 ), m_point2( point2 ),
315  m_feature( feature ) {};
316 
318 
319  bool operator<( const MatchedInterestPointsT& other ) const
320  {
321  return ( m_feature < other.m_feature );
322  };
323 
325  {
326  m_point1 = other.m_point1;
327  m_point2 = other.m_point2;
328  m_feature = other.m_feature;
329  return other;
330  };
331  };
332 
333  /*! Matched interest points container type
334  */
335  typedef std::multiset< MatchedInterestPointsT > MatchedInterestPointsSetT;
336 
337  /*!
338  \brief The parameters passed to the moravecLocatorThreadEntry method.
339  */
341  {
342  public :
343 
344  bool* m_returnValuePtr; //! Thread return value pointer.
345 
346  unsigned int m_moravecWindowWidth; //!< The Moravec window width used to locate canditate tie-points (minimum 11, default: 11 ).
347 
348  unsigned int m_maxInterestPointsPerRasterLinesBlock; //!< The maximum number of points to find for each raster lines block.
349 
350  FloatsMatrix const* m_rasterDataPtr; //!< The loaded raster data.
351 
352  UCharsMatrix const* m_maskRasterDataPtr; //!< The loaded mask raster data pointer (or zero if no mask is avaliable).
353 
354  InterestPointsSetT* m_interestPointsPtr; //!< A pointer to a valid interest points container.
355 
356  boost::mutex* m_rastaDataAccessMutexPtr; //!< A pointer to a valid mutex to controle raster data access.
357 
358  boost::mutex* m_interestPointsAccessMutexPtr; //!< A pointer to a valid mutex to control the output interest points container access.
359 
360  unsigned int m_maxRasterLinesBlockMaxSize; //!< The maximum lines number of each raster block to process.
361 
362  unsigned int* m_nextRasterLinesBlockToProcessValuePtr; //!< A pointer to a valid counter to control the blocks processing sequence.
363 
365 
367  };
368 
369 
370  /*!
371  \brief The parameters passed to the surfLocatorThreadEntry method.
372  */
374  {
375  public :
376 
377  bool* m_returnValuePtr; //! Thread return value pointer.
378 
379  unsigned int m_scalesNumber; //!< The number of sub-samples scales to generate (minimum:3).
380 
381  unsigned int m_octavesNumber; //!< The number of octaves to generate (minimum:1).
382 
383  unsigned int m_maxInterestPointsPerRasterLinesBlock; //!< The maximum number of points to find for each raster lines block for each scale.
384 
385  FloatsMatrix const* m_integralRasterDataPtr; //!< The integral image raster data.
386 
387  UCharsMatrix const* m_maskRasterDataPtr; //!< The loaded mask raster data pointer (or zero if no mask is avaliable).
388 
389  InterestPointsSetT* m_interestPointsPtr; //!< A pointer to a valid interest points container.
390 
391  boost::mutex* m_rastaDataAccessMutexPtr; //!< A pointer to a valid mutex to controle raster data access.
392 
393  boost::mutex* m_interestPointsAccessMutexPtr; //!< A pointer to a valid mutex to control the output interest points container access.
394 
395  unsigned int m_maxRasterLinesBlockMaxSize; //!< The maximum lines number of each raster block to process.
396 
397  unsigned int* m_nextRasterLinesBlockToProcessValuePtr; //!< A pointer to a valid counter to control the blocks processing sequence.
398 
400 
402  };
403 
404  /*!
405  \brief The parameters passed to the matchCorrelationEuclideanThreadEntry method.
406  */
408  {
409  public :
410 
412 
414 
416 
418 
420 
422 
423  boost::mutex* m_syncMutexPtr;
424 
425  unsigned int m_maxPt1ToPt2Distance; //!< Zero (disabled) or the maximum distance between a point from set 1 to a point from set 1 (points beyond this distance will not be correlated and will have zero as correlation value).
426 
428 
430  };
431 
432  /*!
433  \brief The parameters passed to the executeMatchingByEuclideanDistThreadEntry method.
434  */
436  {
437  public :
438 
440 
442 
444 
446 
448 
450 
451  boost::mutex* m_syncMutexPtr;
452 
453  unsigned int m_maxPt1ToPt2Distance; //!< Zero (disabled) or the maximum distance between a point from set 1 to a point from set 1 (points beyond this distance will not be correlated and will have zero as correlation value).
454 
456 
458  };
459 
460  TiePointsLocator::InputParameters m_inputParameters; //!< TiePointsLocator input execution parameters.
461 // TiePointsLocator::OutputParameters* m_outputParametersPtr; //!< TiePointsLocator input execution parameters.
462 
463  bool m_isInitialized; //!< Tells if this instance is initialized.
464 
465 
466  /*!
467  \brief Executes the Moravec algorithm using the supplied parameters.
468 
469  \param raster1XRescFact The X axis rescale factor to be aplied into raster 1.
470 
471  \param raster1YRescFact The Y axis rescale factor to be aplied into raster 1.
472 
473  \param raster2XRescFact The X axis rescale factor to be aplied into raster 2.
474 
475  \param raster2YRescFact The Y axis rescale factor to be aplied into raster 2.
476 
477  \param progressPtr A pointer to the progress instance or a NULL pointer if it is not used.
478 
479  \param raster1Data The raster 1 loaded data.
480 
481  \param maskRaster1Data The mask raster 1 loaded data.
482 
483  \param outParamsPtr Output parameters pointer.
484 
485  \param tiePointsWeights Ouptut tie-points weights.
486 
487  \return true if OK, false on errors.
488  */
489  bool executeMoravec(
490  const double raster1XRescFact,
491  const double raster1YRescFact,
492  const double raster2XRescFact,
493  const double raster2YRescFact,
494  te::common::TaskProgress* progressPtr,
496  std::vector< double >& tiePointsWeights )
497  throw( te::rp::Exception );
498 
499  /*!
500  \brief Executes the SURF algorithm using the supplied parameters.
501 
502  \param raster1XRescFact The X axis rescale factor to be aplied into raster 1.
503 
504  \param raster1YRescFact The Y axis rescale factor to be aplied into raster 1.
505 
506  \param raster2XRescFact The X axis rescale factor to be aplied into raster 2.
507 
508  \param raster2YRescFact The Y axis rescale factor to be aplied into raster 2.
509 
510  \param progressPtr A pointer to the progress instance or a NULL pointer if it is not used.
511 
512  \param raster1Data The raster 1 loaded data.
513 
514  \param maskRaster1Data The mask raster 1 loaded data.
515 
516  \param outParamsPtr Output parameters pointer.
517 
518  \param tiePointsWeights Ouptut tie-points weights.
519 
520  \return true if OK, false on errors.
521  */
522  bool executeSurf(
523  const double raster1XRescFact,
524  const double raster1YRescFact,
525  const double raster2XRescFact,
526  const double raster2YRescFact,
527  te::common::TaskProgress* progressPtr,
529  std::vector< double >& tiePointsWeights )
530  throw( te::rp::Exception );
531 
532  /*!
533  \brief Load rasters data (normalized between 0 and 1).
534 
535  \param rasterPtr Input raster pointer.
536 
537  \param rasterBands Input raster bands.
538 
539  \param maskRasterPtr The related input mask raster pointer (or zero, if no mask raster is avaliable).
540 
541  \param maskRasterBand The input mask raster band to use.
542 
543  \param rasterTargetAreaLineStart The raster target area initial line.
544 
545  \param rasterTargetAreaColStart The raster target area initial column.
546 
547  \param rasterTargetAreaWidth The raster target area width.
548 
549  \param rasterTargetAreaHeight The raster target area height.
550 
551  \param rescaleFactorX Scale factor to be applied on the loaded data.
552 
553  \param rescaleFactorY Scale factor to be applied on the loaded data.
554 
555  \param rasterInterpMethod The interpolation used when loading the input raster.
556 
557  \param maxMemPercentUsage The maximum amount (percent) of memory to use for the loaded data [0,100].
558 
559  \param loadedRasterData The loaded raster data.
560 
561  \param loadedMaskRasterData The loaded mask raster data.
562 
563  \return true if ok, false on errors.
564  */
565  static bool loadRasterData(
566  te::rst::Raster const* rasterPtr,
567  const std::vector< unsigned int >& rasterBands,
568  te::rst::Raster const* maskRasterPtr,
569  const unsigned int maskRasterBand,
570  const unsigned int rasterTargetAreaLineStart,
571  const unsigned int rasterTargetAreaColStart,
572  const unsigned int rasterTargetAreaWidth,
573  const unsigned int rasterTargetAreaHeight,
574  const double rescaleFactorX,
575  const double rescaleFactorY,
576  const te::rst::Interpolator::Method rasterInterpMethod,
577  const unsigned char maxMemPercentUsage,
578  std::vector< boost::shared_ptr< FloatsMatrix > >& loadedRasterData,
579  UCharsMatrix& loadedMaskRasterData );
580 
581  /*!
582  \brief Moravec interest points locator.
583 
584  \param rasterData The loaded raster data.
585 
586  \param maskRasterDataPtr The loaded mask raster data pointer (or zero if no mask is avaliable).
587 
588  \param moravecWindowWidth Moravec window width.
589 
590  \param maxInterestPoints The maximum number of interest points to find over raster 1.
591 
592  \param enableMultiThread Enable/disable multi-thread.
593 
594  \param interestPoints The found interest points (coords related to rasterData lines/cols).
595 
596  \note InterestPointT::m_feature1 will be sum of differences between the Moravec filter response of each pixel and its neighborhoods (always a positive value).
597 
598  \return true if ok, false on errors.
599  */
600  static bool locateMoravecInterestPoints(
601  const FloatsMatrix& rasterData,
602  UCharsMatrix const* maskRasterDataPtr,
603  const unsigned int moravecWindowWidth,
604  const unsigned int maxInterestPoints,
605  const unsigned int enableMultiThread,
606  InterestPointsSetT& interestPoints );
607 
608  /*!
609  \brief SURF interest points locator.
610 
611  \param integralRasterData Integral image raster data.
612 
613  \param maskRasterDataPtr The loaded mask raster data pointer (or zero if no mask is avaliable).
614 
615  \param interestPoints The found interest points (coords related to rasterData lines/cols).
616 
617  \return true if ok, false on errors.
618 
619  \note InterestPointT::m_feature1 will be sum of differences between the hessian matrix determinant each pixel and its neighborhoods (always a positive value).
620 
621  \note InterestPointT::m_feature2 will be used filter width (pixels).
622 
623  \note InterestPointT::m_feature3 will 1 if the laplacian sign is positive, or zero if negative.
624  */
625  bool locateSurfInterestPoints(
626  const FloatsMatrix& integralRasterData,
627  UCharsMatrix const* maskRasterDataPtr,
628  InterestPointsSetT& interestPoints ) const;
629 
630  /*!
631  \brief Movavec locator thread entry.
632 
633  \param paramsPtr A pointer to the thread parameters.
634  */
635  static void locateMoravecInterestPointsThreadEntry(MoravecLocatorThreadParams* paramsPtr);
636 
637  /*!
638  \brief Surf locator thread entry.
639 
640  \param paramsPtr A pointer to the thread parameters.
641  */
642  static void locateSurfInterestPointsThreadEntry(SurfLocatorThreadParams* paramsPtr);
643 
644  /*!
645  \brief RoolUp a buffer of lines.
646 
647  \param bufferPtr Buffer pointer.
648 
649  \param bufferLinesNumber Buffer lines number.
650  */
651  template< typename BufferElementT >
652  static void roolUpBuffer( BufferElementT** bufferPtr,
653  const unsigned int& bufferLinesNumber )
654  {
655  assert( bufferPtr );
656  assert( bufferLinesNumber );
657 
658  unsigned int idx = 0;
659  BufferElementT* auxLinePtr = bufferPtr[ 0 ];
660  const unsigned int lastLineIdx = bufferLinesNumber - 1;
661 
662  for( idx = 0 ; idx < lastLineIdx ; ++idx )
663  {
664  bufferPtr[ idx ] = bufferPtr[ idx + 1 ];
665  }
666 
667  bufferPtr[ lastLineIdx ] = auxLinePtr;
668  }
669 
670  /*!
671  \brief Fill a buffer with zeroes.
672 
673  \param bufferPtr Buffer pointer.
674 
675  \param bufferLinesNumber Buffer lines number.
676 
677  \param bufferColsNumber Buffer columns number.
678  */
679  template< typename BufferElementT >
680  static void zeroFillBuffer( BufferElementT** bufferPtr,
681  const unsigned int& bufferLinesNumber, const unsigned int&
682  bufferColsNumber )
683  {
684  BufferElementT* linePtr = 0;
685  unsigned int col = 0;
686  for( unsigned int line = 0 ; line < bufferLinesNumber ; ++line )
687  {
688  linePtr = bufferPtr[ line ];
689  for( col = 0 ; col < bufferColsNumber ; ++col )
690  {
691  linePtr[ col ] = 0;
692  }
693  }
694  }
695 
696  /*!
697  \brief Moravec interest points locator.
698 
699  \param rasterData The loaded raster data.
700 
701  \param interestPoints The found raster 1 interest points (coords related to rasterData lines/cols).
702 
703  \param tifFileName Tif file name.
704  */
705  static void createTifFromMatrix(
706  const DoublesMatrix& rasterData,
707  const InterestPointsSetT& interestPoints,
708  const std::string& tifFileName );
709 
710  /*!
711  \brief Gaussian Filter.
712 
713  \param inputData The input data.
714 
715  \param outputData The output data.
716 
717  \param iterationsNumber The number of filter iterations.
718 
719  \return true if ok, false on errors.
720  */
721  static bool applyGaussianFilter(
722  const DoublesMatrix& inputData,
723  DoublesMatrix& outputData,
724  const unsigned int iterationsNumber );
725 
726  /*!
727  \brief Mean Filter.
728 
729  \param inputData The input data.
730 
731  \param outputData The output data.
732 
733  \param iterationsNumber The number of filter iterations.
734 
735  \return true if ok, false on errors.
736  */
737  static bool applyMeanFilter(
738  const FloatsMatrix& inputData,
739  FloatsMatrix& outputData,
740  const unsigned int iterationsNumber );
741 
742  /*!
743  \brief Create an integral image.
744 
745  \param inputData The input data.
746 
747  \param outputData The output data.
748 
749  \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.
750 
751  \return true if ok, false on errors.
752  */
753  static bool createIntegralImage(
754  const FloatsMatrix& inputData,
755  FloatsMatrix& outputData );
756 
757  /*!
758  \brief Generate correlation features ( normalized - unit vector ) matrix for the given interes points.
759 
760  \param interestPoints The interest points (coords related to rasterData lines/cols).
761 
762  \param correlationWindowWidth The correlation window width used to correlate points between the images.
763 
764  \param rasterData The loaded raster data.
765 
766  \param features The generated features matrix (one feature per line, one feature per interes point).
767 
768  \param validInteresPoints The valid interest pionts related to each feature inside the features matrix (some interest points may be invalid and are removed).
769 
770  \return true if ok, false on errors.
771  */
772  static bool generateCorrelationFeatures(
773  const InterestPointsSetT& interestPoints,
774  const unsigned int correlationWindowWidth,
775  const FloatsMatrix& rasterData,
776  FloatsMatrix& features,
777  InterestPointsSetT& validInteresPoints );
778 
779  /*!
780  \brief Generate a Surf features matrix for the given interes points.
781 
782  \param interestPoints The interest points (coords related to rasterData lines/cols).
783 
784  \param integralRasterData The integral raster data.
785 
786  \param validInterestPoints The valid interest points.
787 
788  \param features The generated features matrix (one feature per line, one feature per interest point).
789 
790  \return true if ok, false on errors.
791  */
792  static bool generateSurfFeatures(
793  const InterestPointsSetT& interestPoints,
794  const FloatsMatrix& integralRasterData,
795  InterestPointsSetT& validInterestPoints,
796  FloatsMatrix& features );
797 
798  /*!
799  \brief Save the generated features to tif files.
800 
801  \param features The features to be saved.
802 
803  \param validInteresPoints The interest pionts related to each feature inside the features matrix.
804 
805  \param fileNameStart The output file name beginning.
806  */
807  static void features2Tiff(
808  const DoublesMatrix& features,
809  const InterestPointsSetT& interestPoints,
810  const std::string& fileNameBeginning );
811 
812  /*!
813  \brief Match each feature using correlation.
814 
815  \param featuresSet1 Features set 1.
816 
817  \param featuresSet2 Features set 2.
818 
819  \param interestPointsSet1 The interest pionts set 1.
820 
821  \param interestPointsSet2 The interest pionts set 2.
822 
823  \param maxPt1ToPt2PixelDistance Zero (disabled) or the maximum distance (pixels) between a point from set 1 to a point from set 1 (points beyond this distance will not be correlated and will have zero as correlation value).
824 
825  \param enableMultiThread Enable/disable the use of threads.
826 
827  \param minAllowedAbsCorrelation The minimum acceptable absolute correlation value when matching features (when applicable).
828 
829  \param matchedPoints The matched points.
830 
831  \note Each matched point feature value ( MatchedInterestPoint::m_feature ) will be set to the absolute value of the correlation between then.
832  */
833  static bool executeMatchingByCorrelation(
834  const FloatsMatrix& featuresSet1,
835  const FloatsMatrix& featuresSet2,
836  const InterestPointsSetT& interestPointsSet1,
837  const InterestPointsSetT& interestPointsSet2,
838  const unsigned int maxPt1ToPt2PixelDistance,
839  const unsigned int enableMultiThread,
840  const double minAllowedAbsCorrelation,
841  MatchedInterestPointsSetT& matchedPoints );
842 
843  /*!
844  \brief Correlation/Euclidean match thread entry.
845 
846  \param paramsPtr A pointer to the thread parameters.
847  */
848  static void executeMatchingByCorrelationThreadEntry(
849  ExecuteMatchingByCorrelationThreadEntryParams* paramsPtr);
850 
851  /*!
852  \brief Match each feature using eucliean distance.
853 
854  \param featuresSet1 Features set 1.
855 
856  \param featuresSet2 Features set 2.
857 
858  \param interestPointsSet1 The interest pionts set 1.
859 
860  \param interestPointsSet2 The interest pionts set 2.
861 
862  \param maxPt1ToPt2PixelDistance Zero (disabled) or the maximum distance (pixels) between a point from set 1 to a point from set 1 (points beyond this distance will not be correlated and will have zero as correlation value).
863 
864  \param maxEuclideanDist //!< The maximum acceptable euclidean distance when matching features.
865 
866  \param enableMultiThread Enable/disable the use of threads.
867 
868  \param matchedPoints The matched points.
869 
870  \note Each matched point feature value ( MatchedInterestPoint::m_feature ) will be set to the inverse normalized distance in the range (0,1].
871  */
872  static bool executeMatchingByEuclideanDist(
873  const FloatsMatrix& featuresSet1,
874  const FloatsMatrix& featuresSet2,
875  const InterestPointsSetT& interestPointsSet1,
876  const InterestPointsSetT& interestPointsSet2,
877  const unsigned int maxPt1ToPt2PixelDistance,
878  const double maxEuclideanDist,
879  const unsigned int enableMultiThread,
880  MatchedInterestPointsSetT& matchedPoints );
881 
882 
883  /*!
884  \brief Correlation/Euclidean match thread entry.
885 
886  \param paramsPtr A pointer to the thread parameters.
887  */
888  static void executeMatchingByEuclideanDistThreadEntry(
889  ExecuteMatchingByEuclideanDistThreadEntryParams* paramsPtr);
890 
891  /*!
892  \brief Print the given matrix to std::out.
893 
894  \param matrix The given matrix.
895  */
896  template < typename ElementT >
897  static void printMatrix( const te::rp::Matrix< ElementT >& matrix )
898  {
899  std::cout << std::endl;
900 
901  for( unsigned int line = 0 ; line < matrix.getLinesNumber() ; ++line )
902  {
903  std::cout << std::endl << "[";
904 
905  for( unsigned int col = 0 ; col < matrix.getColumnsNumber() ; ++col )
906  {
907  std::cout << " ";
908  std::cout << matrix( line, col );
909  }
910 
911  std::cout << "]";
912  }
913 
914  std::cout << std::endl;
915  }
916 
917  /*!
918  \brief Print the given buffer to std::out.
919 
920  \param buffer Buffer pointer.
921 
922  \param nLines Number of lines.
923 
924  \param nCols Number of columns.
925  */
926  static void printBuffer( double** buffer, const unsigned int nLines,
927  const unsigned int nCols );
928 
929  /*!
930  \brief Return a sum of all pixels inside a box over the given integral image buffer.
931 
932  \param bufferPtr Buffer pointer.
933 
934  \param upperLeftX Box upper left X.
935 
936  \param upperLeftY Box upper left Y.
937 
938  \param lowerRightX Box lower right X.
939 
940  \param lowerRightY Box lower right X.
941  */
942  template< typename BufferType >
943  inline static float getIntegralBoxSum( BufferType& buffer,
944  const unsigned int& upperLeftX, const unsigned int& upperLeftY,
945  const unsigned int& lowerRightX, const unsigned int& lowerRightY )
946  {
947  return buffer[ lowerRightY ][ lowerRightX ]
948  - ( ( upperLeftY ) ? buffer[ upperLeftY - 1 ][ lowerRightX ] : 0 )
949  - ( ( upperLeftX ) ? buffer[ lowerRightY ][ upperLeftX - 1 ] : 0 )
950  + ( ( ( upperLeftX != 0 ) && ( upperLeftY != 0 ) ) ? buffer[ upperLeftY - 1 ][ upperLeftX - 1 ] : 0 );
951  }
952 
953  /*!
954  \brief Return a SURF box filter Dxx derivative centered over the given position from the given integral image buffer.
955 
956  \param bufferPtr Buffer pointer.
957 
958  \param centerX Center X.
959 
960  \param centerY Center Y.
961 
962  \param lobeWidth Filter lobe width.
963 
964  \param lobeRadius Filter lobe radius.
965  */
966  inline static float getSurfDyyDerivative( float** bufferPtr,
967  const unsigned int& centerX, const unsigned int& centerY,
968  const unsigned int& lobeWidth, const unsigned int& lobeRadius )
969  {
970  return
971  getIntegralBoxSum(
972  bufferPtr,
973  ( centerX + 1 - lobeWidth ),
974  ( centerY - lobeWidth - lobeRadius ),
975  ( centerX + lobeWidth - 1 ),
976  ( centerY + lobeWidth + lobeRadius ) )
977  - ( 3.0f *
978  getIntegralBoxSum(
979  bufferPtr,
980  ( centerX + 1 - lobeWidth ),
981  ( centerY - lobeRadius ),
982  ( centerX + lobeWidth - 1 ),
983  ( centerY + lobeRadius ) ) );
984  };
985 
986  /*!
987  \brief Return a SURF box filter Dyy derivative centered over the given position from the given integral image buffer.
988 
989  \param bufferPtr Buffer pointer.
990 
991  \param centerX Center X.
992 
993  \param centerY Center Y.
994 
995  \param lobeWidth Filter lobe width.
996 
997  \param lobeRadius Filter lobe radius.
998  */
999  inline static float getSurfDxxDerivative( float** bufferPtr,
1000  const unsigned int& centerX, const unsigned int& centerY,
1001  const unsigned int& lobeWidth, const unsigned int& lobeRadius )
1002  {
1003  return
1004  getIntegralBoxSum(
1005  bufferPtr,
1006  ( centerX - lobeWidth - lobeRadius ),
1007  ( centerY + 1 - lobeWidth ),
1008  ( centerX + lobeWidth + lobeRadius ),
1009  ( centerY + lobeWidth - 1 ) )
1010  - 3.0f *
1011  getIntegralBoxSum(
1012  bufferPtr,
1013  ( centerX - lobeRadius ),
1014  ( centerY + 1 - lobeWidth ),
1015  ( centerX + lobeRadius ),
1016  ( centerY + lobeWidth - 1 ) );
1017  };
1018 
1019  /*!
1020  \brief Return a SURF box filter Dxy derivative centered over the given position from the given integral image buffer.
1021 
1022  \param bufferPtr Buffer pointer.
1023 
1024  \param centerX Center X.
1025 
1026  \param centerY Center Y.
1027 
1028  \param lobeWidth Filter lobe width.
1029  */
1030  inline static float getSurfDxyDerivative( float** bufferPtr,
1031  const unsigned int& centerX, const unsigned int& centerY,
1032  const unsigned int& lobeWidth )
1033  {
1034  return
1035  // upper-left filter lobe
1036  getIntegralBoxSum(
1037  bufferPtr,
1038  ( centerX - lobeWidth ),
1039  ( centerY - lobeWidth ),
1040  ( centerX - 1 ),
1041  ( centerY - 1 ) )
1042  +
1043  // lower-right filter lobe
1044  getIntegralBoxSum(
1045  bufferPtr,
1046  ( centerX + 1 ),
1047  ( centerY + 1 ),
1048  ( centerX + lobeWidth ),
1049  ( centerY + lobeWidth ) )
1050  -
1051  // upper-right filter lobe
1052  getIntegralBoxSum(
1053  bufferPtr,
1054  ( centerX + 1 ),
1055  ( centerY - lobeWidth ),
1056  ( centerX + lobeWidth ),
1057  ( centerY - 1 ) )
1058  -
1059  // lower-left filter lobe
1060  getIntegralBoxSum(
1061  bufferPtr,
1062  ( centerX - lobeWidth ),
1063  ( centerY + 1 ),
1064  ( centerX - 1 ),
1065  ( centerY + lobeWidth ) );
1066  };
1067 
1068  /*!
1069  \brief Return a Haar X intesity vector for the window centered at the given point.
1070 
1071  \param buffer Integral image buffer.
1072 
1073  \param centerX Center X.
1074 
1075  \param centerY Center Y.
1076 
1077  \param radius Window radius.
1078  */
1079  template< typename BufferType >
1080  inline static float getHaarXVectorIntensity( BufferType& buffer,
1081  const unsigned int& centerX, const unsigned int& centerY,
1082  const unsigned int& radius )
1083  {
1084  return
1085  getIntegralBoxSum(
1086  buffer,
1087  ( centerX + 1 ),
1088  ( centerY - radius ),
1089  ( centerX + radius ),
1090  ( centerY + radius ) )
1091  -
1092  getIntegralBoxSum(
1093  buffer,
1094  ( centerX - radius ),
1095  ( centerY - radius ),
1096  ( centerX - 1 ),
1097  ( centerY + radius ) );
1098  }
1099 
1100  /*!
1101  \brief Return a Haar Y intesity vector for the window centered at the given point.
1102 
1103  \param buffer Integral image buffer.
1104 
1105  \param centerX Center X.
1106 
1107  \param centerY Center Y.
1108 
1109  \param radius Window radius.
1110  */
1111  template< typename BufferType >
1112  inline static float getHaarYVectorIntensity( BufferType& buffer,
1113  const unsigned int& centerX, const unsigned int& centerY,
1114  const unsigned int& radius )
1115  {
1116  return
1117  getIntegralBoxSum(
1118  buffer,
1119  ( centerX - radius ),
1120  ( centerY - radius ),
1121  ( centerX + radius ),
1122  ( centerY - 1 ) )
1123  -
1124  getIntegralBoxSum(
1125  buffer,
1126  ( centerX - radius ),
1127  ( centerY + 1 ),
1128  ( centerX + radius ),
1129  ( centerY + radius ) );
1130  }
1131 
1132  /*!
1133  \brief Return the surf octave filter step size (width).
1134 
1135  \param octaveIndex Octave index (starting from zero).
1136  */
1137  inline static unsigned int getSurfOctaveFilterStepSize( const unsigned int& octaveIndex )
1138  {
1139  return (unsigned int)std::pow( 2.0, (double)(octaveIndex + 1) );
1140  };
1141 
1142  /*!
1143  \brief Return the surf octave base filter size (width).
1144 
1145  \param octaveIndex Octave index (starting from zero).
1146  */
1147  inline static unsigned int getSurfOctaveBaseFilterSize( const unsigned int& octaveIndex )
1148  {
1149  return 3 + ( 3 * getSurfOctaveFilterStepSize( octaveIndex ) );
1150  };
1151 
1152  /*!
1153  \brief Return the surf octave filter size (width).
1154 
1155  \param octaveIndex Octave index (starting from zero).
1156 
1157  \param scaleIndex Scale index (starting from zero).
1158  */
1159  inline static unsigned int getSurfFilterSize( const unsigned int& octaveIndex,
1160  const unsigned int& scaleIndex )
1161  {
1162  return getSurfOctaveBaseFilterSize( octaveIndex ) +
1163  ( 3 * ( getSurfOctaveFilterStepSize( octaveIndex ) * scaleIndex ) );
1164  };
1165 
1166  };
1167 
1168  } // end namespace rp
1169 } // end namespace te
1170 
1171 #endif
1172 
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 imag...
The parameters passed to the matchCorrelationEuclideanThreadEntry method.
static unsigned int getSurfOctaveFilterStepSize(const unsigned int &octaveIndex)
Return the surf octave filter step size (width).
std::vector< te::gm::GTParameters::TiePoint > m_tiePoints
The generated tie-pionts (te::gm::GTParameters::TiePoint::first are raster 1 line/column indexes...
double m_geomTransfMaxError
The maximum allowed transformation error (pixel units, default:2).
bool m_enableGeometryFilter
Enable/disable the geometry filter/outliers remotion (default:true).
static unsigned int getSurfOctaveBaseFilterSize(const unsigned int &octaveIndex)
Return the surf octave base filter size (width).
bool m_enableProgress
Enable/Disable the progress interface (default:false).
InterestPointT(const InterestPointT &other)
boost::mutex * m_rastaDataAccessMutexPtr
A pointer to a valid mutex to controle raster data access.
double m_pixelSizeXRelation
The pixel resolution relation m_pixelSizeXRelation = raster1_pixel_res_x / raster2_pixel_res_x (defau...
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
unsigned int m_moravecGaussianFilterIterations
The number of noise Gaussin iterations, when applicable (used to remove image noise, zero will disable the Gaussian Filter, default:1).
std::multiset< InterestPointT > InterestPointsSetT
double m_surfMaxNormEuclideanDist
The maximum acceptable euclidean distance when matching features (when applicable), default:0.5, valid range: [0,1].
std::list< InterestPointT > InterestPointsListT
unsigned int m_maxPt1ToPt2Distance
Zero (disabled) or the maximum distance between a point from set 1 to a point from set 1 (points beyo...
te::rst::Raster const * m_inRaster2Ptr
Input raster 2.
This class can be used to inform the progress of a task.
Definition: TaskProgress.h:53
TiePointsLocator input parameters.
Raster Processing algorithm output parameters base interface.
boost::mutex * m_interestPointsAccessMutexPtr
A pointer to a valid mutex to control the output interest points container access.
unsigned int m_raster1TargetAreaLineStart
The first line of the raster 1 target area to process (default:0 - The entire raster will be consider...
static void zeroFillBuffer(BufferElementT **bufferPtr, const unsigned int &bufferLinesNumber, const unsigned int &bufferColsNumber)
Fill a buffer with zeroes.
unsigned int m_maxRasterLinesBlockMaxSize
The maximum lines number of each raster block to process.
unsigned int m_maxInterestPointsPerRasterLinesBlock
The maximum number of points to find for each raster lines block.
unsigned int m_octavesNumber
The number of octaves to generate (minimum:1).
unsigned int m_scalesNumber
Thread return value pointer.
bool operator<(const InterestPointT &other) const
boost::mutex * m_rastaDataAccessMutexPtr
A pointer to a valid mutex to controle raster data access.
double m_moravecMinAbsCorrelation
The minimum acceptable absolute correlation value when matching features (when applicable), default:0.5, valid range: [0,1].
unsigned int m_raster2TargetAreaWidth
The raster 2 target area width (default:0 - The entire raster will be considered).
double m_rastersRescaleFactor
Global rescale factor to apply to all input rasters (default:1, valid range: non-zero positive values...
unsigned int m_raster2TargetAreaLineStart
The first line of the raster 2 target area to process (default:0 - The entire raster will be consider...
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 imag...
static void printMatrix(const te::rp::Matrix< ElementT > &matrix)
Print the given matrix to std::out.
unsigned int m_moravecCorrelationWindowWidth
The correlation window width used to correlate points between the images (minimum 3...
Raster Processing algorithm base interface.
Definition: Algorithm.h:41
std::vector< unsigned int > m_inRaster2Bands
Bands to be used from the input raster 2.
unsigned int * m_nextRasterLinesBlockToProcessValuePtr
A pointer to a valid counter to control the blocks processing sequence.
MatchedInterestPointsT(const MatchedInterestPointsT &other)
unsigned int m_moravecWindowWidth
The Moravec window width used to locate canditate tie-points (minimum 3, default: 5 )...
te::rst::Raster const * m_inRaster1Ptr
Input raster 1.
TiePointsLocator::InputParameters m_inputParameters
TiePointsLocator input execution parameters.
unsigned int m_surfScalesNumber
The number of sub-sampling scales to generate, when applicable (default:4, minimum:3).
unsigned int m_maxTiePoints
The maximum number of tie-points to generate (default=0 - Automatically found).
std::auto_ptr< te::gm::GeometricTransformation > m_transformationPtr
The generated geometric transformation with the base mininum required tie-points set ( depending on t...
const MatchedInterestPointsT & operator=(const MatchedInterestPointsT &other)
An abstract class for raster data strucutures.
Definition: Raster.h:71
unsigned int m_maxPt1ToPt2Distance
Zero (disabled) or the maximum distance between a point from set 1 to a point from set 1 (points beyo...
std::multiset< MatchedInterestPointsT > MatchedInterestPointsSetT
unsigned int getColumnsNumber() const
The number of current matrix columns.
Definition: Matrix.h:678
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.
MatchedInterestPointsT(const InterestPointT &point1, const InterestPointT &point2, const float &feature)
static unsigned int getSurfFilterSize(const unsigned int &octaveIndex, const unsigned int &scaleIndex)
Return the surf octave filter size (width).
unsigned int * m_nextRasterLinesBlockToProcessValuePtr
A pointer to a valid counter to control the blocks processing sequence.
std::string m_geomTransfName
The name of the geometric transformation used to ensure tie-points consistency (see each te::gm::GTFa...
The parameters passed to the executeMatchingByEuclideanDistThreadEntry method.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:111
InterestPointsSetT * m_interestPointsPtr
A pointer to a valid interest points container.
Raster Processing algorithm base interface class.
unsigned int m_maxInterestPointsPerRasterLinesBlock
The maximum number of points to find for each raster lines block for each scale.
unsigned int m_raster1TargetAreaWidth
The raster 1 target area width (default:0 - The entire raster will be considered).
Generic template matrix.
TiePointsLocator output parameters.
unsigned int m_raster1TargetAreaColStart
The first column of the raster 2 target area to process (default:0 - The entire raster will be consid...
double m_pixelSizeYRelation
The pixel resolution relation m_pixelSizeYRelation = raster1_pixel_res_y / raster2_pixel_res_y (defau...
unsigned int m_raster2TargetAreaColStart
The first column of the raster 2 target area to process (default:0 - The entire raster will be consid...
float m_feature3
Interest point feature 3 value.
boost::mutex * m_interestPointsAccessMutexPtr
A pointer to a valid mutex to control the output interest points container access.
Tie points locator.
bool m_isInitialized
Tells if this instance is initialized.
float m_feature2
Interest point feature 2 value.
Method
Allowed interpolation methods.
Definition: Interpolator.h:61
bool operator<(const MatchedInterestPointsT &other) const
InterestPointsSetT * m_interestPointsPtr
A pointer to a valid interest points container.
UCharsMatrix const * m_maskRasterDataPtr
The loaded mask raster data pointer (or zero if no mask is avaliable).
float m_feature1
Interest point feature 1 value.
A generic template matrix.
Definition: Matrix.h:51
unsigned int m_moravecWindowWidth
Thread return value pointer.
Raster Processing algorithm input parameters base interface.
te::rst::Raster const * m_inMaskRaster2Ptr
Optional one band input mask raster 2 (tie-points will not be generated inside mask image areas marke...
FloatsMatrix const * m_rasterDataPtr
The loaded raster data.
unsigned int m_maxR1ToR2Offset
The maximum offset (pixels units) between a raster 1 point end the respective raster 2 point (default...
double m_geometryFilterAssurance
Geometry assurance (the error-free selection percent assurance) - valid range (0-1) - default:0...
UCharsMatrix const * m_maskRasterDataPtr
The loaded mask raster data pointer (or zero if no mask is avaliable).
bool m_enableMultiThread
Enable/Disable the use of multi-threads (default:true).
unsigned int m_maxRasterLinesBlockMaxSize
The maximum lines number of each raster block to process.
std::vector< unsigned int > m_inRaster1Bands
Bands to be used from the input raster 1.
unsigned int m_surfOctavesNumber
The number of octaves to generate, when applicable (default: 3, minimum:1).
unsigned int m_raster1TargetAreaHeight
The raster 1 target area height (default:0 - The entire raster will be considered).
static void roolUpBuffer(BufferElementT **bufferPtr, const unsigned int &bufferLinesNumber)
RoolUp a buffer of lines.
unsigned int getLinesNumber() const
The number of current matrix lines.
Definition: Matrix.h:671
InteresPointsLocationStrategyType m_interesPointsLocationStrategy
The strategy used to locate interest points (default:SurfStrategyT).
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 imag...
FloatsMatrix const * m_integralRasterDataPtr
The integral image raster data.
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.
unsigned int m_raster2TargetAreaHeight
The raster 2 target area height (default:0 - The entire raster will be considered).
const InterestPointT & operator=(const InterestPointT &other)
The parameters passed to the surfLocatorThreadEntry method.
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.
te::rst::Raster const * m_inMaskRaster1Ptr
Optional one band input mask raster 1 (tie-points will not be generated inside mask image areas marke...
The parameters passed to the moravecLocatorThreadEntry method.