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
Julien Cabieces
otb
Commits
be7d3eba
Commit
be7d3eba
authored
6 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
COMP: Missing refactoring in examples
parent
5ea81d80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/Simulation/LAIFromNDVIImageTransform.cxx
+6
-8
6 additions, 8 deletions
Examples/Simulation/LAIFromNDVIImageTransform.cxx
Modules/Detection/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h
+9
-8
9 additions, 8 deletions
...tion/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h
with
15 additions
and
16 deletions
Examples/Simulation/LAIFromNDVIImageTransform.cxx
+
6
−
8
View file @
be7d3eba
...
...
@@ -35,11 +35,9 @@
// Let's look at the minimal code required to use this algorithm. First, the
// following headers must be included.
#include
"otbMultiChannelRAndNIRIndexImageFilter.h"
#include
"otbImage.h"
#include
"otbImageFileWriter.h"
#include
"itkUnaryFunctorImageFilter.h"
#include
"otbVegetationIndicesFunctor.h"
#include
"otbImage.h"
#include
"otbVectorImage.h"
#include
"otbImageFileReader.h"
...
...
@@ -63,12 +61,12 @@ int main(int argc, char* argv[])
typedef
otb
::
ImageFileWriter
<
OutputImageType
>
WriterType
;
typedef
otb
::
ImageFileWriter
<
ImageVisuType
>
VisuWriterType
;
typedef
otb
::
ImageFileWriter
<
InputImageType
>
InWriterType
;
// Filter type is a generic \doxygen{
otb}{MultiChannelRAndNIRIndex
ImageFilter} using Formosat2 specific LAI
// Filter type is a generic \doxygen{
itk}{UnaryFunctor
ImageFilter} using Formosat2 specific LAI
// \doxygen{otb}{LAIFromNDVIFormosat2Functor}.
typedef
otb
::
Functor
::
LAIFromNDVIFormosat2Functor
<
InputImageType
::
InternalPixelType
,
InputImageType
::
InternalPixelType
,
OutputImageType
::
PixelType
>
FunctorType
;
typedef
otb
::
MultiChannelRAndNIRIndex
ImageFilter
<
InputImageType
,
OutputImageType
,
FunctorType
>
MultiChannelRAndNIRIndexImageFilterType
;
typedef
itk
::
UnaryFunctor
ImageFilter
<
InputImageType
,
OutputImageType
,
FunctorType
>
MultiChannelRAndNIRIndexImageFilterType
;
// Instantiating object
...
...
@@ -98,8 +96,8 @@ int main(int argc, char* argv[])
//
unsigned
int
redChannel
=
static_cast
<
unsigned
int
>
(
atoi
(
argv
[
5
]));
unsigned
int
nirChannel
=
static_cast
<
unsigned
int
>
(
atoi
(
argv
[
6
]));
filter
->
SetRedIndex
(
redChannel
);
filter
->
SetNIRIndex
(
nirChannel
);
filter
->
GetFunctor
().
SetRedIndex
(
redChannel
);
filter
->
GetFunctor
().
SetNIRIndex
(
nirChannel
);
// The invocation of the \code{Update()} method triggers the
// execution of the pipeline.
...
...
This diff is collapsed.
Click to expand it.
Modules/Detection/UrbanArea/include/otbUrbanAreaDetectionImageFilter.h
+
9
−
8
View file @
be7d3eba
...
...
@@ -23,7 +23,8 @@
#include
"otbImage.h"
#include
"otbWaterIndicesFunctor.h"
#include
"otbMultiChannelRAndGAndNIRIndexImageFilter.h"
#include
"otbVegetationIndicesFunctor.h"
#include
"itkUnaryFunctorImageFilter.h"
#include
"itkBinaryErodeImageFilter.h"
#include
"itkBinaryDilateImageFilter.h"
#include
"itkBinaryBallStructuringElement.h"
...
...
@@ -183,7 +184,7 @@ public:
// NonVegetationNonWaterIndexFilter
typedef
Functor
::
RadiometricNonWaterNonVegetationDetectionFunctor
<
VectorImagePixelType
,
OutputImagePixelType
>
FunctorType
;
typedef
MultiChannelRAndGAndNIRIndex
ImageFilter
<
VectorImageType
,
OutputImageType
,
typedef
itk
::
UnaryFunctor
ImageFilter
<
VectorImageType
,
OutputImageType
,
FunctorType
>
UrbanAreaExtractionFilterType
;
typedef
typename
UrbanAreaExtractionFilterType
::
Pointer
UrbanAreaExtrationFilterPointerType
;
...
...
@@ -215,12 +216,12 @@ public:
typedef
typename
MultiplyImageFilterType
::
Pointer
MultiplyImageFilterPointerType
;
/** Get/Set indices */
void
SetRedIndex
(
int
id
){
m_UrbanAreaExtractionFilter
->
SetRedIndex
(
id
);
}
void
SetGreenIndex
(
int
id
){
m_UrbanAreaExtractionFilter
->
SetGreenIndex
(
id
);
}
void
SetNIRIndex
(
int
id
){
m_UrbanAreaExtractionFilter
->
SetNIRIndex
(
id
);
}
unsigned
int
GetRedIndex
(){
return
m_UrbanAreaExtractionFilter
->
GetRedIndex
();
}
unsigned
int
GetGreenIndex
(){
return
m_UrbanAreaExtractionFilter
->
GetGreenIndex
();
}
unsigned
int
GetNIRIndex
(){
return
m_UrbanAreaExtractionFilter
->
GetNIRIndex
();
}
void
SetRedIndex
(
int
id
){
m_UrbanAreaExtractionFilter
->
GetFunctor
().
SetRedIndex
(
id
);
}
void
SetGreenIndex
(
int
id
){
m_UrbanAreaExtractionFilter
->
GetFunctor
().
SetGreenIndex
(
id
);
}
void
SetNIRIndex
(
int
id
){
m_UrbanAreaExtractionFilter
->
GetFunctor
().
SetNIRIndex
(
id
);
}
unsigned
int
GetRedIndex
(){
return
m_UrbanAreaExtractionFilter
->
GetFunctor
().
GetRedIndex
();
}
unsigned
int
GetGreenIndex
(){
return
m_UrbanAreaExtractionFilter
->
GetFunctor
().
GetGreenIndex
();
}
unsigned
int
GetNIRIndex
(){
return
m_UrbanAreaExtractionFilter
->
GetFunctor
().
GetNIRIndex
();
}
/** Get/Set threshold values */
itkGetMacro
(
ThresholdValue
,
double
);
itkSetMacro
(
ThresholdValue
,
double
);
...
...
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