Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
577f4c14
Commit
577f4c14
authored
13 years ago
by
Mickael Savinaud
Browse files
Options
Downloads
Patches
Plain Diff
ENH: change variance to standard deviation for classification chain and some style corrections
parent
aa09070f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classification/otbImageSVMClassifier.cxx
+5
-5
5 additions, 5 deletions
Classification/otbImageSVMClassifier.cxx
with
5 additions
and
5 deletions
Classification/otbImageSVMClassifier.cxx
+
5
−
5
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
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment