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
33491566
Commit
33491566
authored
13 years ago
by
OTB Bot
Browse files
Options
Downloads
Patches
Plain Diff
STYLE
parent
7baa9364
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Utils/otbConvert.cxx
+8
-8
8 additions, 8 deletions
Utils/otbConvert.cxx
with
8 additions
and
8 deletions
Utils/otbConvert.cxx
+
8
−
8
View file @
33491566
...
@@ -105,13 +105,13 @@ int generic_main_convert(otb::ApplicationOptionsResult* parseResult)
...
@@ -105,13 +105,13 @@ int generic_main_convert(otb::ApplicationOptionsResult* parseResult)
// We need to subsample the input image in order to estimate its
// We need to subsample the input image in order to estimate its
// histogram
// histogram
typedef
otb
::
StreamingShrinkImageFilter
<
InputImageType
,
InputImageType
>
ShrinkFilterType
;
typedef
otb
::
StreamingShrinkImageFilter
<
InputImageType
,
InputImageType
>
ShrinkFilterType
;
typename
ShrinkFilterType
::
Pointer
shrinkFilter
=
ShrinkFilterType
::
New
();
typename
ShrinkFilterType
::
Pointer
shrinkFilter
=
ShrinkFilterType
::
New
();
// Shrink factor is computed so as to load a quicklook of 1000
// Shrink factor is computed so as to load a quicklook of 1000
// pixels square at most
// pixels square at most
typename
InputImageType
::
SizeType
imageSize
=
reader
->
GetOutput
()
->
GetLargestPossibleRegion
().
GetSize
();
typename
InputImageType
::
SizeType
imageSize
=
reader
->
GetOutput
()
->
GetLargestPossibleRegion
().
GetSize
();
unsigned
int
shrinkFactor
=
std
::
max
(
imageSize
[
0
],
imageSize
[
1
])
/
1000
;
unsigned
int
shrinkFactor
=
std
::
max
(
imageSize
[
0
],
imageSize
[
1
])
/
1000
;
std
::
cout
<<
"Shrink factor: "
<<
shrinkFactor
<<
std
::
endl
;
std
::
cout
<<
"Shrink factor: "
<<
shrinkFactor
<<
std
::
endl
;
...
@@ -137,13 +137,13 @@ int generic_main_convert(otb::ApplicationOptionsResult* parseResult)
...
@@ -137,13 +137,13 @@ int generic_main_convert(otb::ApplicationOptionsResult* parseResult)
typedef
itk
::
Statistics
::
ListSample
<
typename
InputImageType
::
PixelType
>
ListSampleType
;
typedef
itk
::
Statistics
::
ListSample
<
typename
InputImageType
::
PixelType
>
ListSampleType
;
typedef
itk
::
Statistics
::
DenseFrequencyContainer
DFContainerType
;
typedef
itk
::
Statistics
::
DenseFrequencyContainer
DFContainerType
;
typedef
otb
::
ListSampleToHistogramListGenerator
<
ListSampleType
,
typename
InputImageType
::
InternalPixelType
,
DFContainerType
>
HistogramsGeneratorType
;
typedef
otb
::
ListSampleToHistogramListGenerator
<
ListSampleType
,
typename
InputImageType
::
InternalPixelType
,
DFContainerType
>
HistogramsGeneratorType
;
itk
::
ImageRegionConstIterator
<
InputImageType
>
it
(
shrinkFilter
->
GetOutput
(),
shrinkFilter
->
GetOutput
()
->
GetLargestPossibleRegion
());
itk
::
ImageRegionConstIterator
<
InputImageType
>
it
(
shrinkFilter
->
GetOutput
(),
shrinkFilter
->
GetOutput
()
->
GetLargestPossibleRegion
());
typename
ListSampleType
::
Pointer
listSample
=
ListSampleType
::
New
();
typename
ListSampleType
::
Pointer
listSample
=
ListSampleType
::
New
();
// Now we generate the list of samples
// Now we generate the list of samples
for
(
it
.
GoToBegin
();
!
it
.
IsAtEnd
();
++
it
)
for
(
it
.
GoToBegin
();
!
it
.
IsAtEnd
();
++
it
)
{
{
listSample
->
PushBack
(
it
.
Get
());
listSample
->
PushBack
(
it
.
Get
());
}
}
...
@@ -156,12 +156,12 @@ int generic_main_convert(otb::ApplicationOptionsResult* parseResult)
...
@@ -156,12 +156,12 @@ int generic_main_convert(otb::ApplicationOptionsResult* parseResult)
histogramsGenerator
->
Update
();
histogramsGenerator
->
Update
();
// And extract the 2% lower and upper quantile
// And extract the 2% lower and upper quantile
typename
InputImageType
::
PixelType
inputMin
(
nbComp
),
inputMax
(
nbComp
);
typename
InputImageType
::
PixelType
inputMin
(
nbComp
),
inputMax
(
nbComp
);
for
(
unsigned
int
i
=
0
;
i
<
nbComp
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
nbComp
;
++
i
)
{
{
inputMin
[
i
]
=
histogramsGenerator
->
GetOutput
()
->
GetNthElement
(
i
)
->
Quantile
(
0
,
0.02
);
inputMin
[
i
]
=
histogramsGenerator
->
GetOutput
()
->
GetNthElement
(
i
)
->
Quantile
(
0
,
0.02
);
inputMax
[
i
]
=
histogramsGenerator
->
GetOutput
()
->
GetNthElement
(
i
)
->
Quantile
(
0
,
0.98
);
inputMax
[
i
]
=
histogramsGenerator
->
GetOutput
()
->
GetNthElement
(
i
)
->
Quantile
(
0
,
0.98
);
}
}
...
...
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