OTB  9.0.0
Orfeo Toolbox
otbMRFEnergyGaussian.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 
22 #ifndef otbMRFEnergyGaussian_h
23 #define otbMRFEnergyGaussian_h
24 
25 #include "otbMRFEnergy.h"
26 
27 #include "otbMath.h"
28 
29 namespace otb
30 {
51 template <class TInput1, class TInput2>
52 class ITK_EXPORT MRFEnergyGaussian : public MRFEnergy<TInput1, TInput2>
53 {
54 public:
57  typedef itk::SmartPointer<Self> Pointer;
58  typedef itk::SmartPointer<const Self> ConstPointer;
59 
60  typedef TInput1 InputImageType;
61  typedef TInput2 LabelledImageType;
62  typedef typename InputImageType::PixelType InputImagePixelType;
63  typedef typename LabelledImageType::PixelType LabelledImagePixelType;
64 
65  typedef itk::Array<double> ParametersType;
66 
67  itkTypeMacro(MRFEnergyGaussian, MRFEnergy);
68 
69  itkNewMacro(Self);
70 
71  double GetSingleValue(const InputImagePixelType& value1, const LabelledImagePixelType& value2) override
72  {
73  return vnl_math_sqr((static_cast<double>(value1)) - (static_cast<double>(value2)));
74  }
75 
76 protected:
77  // The constructor and destructor.
79  {
80  this->m_NumberOfParameters = 0;
81  this->m_Parameters.SetSize(this->m_NumberOfParameters);
82  };
83  ~MRFEnergyGaussian() override
84  {
85  }
86 };
87 }
88 
89 #endif
otb::MRFEnergyGaussian::ParametersType
itk::Array< double > ParametersType
Definition: otbMRFEnergyGaussian.h:65
otb::MRFEnergyGaussian::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbMRFEnergyGaussian.h:62
otb::MRFEnergyGaussian::~MRFEnergyGaussian
~MRFEnergyGaussian() override
Definition: otbMRFEnergyGaussian.h:83
otbMath.h
otb::MRFEnergyGaussian::InputImageType
TInput1 InputImageType
Definition: otbMRFEnergyGaussian.h:60
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::MRFEnergyGaussian::Superclass
MRFEnergy< TInput1, TInput2 > Superclass
Definition: otbMRFEnergyGaussian.h:56
otbMRFEnergy.h
otb::MRFEnergyGaussian::LabelledImageType
TInput2 LabelledImageType
Definition: otbMRFEnergyGaussian.h:61
otb::MRFEnergyGaussian::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbMRFEnergyGaussian.h:58
otb::MRFEnergyGaussian::LabelledImagePixelType
LabelledImageType::PixelType LabelledImagePixelType
Definition: otbMRFEnergyGaussian.h:63
otb::MRFEnergyGaussian::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMRFEnergyGaussian.h:57
otb::MRFEnergyGaussian
This is the implementation of the Gaussian model for Markov classification.
Definition: otbMRFEnergyGaussian.h:52
otb::MRFEnergy::LabelledImagePixelType
LabelledImageType::PixelType LabelledImagePixelType
Definition: otbMRFEnergy.h:54
otb::MRFEnergy::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbMRFEnergy.h:53
otb::MRFEnergyGaussian::Self
MRFEnergyGaussian Self
Definition: otbMRFEnergyGaussian.h:55
otb::MRFEnergy
This is the base class for energy function used in the MRF framework.
Definition: otbMRFEnergy.h:43
otb::MRFEnergyGaussian::GetSingleValue
double GetSingleValue(const InputImagePixelType &value1, const LabelledImagePixelType &value2) override
Definition: otbMRFEnergyGaussian.h:71
otb::MRFEnergyGaussian::MRFEnergyGaussian
MRFEnergyGaussian()
Definition: otbMRFEnergyGaussian.h:78