OTB  9.0.0
Orfeo Toolbox
otbHarrisImageToPointSetFilter.hxx
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 otbHarrisImageToPointSetFilter_hxx
22 #define otbHarrisImageToPointSetFilter_hxx
23 
25 
26 namespace otb
27 {
28 
32 template <class TInputImage, class TOutputPointSet>
34 {
35  m_SigmaD = 1.0;
36  m_SigmaI = 1.0;
37  m_Alpha = 1.0;
38 
39  m_LowerThreshold = itk::NumericTraits<InputPixelType>::NonpositiveMin();
40  m_UpperThreshold = itk::NumericTraits<InputPixelType>::max();
41 
42  m_HarrisFilter = HarrisImageFilterType::New();
43  m_ThresholdFilter = ThresholdImageToPointSetType::New();
44 }
45 
46 template <class TInputImage, class TOutputPointSet>
48 {
49 
50  typename OutputPointSetType::Pointer pointList = this->GetOutput();
51 
52  m_HarrisFilter->SetInput(0, this->GetInput(0));
53  m_HarrisFilter->SetSigmaD(m_SigmaD);
54  m_HarrisFilter->SetSigmaI(m_SigmaI);
55  m_HarrisFilter->SetAlpha(m_Alpha);
56 
57  m_ThresholdFilter->SetInput(0, m_HarrisFilter->GetOutput());
58  m_ThresholdFilter->SetLowerThreshold(m_LowerThreshold);
59  m_ThresholdFilter->SetUpperThreshold(m_UpperThreshold);
60 
61  m_ThresholdFilter->SetOutput(pointList);
62  m_ThresholdFilter->Update();
63 }
64 
68 template <class TInputImage, class TOutputPointSet>
69 void HarrisImageToPointSetFilter<TInputImage, TOutputPointSet>::PrintSelf(std::ostream& os, itk::Indent indent) const
70 {
71  Superclass::PrintSelf(os, indent);
72  os << indent << "Sigma_D : " << this->m_SigmaD << std::endl;
73  os << indent << "Sigma_I : " << this->m_SigmaI << std::endl;
74  os << indent << "Alpha : " << this->m_Alpha << std::endl;
75  os << indent << "LowerThreshold : " << this->m_LowerThreshold << std::endl;
76  os << indent << "UpperThreshold : " << this->m_UpperThreshold << std::endl;
77 }
79 
80 } // end namespace otb
81 
82 #endif
otb::HarrisImageToPointSetFilter::GenerateData
void GenerateData() override
Definition: otbHarrisImageToPointSetFilter.hxx:47
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otbHarrisImageToPointSetFilter.h
otb::HarrisImageToPointSetFilter::HarrisImageToPointSetFilter
HarrisImageToPointSetFilter()
Definition: otbHarrisImageToPointSetFilter.hxx:33
otb::HarrisImageToPointSetFilter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbHarrisImageToPointSetFilter.hxx:69