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
577f4c14
Commit
577f4c14
authored
May 23, 2011
by
Mickael Savinaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: change variance to standard deviation for classification chain and some style corrections
parent
aa09070f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Classification/otbImageSVMClassifier.cxx
Classification/otbImageSVMClassifier.cxx
+5
-5
No files found.
Classification/otbImageSVMClassifier.cxx
View file @
577f4c14
...
...
@@ -55,7 +55,7 @@ int ImageSVMClassifier::Describe(ApplicationDescriptor* descriptor)
"in"
,
1
,
true
,
ApplicationDescriptor
::
InputImage
);
descriptor
->
AddOption
(
"InputImageMask"
,
"A mask associated with the new image to classify"
,
"inm"
,
1
,
false
,
ApplicationDescriptor
::
InputImage
);
descriptor
->
AddOption
(
"ImageStatistics"
,
"a XML file containing mean and
variance
of input images used to train svm model."
,
descriptor
->
AddOption
(
"ImageStatistics"
,
"a XML file containing mean and
standard deviation
of input images used to train svm model."
,
"is"
,
1
,
false
,
ApplicationDescriptor
::
FileName
);
descriptor
->
AddOption
(
"SVMmodel"
,
"Estimated model previously computed"
,
"svm"
,
1
,
true
,
ApplicationDescriptor
::
FileName
);
...
...
@@ -108,7 +108,7 @@ int ImageSVMClassifier::Execute(otb::ApplicationOptionsResult* parseResult)
// Normalize input image (optional)
StatisticsReader
::
Pointer
statisticsReader
=
StatisticsReader
::
New
();
MeasurementType
meanMeasurementVector
;
MeasurementType
variance
MeasurementVector
;
MeasurementType
stddev
MeasurementVector
;
RescalerType
::
Pointer
rescaler
=
RescalerType
::
New
();
//--------------------------
...
...
@@ -122,12 +122,12 @@ int ImageSVMClassifier::Execute(otb::ApplicationOptionsResult* parseResult)
// Load input image statistics
statisticsReader
->
SetFileName
(
parseResult
->
GetParameterString
(
"ImageStatistics"
));
meanMeasurementVector
=
statisticsReader
->
GetStatisticVectorByName
(
"mean"
);
variance
MeasurementVector
=
statisticsReader
->
GetStatisticVectorByName
(
"
variance
"
);
stddev
MeasurementVector
=
statisticsReader
->
GetStatisticVectorByName
(
"
stddev
"
);
std
::
cout
<<
"mean used: "
<<
meanMeasurementVector
<<
std
::
endl
;
std
::
cout
<<
"
variance
used: "
<<
variance
MeasurementVector
<<
std
::
endl
;
std
::
cout
<<
"
standard deviation
used: "
<<
stddev
MeasurementVector
<<
std
::
endl
;
std
::
cout
<<
"Shift and scale of the input image !"
<<
std
::
endl
;
// Rescale vector image
rescaler
->
SetScale
(
variance
MeasurementVector
);
rescaler
->
SetScale
(
stddev
MeasurementVector
);
rescaler
->
SetShift
(
meanMeasurementVector
);
rescaler
->
SetInput
(
reader
->
GetOutput
());
...
...
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