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
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
Luc Hermitte
diapotb
Commits
fd9b09de
Commit
fd9b09de
authored
5 years ago
by
Gaëlle USSEGLIO
Browse files
Options
Downloads
Patches
Plain Diff
ENH : New application for rough correlation shifts
parent
ce0a80a3
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/CMakeLists.txt
+5
-0
5 additions, 0 deletions
app/CMakeLists.txt
app/otbSARCorrelationRough.cxx
+151
-0
151 additions, 0 deletions
app/otbSARCorrelationRough.cxx
with
156 additions
and
0 deletions
app/CMakeLists.txt
+
5
−
0
View file @
fd9b09de
...
...
@@ -98,3 +98,8 @@ OTB_CREATE_APPLICATION(NAME SARESD
SOURCES otbSARESD.cxx
LINK_LIBRARIES
${${
otb-module
}
_LIBRARIES
}
)
OTB_CREATE_APPLICATION
(
NAME SARCorrelationRough
SOURCES otbSARCorrelationRough.cxx
LINK_LIBRARIES
${${
otb-module
}
_LIBRARIES
}
)
This diff is collapsed.
Click to expand it.
app/otbSARCorrelationRough.cxx
0 → 100644
+
151
−
0
View file @
fd9b09de
/*
* Copyright (C) 2005-2018 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include
"otbWrapperApplication.h"
#include
"otbWrapperApplicationFactory.h"
#include
"itkFFTNormalizedCorrelationImageFilter.h"
#include
"itkMinimumMaximumImageCalculator.h"
#include
<iostream>
#include
<string>
#include
<fstream>
namespace
otb
{
namespace
Wrapper
{
class
SARCorrelationRough
:
public
Application
{
public:
typedef
SARCorrelationRough
Self
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
itkNewMacro
(
Self
);
itkTypeMacro
(
SARCorrelationRough
,
otb
::
Wrapper
::
Application
);
// Filters
typedef
itk
::
FFTNormalizedCorrelationImageFilter
<
FloatImageType
,
FloatImageType
>
CorFilterType
;
typedef
itk
::
MinimumMaximumImageCalculator
<
FloatImageType
>
MinMaxCalculatorType
;
private:
void
DoInit
()
override
{
SetName
(
"SARCorrelationRough"
);
SetDescription
(
"Computes SAR correlation shift (rough shifts)."
);
SetDocLongDescription
(
"This application comutes rough shifts between two images : "
"shift in range and shift in azimut. "
"The inputs of this application are MultiLooked images (real images)."
);
//Optional descriptors
SetDocLimitations
(
"Only Sentinel 1 products and Cosmo are supported for now."
);
SetDocAuthors
(
"OTB-Team"
);
SetDocSeeAlso
(
" "
);
AddDocTag
(
Tags
::
SAR
);
//Parameter declarations
AddParameter
(
ParameterType_InputImage
,
"inmaster"
,
"Input Master image (real image)"
);
SetParameterDescription
(
"inmaster"
,
"Master Image (real image)."
);
AddParameter
(
ParameterType_InputImage
,
"inslave"
,
"Input Slave image (real image)"
);
SetParameterDescription
(
"inslave"
,
"Slave Image (real image)."
);
AddParameter
(
ParameterType_Int
,
"mlran"
,
"MultiLook factor on distance"
);
SetParameterDescription
(
"mlran"
,
"MultiLook factor on distance."
);
SetDefaultParameterInt
(
"mlran"
,
3
);
SetMinimumParameterIntValue
(
"mlran"
,
1
);
MandatoryOff
(
"mlran"
);
AddParameter
(
ParameterType_Int
,
"mlazi"
,
"MultiLook factor on azimut"
);
SetParameterDescription
(
"mlazi"
,
"MultiLook factor on azimut."
);
SetDefaultParameterInt
(
"mlazi"
,
3
);
SetMinimumParameterIntValue
(
"mlazi"
,
1
);
MandatoryOff
(
"mlazi"
);
// Parameter Output
AddParameter
(
ParameterType_Float
,
"shiftran"
,
"rough shift in range dimension (output of this application)"
);
SetParameterDescription
(
"shiftran"
,
"rough shift in range."
);
SetParameterRole
(
"shiftran"
,
Role_Output
);
SetDefaultParameterFloat
(
"shiftran"
,
0
);
AddParameter
(
ParameterType_Float
,
"shiftazi"
,
"rough shift in azimut dimension (output of this application)"
);
SetParameterDescription
(
"shiftazi"
,
"rough shift in azimut."
);
SetParameterRole
(
"shiftazi"
,
Role_Output
);
SetDefaultParameterFloat
(
"shiftazi"
,
0
);
AddRAMParameter
();
SetDocExampleParameterValue
(
"inmaster"
,
"s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002_ML.tiff"
);
SetDocExampleParameterValue
(
"inslave"
,
"s1b-s4-slc-vv-20160929t014610-20160929t014634-002277-003d71-002_ML.tiff"
);
}
void
DoUpdateParameters
()
override
{
// Nothing to do here : all parameters are independent
}
void
DoExecute
()
override
{
// Get numeric parameters
int
factorML_azi
=
GetParameterInt
(
"mlazi"
);
int
factorML_ran
=
GetParameterInt
(
"mlran"
);
// Log information
otbAppLogINFO
(
<<
"ML Factor on azimut :"
<<
factorML_azi
);
otbAppLogINFO
(
<<
"ML Factor on range : "
<<
factorML_ran
);
// Get master and slave image
FloatImageType
::
Pointer
MasterPtr
=
GetParameterFloatImage
(
"inmaster"
);
FloatImageType
::
Pointer
SlavePtr
=
GetParameterFloatImage
(
"inslave"
);
// Correlation Filter
CorFilterType
::
Pointer
correlationFilter
=
CorFilterType
::
New
();
m_Ref
.
push_back
(
correlationFilter
.
GetPointer
());
correlationFilter
->
SetFixedImage
(
MasterPtr
);
correlationFilter
->
SetMovingImage
(
SlavePtr
);
correlationFilter
->
Update
();
// Min/Max calculator
MinMaxCalculatorType
::
Pointer
minMaxFilter
=
MinMaxCalculatorType
::
New
();
minMaxFilter
->
SetImage
(
correlationFilter
->
GetOutput
());
minMaxFilter
->
ComputeMaximum
();
float
shift_range
=
((
correlationFilter
->
GetOutput
()
->
GetLargestPossibleRegion
().
GetSize
()[
0
]
/
2
)
-
minMaxFilter
->
GetIndexOfMaximum
()[
0
])
*
static_cast
<
float
>
(
factorML_ran
);
float
shift_azimut
=
((
correlationFilter
->
GetOutput
()
->
GetLargestPossibleRegion
().
GetSize
()[
1
]
/
2
)
-
minMaxFilter
->
GetIndexOfMaximum
()[
1
])
*
static_cast
<
float
>
(
factorML_azi
);
// Assigne Outputs
SetParameterFloat
(
"shiftran"
,
shift_range
);
SetParameterFloat
(
"shiftazi"
,
shift_azimut
);
}
// Vector for filters
std
::
vector
<
itk
::
ProcessObject
::
Pointer
>
m_Ref
;
};
}
}
OTB_APPLICATION_EXPORT
(
otb
::
Wrapper
::
SARCorrelationRough
)
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