OTB  9.0.0
Orfeo Toolbox
otbKeyPointSetsMatchingFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbKeyPointSetsMatchingFilter_h
22 #define otbKeyPointSetsMatchingFilter_h
23 
24 #include "otbObjectListSource.h"
25 #include "otbLandmark.h"
26 #include "itkEuclideanDistanceMetric.h"
27 
28 namespace otb
29 {
50 template <class TPointSet, class TDistance = itk::Statistics::EuclideanDistanceMetric<typename TPointSet::PixelType>>
52  : public ObjectListSource<ObjectList<Landmark<typename TPointSet::PointType, typename TPointSet::PixelType, double>>>
53 {
54 public:
58  typedef itk::SmartPointer<Self> Pointer;
59  typedef itk::SmartPointer<const Self> ConstPointer;
60 
62  typedef TPointSet PointSetType;
63  typedef typename PointSetType::Pointer PointSetPointerType;
64  typedef typename PointSetType::PointType PointType;
65  typedef typename PointSetType::PixelType PointDataType;
66  typedef typename PointSetType::PointsContainer PointsContainerType;
67  typedef typename PointsContainerType::ConstIterator PointsIteratorType;
68  typedef typename PointSetType::PointDataContainer PointDataContainerType;
69  typedef typename PointDataContainerType::ConstIterator PointDataIteratorType;
70  typedef TDistance DistanceType;
71  typedef typename DistanceType::Pointer DistancePointerType;
76  typedef std::pair<unsigned int, double> NeighborSearchResultType;
77 
79  itkNewMacro(Self);
81 
83  itkBooleanMacro(UseBackMatching);
84  itkSetMacro(UseBackMatching, bool);
85  itkGetMacro(UseBackMatching, bool);
86  itkSetMacro(DistanceThreshold, double);
87  itkGetMacro(DistanceThreshold, double);
88 
90  void SetInput1(const PointSetType* pointset);
92  const PointSetType* GetInput1();
94  void SetInput2(const PointSetType* pointset);
96  const PointSetType* GetInput2();
97 
98 protected:
103  {
104  }
106  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
107 
109  void GenerateData() override;
110 
115  NeighborSearchResultType NearestNeighbor(const PointDataType& data1, const PointSetType* pointset);
116 
117 private:
118  KeyPointSetsMatchingFilter(const Self&) = delete;
119  void operator=(const Self&) = delete;
120 
121  // Find back matches from 2 to 1 to validate them
123 
124  // Distance threshold to decide matching
126 
127  // Distance calculator
129 };
130 
131 } // end namespace otb
132 
133 #ifndef OTB_MANUAL_INSTANTIATION
135 #endif
136 #endif
otb::KeyPointSetsMatchingFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbKeyPointSetsMatchingFilter.h:59
otb::KeyPointSetsMatchingFilter
This class matches two point sets according to their associated data.
Definition: otbKeyPointSetsMatchingFilter.h:51
otb::KeyPointSetsMatchingFilter::m_DistanceCalculator
DistancePointerType m_DistanceCalculator
Definition: otbKeyPointSetsMatchingFilter.h:128
otbObjectListSource.h
otb::KeyPointSetsMatchingFilter::NeighborSearchResultType
std::pair< unsigned int, double > NeighborSearchResultType
Definition: otbKeyPointSetsMatchingFilter.h:76
otb::KeyPointSetsMatchingFilter::PointType
PointSetType::PointType PointType
Definition: otbKeyPointSetsMatchingFilter.h:64
otb::KeyPointSetsMatchingFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbKeyPointSetsMatchingFilter.h:58
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::KeyPointSetsMatchingFilter::PointsIteratorType
PointsContainerType::ConstIterator PointsIteratorType
Definition: otbKeyPointSetsMatchingFilter.h:67
otb::ObjectList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
otb::KeyPointSetsMatchingFilter::PointSetType
TPointSet PointSetType
template typedefs
Definition: otbKeyPointSetsMatchingFilter.h:62
otb::KeyPointSetsMatchingFilter::PointDataIteratorType
PointDataContainerType::ConstIterator PointDataIteratorType
Definition: otbKeyPointSetsMatchingFilter.h:69
otb::KeyPointSetsMatchingFilter::DistanceType
TDistance DistanceType
Definition: otbKeyPointSetsMatchingFilter.h:70
otb::ObjectListSource
Base class for all process objects that output ObjectList data.
Definition: otbObjectListSource.h:47
otb::KeyPointSetsMatchingFilter::~KeyPointSetsMatchingFilter
~KeyPointSetsMatchingFilter() override
Destructor.
Definition: otbKeyPointSetsMatchingFilter.h:102
otb::KeyPointSetsMatchingFilter::LandmarkType
Landmark< typename TPointSet::PointType, typename TPointSet::PixelType, double > LandmarkType
Definition: otbKeyPointSetsMatchingFilter.h:72
otb::KeyPointSetsMatchingFilter::PointDataType
PointSetType::PixelType PointDataType
Definition: otbKeyPointSetsMatchingFilter.h:65
otbKeyPointSetsMatchingFilter.hxx
otb::KeyPointSetsMatchingFilter::Self
KeyPointSetsMatchingFilter Self
standard class typedefs
Definition: otbKeyPointSetsMatchingFilter.h:56
otb::KeyPointSetsMatchingFilter::DistancePointerType
DistanceType::Pointer DistancePointerType
Definition: otbKeyPointSetsMatchingFilter.h:71
otb::KeyPointSetsMatchingFilter::Superclass
ObjectListSource< ObjectList< Landmark< typename TPointSet::PointType, typename TPointSet::PixelType, double > > > Superclass
Definition: otbKeyPointSetsMatchingFilter.h:57
otb::KeyPointSetsMatchingFilter::PointsContainerType
PointSetType::PointsContainer PointsContainerType
Definition: otbKeyPointSetsMatchingFilter.h:66
otb::KeyPointSetsMatchingFilter::PointDataContainerType
PointSetType::PointDataContainer PointDataContainerType
Definition: otbKeyPointSetsMatchingFilter.h:68
otb::KeyPointSetsMatchingFilter::LandmarkListType
ObjectList< LandmarkType > LandmarkListType
Definition: otbKeyPointSetsMatchingFilter.h:74
otb::KeyPointSetsMatchingFilter::LandmarkListPointerType
LandmarkListType::Pointer LandmarkListPointerType
Definition: otbKeyPointSetsMatchingFilter.h:75
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::Landmark
This class represent point and point data binary matching.
Definition: otbLandmark.h:40
otb::KeyPointSetsMatchingFilter::LandmarkPointerType
LandmarkType::Pointer LandmarkPointerType
Definition: otbKeyPointSetsMatchingFilter.h:73
otb::KeyPointSetsMatchingFilter::m_UseBackMatching
bool m_UseBackMatching
Definition: otbKeyPointSetsMatchingFilter.h:122
otb::KeyPointSetsMatchingFilter::m_DistanceThreshold
double m_DistanceThreshold
Definition: otbKeyPointSetsMatchingFilter.h:125
otbLandmark.h
otb::Landmark::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLandmark.h:46
otb::KeyPointSetsMatchingFilter::PointSetPointerType
PointSetType::Pointer PointSetPointerType
Definition: otbKeyPointSetsMatchingFilter.h:63