Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diapotb
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
Container Registry
Model registry
Operate
Environments
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
Remote Modules
diapotb
Commits
43884838
Commit
43884838
authored
7 years ago
by
Gaëlle USSEGLIO
Browse files
Options
Downloads
Patches
Plain Diff
Two kinds of Pipeline into AmplitudeEstimation (standard and Strip)
parent
37209e08
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
app/otbSARAmplitudeEstimation.cxx
+44
-6
44 additions, 6 deletions
app/otbSARAmplitudeEstimation.cxx
include/otbSARAmplitudeEstimationImageFilter.txx
+38
-29
38 additions, 29 deletions
include/otbSARAmplitudeEstimationImageFilter.txx
with
82 additions
and
35 deletions
app/otbSARAmplitudeEstimation.cxx
+
44
−
6
View file @
43884838
...
...
@@ -2,6 +2,7 @@
#include
"otbWrapperApplicationFactory.h"
#include
"otbImageFileReader.h"
#include
"otbImageFileWriter.h"
#include
"otbSARAmplitudeEstimationImageFilter.h"
#include
<iostream>
...
...
@@ -24,6 +25,7 @@ public:
// Filters
typedef
otb
::
ImageFileReader
<
ComplexFloatImageType
>
ReaderComplexType
;
typedef
otb
::
ImageFileWriter
<
FloatImageType
>
WriterType
;
typedef
otb
::
ImageFileReader
<
FloatImageType
>
ReaderType
;
typedef
otb
::
SARAmplitudeEstimationImageFilter
<
FloatVectorImageType
,
FloatImageType
,
FloatImageType
,
ComplexFloatImageType
>
FilterType
;
...
...
@@ -46,7 +48,7 @@ private:
AddParameter
(
ParameterType_InputImage
,
"indemproj"
,
"Input vector of DEM projected into SAR geometry"
);
SetParameterDescription
(
"indemproj"
,
"Input vector image for amplitude estimation."
);
AddParameter
(
ParameterType_Input
Imag
e
,
"indem"
,
"Input DEM"
);
AddParameter
(
ParameterType_Input
Filenam
e
,
"indem"
,
"Input DEM"
);
SetParameterDescription
(
"indem"
,
"DEM to extract DEM geometry."
);
AddParameter
(
ParameterType_InputFilename
,
"insar"
,
"Input SAR image"
);
...
...
@@ -55,8 +57,16 @@ private:
AddParameter
(
ParameterType_Float
,
"ingain"
,
"Multiplying gain"
);
SetParameterDescription
(
"ingain"
,
"Multiplying gain to obtain a mean radiometry at 100."
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output amplitude Image"
);
SetParameterDescription
(
"out"
,
"Output amplitude Image."
);
//AddParameter(ParameterType_OutputImage, "out", "Output amplitude Image");
//SetParameterDescription("out","Output amplitude Image.");
AddParameter
(
ParameterType_OutputFilename
,
"out"
,
"Output amplitude Image"
);
SetParameterDescription
(
"out"
,
"Output amplitude Image."
);
AddParameter
(
ParameterType_Int
,
"nblineperstrip"
,
"Number of Lines to execute the Pipeline"
);
SetParameterDescription
(
"nblineperstrip"
,
"Number of Lines to execute the Pipeline"
);
SetDefaultParameterInt
(
"nblineperstrip"
,
0
);
MandatoryOff
(
"nblineperstrip"
);
AddRAMParameter
();
...
...
@@ -93,7 +103,7 @@ void DoExecute()
FloatImageType
::
Pointer
DEMPtr
=
reader_DEM
->
GetOutput
();
reader_DEM
->
UpdateOutputInformation
();
// Get numeric parameters
(
gain
)
// Get numeric parameters
:
gain
double
gain
=
GetParameterFloat
(
"ingain"
);
otbAppLogINFO
(
<<
"Gain : "
<<
gain
);
...
...
@@ -105,9 +115,37 @@ void DoExecute()
filterAmplitudeEstimation
->
SetDEMImagePtr
(
DEMPtr
);
filterAmplitudeEstimation
->
SetGain
(
gain
);
// Define the main pipeline
// Define the main pipeline (two kind of Pipeline : controlled with nbLinesPerStrip or automatic)
// Get numeric parameters : nbLinePerStrip
int
nbLinesPerStrip
=
GetParameterInt
(
"nblineperstrip"
);;
filterAmplitudeEstimation
->
SetInput
(
GetParameterImage
(
"indemproj"
));
SetParameterOutputImage
(
"out"
,
filterAmplitudeEstimation
->
GetOutput
());
// Writer with the mode "strip"
std
::
string
outSARFilename
=
GetParameterString
(
"out"
);
WriterType
::
Pointer
writer
=
WriterType
::
New
();
writer
->
SetFileName
(
outSARFilename
);
writer
->
SetInput
(
filterAmplitudeEstimation
->
GetOutput
());
// Mode Strip with the indication of nbLinesPerStrip to the witer
if
(
nbLinesPerStrip
>
0
)
{
writer
->
SetNumberOfLinesStrippedStreaming
(
nbLinesPerStrip
);
}
//Execute Pipeline
try
{
writer
->
Update
();
}
catch
(
itk
::
ExceptionObject
&
err
)
{
std
::
cerr
<<
"ExceptionObject caught !"
<<
std
::
endl
;
std
::
cerr
<<
err
<<
std
::
endl
;
}
//SetParameterOutputImage("out", filterAmplitudeEstimation->GetOutput());
}
// Vector for filters
std
::
vector
<
itk
::
ProcessObject
::
Pointer
>
m_Ref
;
...
...
This diff is collapsed.
Click to expand it.
include/otbSARAmplitudeEstimationImageFilter.txx
+
38
−
29
View file @
43884838
...
...
@@ -183,7 +183,7 @@ SARAmplitudeEstimationImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR >
// Margin to apply on inverse localisation for the four sides.
int marge =
3
0;
int marge =
10
0;
// Indice for the SAR bloc (determined by the Pipeline)
ImageOutIndexType id[4] ;
...
...
@@ -433,6 +433,7 @@ SARAmplitudeEstimationImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR >
{
return false;
}
}
...
...
@@ -547,7 +548,7 @@ SARAmplitudeEstimationImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR >
// Loop on colunm
for (int k = std::max(firstCol_into_outputRegion
, col1
); k<= std::min(col2, nbCol_into_outputRegion); k++)
for (int k = std::max(
col1,
firstCol_into_outputRegion); k<= std::min(col2, nbCol_into_outputRegion); k++)
{
a = (cS - k) / dc;
b = 1.0 - a;
...
...
@@ -682,6 +683,8 @@ SARAmplitudeEstimationImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR >
ImageInPixelType CLZY_InSideUp, CLZY_InSideDown, CLZY_OutSideUp, CLZY_OutSideDown;
counterMailles = 0;
int marge = 100;
// For each Line of input
while ( !InIt_LR.IsAtEnd() && !InIt_LL.IsAtEnd())// && !InIt_UR.IsAtEnd() && !InIt_UL.IsAtEnd())
...
...
@@ -702,37 +705,41 @@ SARAmplitudeEstimationImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR >
{
// Get the sides (L,C) of the current maille
CLZY_UL = InIt_UL.Get();
CLZY_UR = InIt_UR.Get();
CLZY_LR = InIt_LR.Get();
CLZY_LL = InIt_LL.Get();
// Check if No Data
if (!(CLZY_UL[0] == -32768 || CLZY_UR[0] == -32768 || CLZY_LR[0] == -32768
|| CLZY_LL[0] == -32768))
{
// Determine if intersection
bool hasIntersection = this->MaillesAndSarLineIntersection(ind_Line, CLZY_UL, CLZY_UR,
CLZY_LR, CLZY_LL,
CLZY_InSideUp, CLZY_InSideDown,
CLZY_OutSideUp, CLZY_OutSideDown);
// Protect Memory access and input access
if (CLZY_UL[1] > ind_Line - marge && CLZY_UL[1] < ind_Line + marge)
{
CLZY_UR = InIt_UR.Get();
CLZY_LR = InIt_LR.Get();
CLZY_LL = InIt_LL.Get();
// Check if No Data
if (!(CLZY_UL[0] == -32768 || CLZY_UR[0] == -32768 || CLZY_LR[0] == -32768
|| CLZY_LL[0] == -32768))
{
// Determine if intersection
bool hasIntersection = this->MaillesAndSarLineIntersection(ind_Line, CLZY_UL, CLZY_UR,
CLZY_LR, CLZY_LL,
CLZY_InSideUp, CLZY_InSideDown,
CLZY_OutSideUp, CLZY_OutSideDown);
// If intersection == true : Retrive the intersected sides (two intersected among
// the four sides of the maille)
if (hasIntersection)
{
// Store the mailles
Mailles_SideInUp_Tab[counterMailles] = CLZY_InSideUp;
Mailles_SideInDown_Tab[counterMailles] = CLZY_InSideDown;
Mailles_SideOutUp_Tab[counterMailles] = CLZY_OutSideUp;
Mailles_SideOutDown_Tab[counterMailles] = CLZY_OutSideDown;
// Increment counter on mailles
++counterMailles ;
}
// If intersection == true : Retrive the intersected sides (two intersected among
// the four sides of the maille)
if (hasIntersection)
{
// Store the mailles
Mailles_SideInUp_Tab[counterMailles] = CLZY_InSideUp;
Mailles_SideInDown_Tab[counterMailles] = CLZY_InSideDown;
Mailles_SideOutUp_Tab[counterMailles] = CLZY_OutSideUp;
Mailles_SideOutDown_Tab[counterMailles] = CLZY_OutSideDown;
// Increment counter on mailles
++counterMailles ;
}
}
}
// Next Column For input
++InIt_UL;
++InIt_UR;
...
...
@@ -759,6 +766,8 @@ SARAmplitudeEstimationImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR >
int counter = 0;
while (!OutIt.IsAtEndOfLine())
{
//ImageOutPixelType out_save = OutIt.Get();
// Affect OutIt
OutIt.Set(outValueTab[counter]);
++counter;
...
...
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