Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
01e15a37
Commit
01e15a37
authored
Apr 12, 2017
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFAC: fix SVM classes issues
parent
029a6b28
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
13 deletions
+15
-13
Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.h
...on/ObjectDetection/include/otbObjectDetectionClassifier.h
+3
-0
Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.txx
.../ObjectDetection/include/otbObjectDetectionClassifier.txx
+7
-8
Modules/Learning/Supervised/include/otbLabelMapClassifier.h
Modules/Learning/Supervised/include/otbLabelMapClassifier.h
+1
-1
Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.h
...arning/Supervised/include/otbLibSVMMachineLearningModel.h
+2
-2
Modules/Learning/Supervised/include/otbSVMMarginSampler.txx
Modules/Learning/Supervised/include/otbSVMMarginSampler.txx
+2
-2
No files found.
Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.h
View file @
01e15a37
...
...
@@ -237,6 +237,9 @@ private:
/** Step of the detection grid */
unsigned
int
m_GridStep
;
/** classification model */
ModelPointerType
m_Model
;
};
...
...
Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.txx
View file @
01e15a37
...
...
@@ -36,8 +36,7 @@ PersistentObjectDetectionClassifier<TInputImage, TOutputVectorData, TLabel, TFun
m_NoClassLabel(0),
m_GridStep(10)
{
// Need 2 inputs : a vector image, and a SVMModel
this->SetNumberOfRequiredInputs(2);
this->SetNumberOfRequiredInputs(1);
// Have 2 outputs : the image created by Superclass, a vector data with points
this->SetNumberOfRequiredOutputs(3);
...
...
@@ -86,7 +85,11 @@ void
PersistentObjectDetectionClassifier<TInputImage, TOutputVectorData, TLabel, TFunctionType>
::SetModel(ModelType* model)
{
this->SetNthInput(1, model);
if (model != m_Model)
{
m_Model = model;
this->Modified();
}
}
template <class TInputImage, class TOutputVectorData, class TLabel, class TFunctionType>
...
...
@@ -94,11 +97,7 @@ const typename PersistentObjectDetectionClassifier<TInputImage, TOutputVectorDat
PersistentObjectDetectionClassifier<TInputImage, TOutputVectorData, TLabel, TFunctionType>
::GetModel(void) const
{
if(this->GetNumberOfInputs()<2)
{
return ITK_NULLPTR;
}
return static_cast<const ModelType*>(this->itk::ProcessObject::GetInput(1));
return m_Model;
}
template <class TInputImage, class TOutputVectorData, class TLabel, class TFunctionType>
...
...
Modules/Learning/Supervised/include/otbLabelMapClassifier.h
View file @
01e15a37
...
...
@@ -35,7 +35,7 @@ namespace otb {
* \sa otb::SVMModel
* \sa itk::InPlaceLabelMapFilter
*
* \ingroup OTBS
VMLearning
* \ingroup OTBS
upervised
*/
template
<
class
TInputLabelMap
>
class
ITK_EXPORT
LabelMapClassifier
:
...
...
Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.h
View file @
01e15a37
...
...
@@ -238,9 +238,9 @@ public:
void
SetConfidenceMode
(
unsigned
int
mode
)
{
if
(
m
ode
!=
m_
ConfidenceMode
)
if
(
m
_ConfidenceMode
!=
static_cast
<
ConfidenceMode
>
(
mode
)
)
{
m_ConfidenceMode
=
mode
;
m_ConfidenceMode
=
static_cast
<
ConfidenceMode
>
(
mode
)
;
this
->
m_ConfidenceIndex
=
this
->
HasProbabilities
();
this
->
Modified
();
}
...
...
Modules/Learning/Supervised/include/otbSVMMarginSampler.txx
View file @
01e15a37
...
...
@@ -89,13 +89,13 @@ SVMMarginSampler< TSample, TModel >
while (iter != end && iterO != endO)
{
int i = 0;
typename SVMModelType::InputSampleType modelMeasurement;
typename SVMModelType::InputSampleType modelMeasurement
(numberOfComponentsPerSample)
;
measurements = iter.GetMeasurementVector();
// otbMsgDevMacro( << "Loop on components " << svm_type );
for (i=0; i<numberOfComponentsPerSample; ++i)
{
modelMeasurement
.PushBack(
measurements[i]
)
;
modelMeasurement
[i] =
measurements[i];
}
// Get distances to the hyperplanes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment