18 #ifndef __otbSVMPointSetModelEstimator_txx
19 #define __otbSVMPointSetModelEstimator_txx
27 template<
class TInputPointSet,
28 class TTrainingPointSet>
31 typename TTrainingPointSet::PixelType>()
33 this->SetNumberOfRequiredInputs(2);
36 template<
class TInputPointSet,
37 class TTrainingPointSet>
45 template<
class TInputPointSet,
46 class TTrainingPointSet>
51 Superclass::PrintSelf(os, indent);
54 template<
class TInputPo
intSet,
class TTrainingPo
intSet>
62 template<
class TInputPo
intSet,
class TTrainingPo
intSet>
70 template<
class TInputPo
intSet,
class TTrainingPo
intSet>
71 const TInputPointSet *
75 if (this->GetNumberOfInputs() < 1)
82 template<
class TInputPo
intSet,
class TTrainingPo
intSet>
83 const TTrainingPointSet *
87 if (this->GetNumberOfInputs() < 2)
97 template<
class TInputPointSet,
98 class TTrainingPointSet>
105 const TInputPointSet * inputPointSet = this->GetInputPointSet();
106 const TTrainingPointSet * trainingPointSet = this->GetTrainingPointSet();
109 int inputPointSetSize = inputPointSet->GetNumberOfPoints();
110 int trainingPointSetSize = trainingPointSet->GetNumberOfPoints();
113 if (inputPointSetSize != trainingPointSetSize)
117 "Input pointset size is not the same as the training pointset size.",
131 otbMsgDevMacro(<<
" Training nb points " << trainingPointSetSize);
133 unsigned int dataId = 0;
134 while (inIt != inEnd && trIt != trEnd)
136 typename TTrainingPointSet::PixelType label = itk::NumericTraits<typename TTrainingPointSet::PixelType>::Zero;
137 trainingPointSet->GetPointData(dataId, &label);
141 typename TInputPointSet::PixelType value;
142 inputPointSet->GetPointData(dataId, &value);
144 typename Superclass::ModelType::MeasurementType v;
146 typename TInputPointSet::PixelType::iterator pIt = value.begin();
147 typename TInputPointSet::PixelType::iterator pEnd = value.end();