21 #ifndef otbHarrisImageFilter_hxx
22 #define otbHarrisImageFilter_hxx
32 template <
class TInputImage,
class TOutputImage>
39 m_HessianFilter = HessianFilterType::New();
40 m_GaussianFilter0 = GaussianFilterType::New();
41 m_GaussianFilter1 = GaussianFilterType::New();
42 m_HessianToScalarFilter = HessianToScalarFilterType::New();
43 m_MultiplyScalarFilter = MultiplyScalarFilterType::New();
46 template <
class TInputImage,
class TOutputImage>
49 m_HessianFilter->SetInput(this->GetInput());
50 m_HessianFilter->SetSigma(this->m_SigmaD);
51 m_HessianFilter->SetNormalizeAcrossScale(
false);
53 m_GaussianFilter0->SetInput(m_HessianFilter->GetOutput());
54 m_GaussianFilter0->SetSigma(this->m_SigmaI);
55 m_GaussianFilter0->SetOrder(GaussianFilterType::ZeroOrder);
56 m_GaussianFilter0->SetNormalizeAcrossScale(
false);
58 m_GaussianFilter1->SetInput(m_GaussianFilter0->GetOutput());
59 m_GaussianFilter1->SetSigma(this->m_SigmaI);
60 m_GaussianFilter1->SetOrder(GaussianFilterType::ZeroOrder);
61 m_GaussianFilter1->SetNormalizeAcrossScale(
false);
62 m_GaussianFilter1->SetDirection(1);
64 m_HessianToScalarFilter->SetInput(m_GaussianFilter1->GetOutput());
65 m_HessianToScalarFilter->SetAlpha(this->m_Alpha);
67 m_MultiplyScalarFilter->SetInput(m_HessianToScalarFilter->GetOutput());
68 m_MultiplyScalarFilter->SetCoef(std::pow(m_SigmaD, 4.0));
70 m_MultiplyScalarFilter->GraftOutput(this->GetOutput());
71 m_MultiplyScalarFilter->Update();
72 this->GraftOutput(m_MultiplyScalarFilter->GetOutput());
78 template <
class TInputImage,
class TOutput>
81 Superclass::PrintSelf(os, indent);
82 os << indent <<
"Sigma_D : " << this->m_SigmaD << std::endl;
83 os << indent <<
"Sigma_I : " << this->m_SigmaI << std::endl;
84 os << indent <<
"Alpha : " << this->m_Alpha << std::endl;