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
33691e9e
Commit
33691e9e
authored
17 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
Ajout seuillage pour image pretty
parent
e58e6867
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
Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx
+42
-37
42 additions, 37 deletions
...ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx
with
42 additions
and
37 deletions
Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx
+
42
−
37
View file @
33691e9e
...
...
@@ -40,16 +40,19 @@
// \index{otb::VegetationIndex!header}
//
//
// The following example illustrates the use of the otb::MultiChannelRAndBAndNIR
// VegetationIndexImageFilter with the use of the Atmospherically Resistant Vegetation Index (ARVI).
// ARVI is an improved version of the NDVI that is more resistent to the atmospheric effect.
// In addition to the red and NIR channels (used in the NRVI), the ARVI takes advantage of
// the presence of the blue channel to accomplish a self-correction process for the
// atmospheric effect on the red channel. For this, it uses the difference in the radiance
// between the blue and the red channels to correct the radiance in the red channel.
// Let's define $\rho_{NIR}^{*}$, $\rho_{r}^{*}$, $\rho_{b}^{*}$ the normalized radiance (that is to say
// the radiance normalized to reflectance units) of red, blue and NIR channels.
// $\rho_{rb}^{*}$ is defined as
// The following example illustrates the use of the
// otb::MultiChannelRAndBAndNIR VegetationIndexImageFilter with the
// use of the Atmospherically Resistant Vegetation Index (ARVI). ARVI
// is an improved version of the NDVI that is more resistent to the
// atmospheric effect. In addition to the red and NIR channels (used
// in the NDVI), the ARVI takes advantage of the presence of the blue
// channel to accomplish a self-correction process for the atmospheric
// effect on the red channel. For this, it uses the difference in the
// radiance between the blue and the red channels to correct the
// radiance in the red channel. Let's define $\rho_{NIR}^{*}$,
// $\rho_{r}^{*}$, $\rho_{b}^{*}$ the normalized radiances (that is to
// say the radiance normalized to reflectance units) of red, blue and
// NIR channels respectively. $\rho_{rb}^{*}$ is defined as
//
// \begin{equation}
// \rho_{rb}^{*} = \rho_{r}^{*} - \gamma*(\rho_{b}^{*} - \rho_{r}^{*})
...
...
@@ -71,7 +74,7 @@
// For more details, refer to Faufman and Tanr work \cite{ARVI}.
//
// With the \doxygen{otb}{MultiChannelRAndBAndNIRVegetationIndexImageFilter} class the
// input has to be a multi channel
s
image and the user has to specify index channel
// input has to be a multi channel image and the user has to specify index channel
// of the red, blue and NIR channel.
//
// Let's look at the minimal code required to use this algorithm. First, the following header
...
...
@@ -92,6 +95,7 @@
#include
"itkRescaleIntensityImageFilter.h"
#include
"otbVectorRescaleIntensityImageFilter.h"
#include
"otbMultiChannelExtractROI.h"
#include
"itkThresholdImageFilter.h"
int
main
(
int
argc
,
char
*
argv
[]
)
{
...
...
@@ -105,7 +109,7 @@ int main( int argc, char *argv[] )
// Software Guide : BeginLatex
//
// The image types are now defined using pixel types and
particular
// The image types are now defined using pixel types and
// dimension. The input image is defined as an \doxygen{otb}{VectorImage},
// the output is a \doxygen{otb}{Image}.
//
...
...
@@ -125,8 +129,8 @@ int main( int argc, char *argv[] )
// Software Guide : BeginLatex
//
// The ARVI (Atmospherically Resistant Vegetation Index) is
instantiated using
// the image
s
pixel
type
types as template parameters.
// The ARVI (Atmospherically Resistant Vegetation Index) is
//
instantiated using
the image pixel types as template parameters.
//
// Software Guide : EndLatex
...
...
@@ -140,8 +144,10 @@ int main( int argc, char *argv[] )
// Software Guide : BeginLatex
//
// The \doxygen{otb}{MultiChannelRAndBAndNIRVegetationIndexImageFilter} type is instantiated using the images
// types and the ARVI functor as template parameters.
// The
// \doxygen{otb}{MultiChannelRAndBAndNIRVegetationIndexImageFilter}
// type is defined using the image types and the ARVI functor as
// template parameters. We then instantiate the filter itself.
//
// Software Guide : EndLatex
...
...
@@ -150,21 +156,10 @@ int main( int argc, char *argv[] )
<
InputImageType
,
OutputImageType
,
FunctorType
>
MultiChannelRAndBAndNIRVegetationIndexImageFilterType
;
// Software Guide : EndCodeSnippet
// Instantiating object
// Software Guide : BeginLatex
//
// Next the filter is created by invoking the \code{New()} method and
// assigning the result to a \doxygen{itk}{SmartPointer}.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
MultiChannelRAndBAndNIRVegetationIndexImageFilterType
;
MultiChannelRAndBAndNIRVegetationIndexImageFilterType
::
Pointer
filter
=
MultiChannelRAndBAndNIRVegetationIndexImageFilterType
::
New
();
filter
=
MultiChannelRAndBAndNIRVegetationIndexImageFilterType
::
New
();
// Software Guide : EndCodeSnippet
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
...
...
@@ -195,9 +190,10 @@ int main( int argc, char *argv[] )
// Software Guide : BeginLatex
//
// The $\gamma$ parameter is set. The \doxygen{otb}{MultiChannelRAndBAndNIRVegetationIndexImageFilter}
// class set the default value of $\gamma$ at 0.5.
// This parameter is used to reduce the atmospheric effect on a global scale.
// The $\gamma$ parameter is set. The
// \doxygen{otb}{MultiChannelRAndBAndNIRVegetationIndexImageFilter}
// class sets the default value of $\gamma$ to $0.5$. This parameter
// is used to reduce the atmospheric effect on a global scale.
//
// Software Guide : EndLatex
...
...
@@ -208,7 +204,7 @@ int main( int argc, char *argv[] )
// Software Guide : BeginLatex
//
// The filter input is linked to the reader output and
// the filter out
o
ut is linked to the writer input.
// the filter out
p
ut is linked to the writer input.
//
// Software Guide : EndLatex
...
...
@@ -277,10 +273,18 @@ int main( int argc, char *argv[] )
vectPrettyWriter
->
SetInput
(
selecter
->
GetOutput
()
);
typedef
itk
::
ThresholdImageFilter
<
OutputImageType
>
ThresholderType
;
ThresholderType
::
Pointer
thresholder
=
ThresholderType
::
New
();
thresholder
->
SetInput
(
filter
->
GetOutput
()
);
thresholder
->
SetOutsideValue
(
1.0
);
thresholder
->
ThresholdOutside
(
0.0
,
1.0
);
thresholder
->
Update
();
RescalerType
::
Pointer
rescaler
=
RescalerType
::
New
();
WriterPrettyType
::
Pointer
prettyWriter
=
WriterPrettyType
::
New
();
rescaler
->
SetInput
(
filt
er
->
GetOutput
()
);
rescaler
->
SetInput
(
threshold
er
->
GetOutput
()
);
rescaler
->
SetOutputMinimum
(
0
);
rescaler
->
SetOutputMaximum
(
255
);
prettyWriter
->
SetFileName
(
argv
[
4
]
);
...
...
@@ -308,8 +312,9 @@ int main( int argc, char *argv[] )
// Software Guide : BeginLatex
//
// Let's now run this example using as input the image
// \code{IndexVegetation.jpg} (image kindly and free of charge given by the SISA and the CNES)
// and $\gamma$=0.6 provided in the directory \code{Examples/Data}.
// \code{IndexVegetation.hd} (image kindly and free of charge given
// by SISA and CNES) and $\gamma$=0.6 provided in the
// directory \code{Examples/Data}.
//
//
// \begin{figure} \center
...
...
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