OTB  10.0.0
Orfeo Toolbox
otbKeyPointSetsMatchingFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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:
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
This class matches two point sets according to their associated data.
LandmarkListType::Pointer LandmarkListPointerType
Landmark< typename TPointSet::PointType, typename TPointSet::PixelType, double > LandmarkType
ObjectListSource< ObjectList< Landmark< typename TPointSet::PointType, typename TPointSet::PixelType, double > > > Superclass
itk::SmartPointer< const Self > ConstPointer
void operator=(const Self &)=delete
std::pair< unsigned int, double > NeighborSearchResultType
KeyPointSetsMatchingFilter Self
standard class typedefs
PointSetType::PointsContainer PointsContainerType
KeyPointSetsMatchingFilter(const Self &)=delete
PointSetType::PointDataContainer PointDataContainerType
PointDataContainerType::ConstIterator PointDataIteratorType
PointsContainerType::ConstIterator PointsIteratorType
This class represent point and point data binary matching.
Definition: otbLandmark.h:41
itk::SmartPointer< Self > Pointer
Definition: otbLandmark.h:46
Base class for all process objects that output ObjectList data.
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:41
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.