Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
e38ade22
Commit
e38ade22
authored
Apr 19, 2017
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Plain Diff
MRG: Synchronize with branch 'develop'
parents
4eea72f2
e71ddd79
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
1087 additions
and
156 deletions
+1087
-156
CMake/OTBCheckCpp11Keywords.cmake
CMake/OTBCheckCpp11Keywords.cmake
+2
-0
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
+5
-5
Documentation/Cookbook/rst/recipes/improc.rst
Documentation/Cookbook/rst/recipes/improc.rst
+4
-4
Documentation/Cookbook/rst/recipes/pbclassif.rst
Documentation/Cookbook/rst/recipes/pbclassif.rst
+12
-6
Documentation/SoftwareGuide/Latex/ReadWrite.tex
Documentation/SoftwareGuide/Latex/ReadWrite.tex
+42
-2
Modules/Applications/AppSARUtils/CMakeLists.txt
Modules/Applications/AppSARUtils/CMakeLists.txt
+2
-0
Modules/Applications/AppSARUtils/app/CMakeLists.txt
Modules/Applications/AppSARUtils/app/CMakeLists.txt
+9
-0
Modules/Applications/AppSARUtils/app/otbComputeModulusAndPhase.cxx
...pplications/AppSARUtils/app/otbComputeModulusAndPhase.cxx
+132
-0
Modules/Applications/AppSARUtils/otb-module.cmake
Modules/Applications/AppSARUtils/otb-module.cmake
+12
-0
Modules/Applications/AppSARUtils/test/CMakeLists.txt
Modules/Applications/AppSARUtils/test/CMakeLists.txt
+13
-0
Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx
...Applications/AppSegmentation/app/otbLSMSVectorization.cxx
+1
-1
Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
...pplications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
+2
-2
Modules/Core/ImageBase/include/otbImageIOBase.h
Modules/Core/ImageBase/include/otbImageIOBase.h
+6
-1
Modules/Core/ImageBase/src/otbImageIOBase.cxx
Modules/Core/ImageBase/src/otbImageIOBase.cxx
+48
-0
Modules/Filtering/MathParser/src/otbParser.cxx
Modules/Filtering/MathParser/src/otbParser.cxx
+6
-0
Modules/IO/ExtendedFilename/include/otbExtendedFilenameHelper.h
...s/IO/ExtendedFilename/include/otbExtendedFilenameHelper.h
+24
-0
Modules/IO/ExtendedFilename/include/otbExtendedFilenameToReaderOptions.h
...ndedFilename/include/otbExtendedFilenameToReaderOptions.h
+12
-0
Modules/IO/ExtendedFilename/include/otbExtendedFilenameToWriterOptions.h
...ndedFilename/include/otbExtendedFilenameToWriterOptions.h
+4
-0
Modules/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx
...les/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx
+198
-20
Modules/IO/ExtendedFilename/src/otbExtendedFilenameToReaderOptions.cxx
...tendedFilename/src/otbExtendedFilenameToReaderOptions.cxx
+35
-0
Modules/IO/ExtendedFilename/src/otbExtendedFilenameToWriterOptions.cxx
...tendedFilename/src/otbExtendedFilenameToWriterOptions.cxx
+33
-0
Modules/IO/ExtendedFilename/test/CMakeLists.txt
Modules/IO/ExtendedFilename/test/CMakeLists.txt
+11
-1
Modules/IO/ExtendedFilename/test/otbExtendedFilenameToReaderOptionsTest.cxx
...dFilename/test/otbExtendedFilenameToReaderOptionsTest.cxx
+34
-1
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
+17
-1
Modules/IO/ImageIO/include/otbImageFileReader.h
Modules/IO/ImageIO/include/otbImageFileReader.h
+9
-0
Modules/IO/ImageIO/include/otbImageFileReader.txx
Modules/IO/ImageIO/include/otbImageFileReader.txx
+39
-14
Modules/IO/ImageIO/include/otbImageFileWriter.h
Modules/IO/ImageIO/include/otbImageFileWriter.h
+9
-0
Modules/IO/ImageIO/include/otbImageFileWriter.txx
Modules/IO/ImageIO/include/otbImageFileWriter.txx
+40
-3
Modules/IO/ImageIO/test/CMakeLists.txt
Modules/IO/ImageIO/test/CMakeLists.txt
+39
-1
Modules/IO/ImageIO/test/otbImageFileReaderOptBandTest.cxx
Modules/IO/ImageIO/test/otbImageFileReaderOptBandTest.cxx
+77
-0
Modules/IO/ImageIO/test/otbImageFileWriterOptBandTest.cxx
Modules/IO/ImageIO/test/otbImageFileWriterOptBandTest.cxx
+77
-0
Modules/IO/ImageIO/test/otbImageIOTestDriver.cxx
Modules/IO/ImageIO/test/otbImageIOTestDriver.cxx
+2
-0
Modules/Learning/Supervised/test/otbSupervisedTestDriver.cxx
Modules/Learning/Supervised/test/otbSupervisedTestDriver.cxx
+3
-0
Modules/Remote/otb-bv.remote.cmake
Modules/Remote/otb-bv.remote.cmake
+1
-1
Modules/Remote/phenotb.remote.cmake
Modules/Remote/phenotb.remote.cmake
+1
-1
Modules/Remote/temporal-gapfilling.remote.cmake
Modules/Remote/temporal-gapfilling.remote.cmake
+1
-1
Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp
...ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp
+7
-5
Modules/Visualization/Monteverdi/src/main.cxx
Modules/Visualization/Monteverdi/src/main.cxx
+2
-2
Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx
Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx
+2
-2
Modules/Visualization/MonteverdiGui/include/mvdShaderWidget.h
...les/Visualization/MonteverdiGui/include/mvdShaderWidget.h
+8
-0
Modules/Visualization/MonteverdiGui/include/mvdStatusBarWidget.h
.../Visualization/MonteverdiGui/include/mvdStatusBarWidget.h
+8
-0
Modules/Visualization/MonteverdiGui/src/mvdShaderWidget.cxx
Modules/Visualization/MonteverdiGui/src/mvdShaderWidget.cxx
+62
-71
Modules/Visualization/MonteverdiGui/src/mvdStatusBarWidget.cxx
...es/Visualization/MonteverdiGui/src/mvdStatusBarWidget.cxx
+17
-0
Modules/Wrappers/ApplicationEngine/include/otbWrapperChoiceParameter.h
...ers/ApplicationEngine/include/otbWrapperChoiceParameter.h
+4
-3
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
.../Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
+15
-8
No files found.
CMake/OTBCheckCpp11Keywords.cmake
View file @
e38ade22
...
...
@@ -22,6 +22,8 @@ include(CheckCXXSourceCompiles)
set
(
CMAKE_REQUIRED_FLAGS
${
CMAKE_CXX_FLAGS
}
)
unset
(
OTB_HAS_CXX11 CACHE
)
CHECK_CXX_SOURCE_COMPILES
(
"
#ifdef _MSC_VER
#if _MSC_VER <= 1700
...
...
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
View file @
e38ade22
...
...
@@ -149,10 +149,10 @@ def FindLengthOfLargestColumnText(app,paramlist):
else
:
if
colLength
[
0
]
<
len
(
param
):
colLength
[
0
]
=
len
(
param
)
lenpdescr
=
len
(
app
.
GetParameterName
(
param
))
lenpdescr
=
len
(
GenerateParameterType
(
app
,
param
))
if
colLength
[
2
]
<
lenpdescr
:
colLength
[
2
]
=
lenpdescr
lenptype
=
len
(
GenerateParameterType
(
app
,
param
))
lenptype
=
len
(
app
.
GetParameterName
(
param
))
if
colLength
[
1
]
<
lenptype
:
colLength
[
1
]
=
lenptype
return
colLength
...
...
@@ -181,14 +181,14 @@ def MakeText(text, size):
def
GenerateParametersTable
(
app
,
paramlist
):
colLength
=
FindLengthOfLargestColumnText
(
app
,
paramlist
)
output
=
linesep
+
".. [#] Table: Parameters table for "
+
ConvertString
(
app
.
GetDocName
())
+
"."
+
linesep
+
linesep
headerlist
=
[
"Parameter Key"
,
"Parameter
Type"
,
"Parameter Description
"
]
headerlist
=
[
"Parameter Key"
,
"Parameter
Name"
,
"Parameter Type
"
]
for
i
in
xrange
(
len
(
headerlist
)):
colLength
[
i
]
=
len
(
headerlist
[
i
])
if
colLength
[
i
]
<
len
(
headerlist
[
i
])
else
colLength
[
i
]
output
+=
RstTableHeading
(
headerlist
,
colLength
)
for
param
in
paramlist
:
output
+=
MakeText
(
param
,
colLength
[
0
])
output
+=
MakeText
(
GenerateParameterType
(
app
,
param
),
colLength
[
1
])
output
+=
MakeText
(
GenerateParameterType
(
app
,
param
),
colLength
[
2
])
output
+=
MakeText
(
app
.
GetParameterName
(
param
),
colLength
[
1
])
output
+=
MakeText
(
GenerateParameterType
(
app
,
param
),
colLength
[
2
])
output
+=
'|'
+
linesep
output
+=
RstTableHeaderLine
(
headerlist
,
colLength
,
'-'
)
if
app
.
GetParameterType
(
param
)
==
otbApplication
.
ParameterType_Choice
:
...
...
Documentation/Cookbook/rst/recipes/improc.rst
View file @
e38ade22
...
...
@@ -145,9 +145,9 @@ the *MeanShiftSmoothing* application:
::
otbcli_MeanShiftSmoothing -in input_image
otbcli_MeanShiftSmoothing -in input_image
.tif
-fout filtered_range.tif
-foutpos filtered_spat
.tif
-foutpos filtered_spat
ial.tif
-ranger 30
-spatialr 5
-maxiter 10
...
...
@@ -173,7 +173,7 @@ so, the *LSMSSegmentation* will process them by tiles whose dimensions
are defined by the *tilesizex* and *tilesizey* parameters, and by
writing intermediate images to disk, thus keeping the memory consumption
very low throughout the process. The segmentation will group together
adjacent
pixels whose range distance is below the *ranger* parameter and
neighboring
pixels whose range distance is below the *ranger* parameter and
(optionally) spatial distance is below the *spatialr* parameter.
::
...
...
@@ -250,7 +250,7 @@ projection, so does the output GIS file).
::
otbcli_LSMSVectorization -in input_image
otbcli_LSMSVectorization -in input_image
.tif
-inseg segmentation_merged.tif
-out segmentation_merged.shp
-tilesizex 256
...
...
Documentation/Cookbook/rst/recipes/pbclassif.rst
View file @
e38ade22
...
...
@@ -4,10 +4,10 @@ Classification
Pixel
based
classification
--------------------------
Orfeo
ToolBox
ships
with
a
set
of
application
to
perform
supervised
pixel
-
based
image
classification
.
This
framework
allows
to
learn
from
multiple
images
,
and
using
several
machine
learning
method
such
as
SVM
,
Bayes
,
KNN
,
Random
Forests
,
Artificial
Neural
Network
,
and
Orfeo
ToolBox
ships
with
a
set
of
application
to
perform
supervised
or
unsupervised
pixel
-
based
image
classification
.
This
framework
allows
to
learn
from
multiple
images
,
and
using
several
machine
learning
method
such
as
SVM
,
Bayes
,
KNN
,
Random
Forests
,
Artificial
Neural
Network
,
and
others
...(
see
application
help
of
``
TrainImagesClassifier
``
and
``
TrainVectorClassifier
``
for
further
details
about
all
the
available
classifiers
).
Here
is
an
overview
of
the
complete
workflow
:
...
...
@@ -347,8 +347,9 @@ using the ``TrainVectorClassifier`` application.
-feat band_0 band_1 band_2 band_3 band_4 band_5 band_6
The ``-classifier`` parameter allows to choose which machine learning
model algorithm to train. Please refer to the
``TrainVectorClassifier`` application reference documentation.
model algorithm to train. You have the possibility to do the unsupervised
classification,for it, you must to choose the Shark kmeans classifier.
Please refer to the ``TrainVectorClassifier`` application reference documentation.
In case of multiple samples files, you can add them to the ``-io.vd``
parameter (see `Working with several images`_ section).
...
...
@@ -409,6 +410,11 @@ class too, based on the
`ConfusionMatrixCalculator <http://www.orfeo-toolbox.org/doxygen-current/classotb_1_1ConfusionMatrixCalculator.html>`_
class.
If you have made an unsupervised classification, it must be specified
to the ``ConputeConfusionMatrix`` application. In this case, a contingency table
have to be create rather than a confusion matrix. For further details,
see ``format`` parameter in the application help of *ConputeConfusionMatrix*.
::
otbcli_ComputeConfusionMatrix -in labeled_image.tif
...
...
Documentation/SoftwareGuide/Latex/ReadWrite.tex
View file @
e38ade22
...
...
@@ -253,6 +253,26 @@ IMPORTANT: Note that you'll probably need to "quote" the filename.
\item
Select the JPEG2000 sub-resolution image to read
\item
0 by default
\end{itemize}
\item
\begin{verbatim}
&
bands=r1,r2,...,rn
\end{verbatim}
\begin{itemize}
\item
Select a subset of bands from the input image
\item
The syntax is inspired by Python indexing syntax with
bands=r1,r2,r3,...,rn where each ri is a band range that can be :
\begin{itemize}
\item
a single index (1-based) :
\begin{itemize}
\item
$
'
2
'
$
means 2nd band
\item
$
'
-
1
'
$
means last band
\end{itemize}
\item
or a range of bands :
\begin{itemize}
\item
$
'
3
:'
$
means 3rd band until the last one
\item
$
':
-
2
'
$
means the first bands until the second to last
\item
$
'
2
:
4
'
$
means bands 2,3 and 4
\end{itemize}
\end{itemize}
\item
empty by default (all bands are read from the input image)
\end{itemize}
\item
\begin{verbatim}
&
skipcarto=<(bool)true>
\end{verbatim}
\begin{itemize}
\item
Skip the cartographic information
...
...
@@ -339,8 +359,8 @@ IMPORTANT: Note that you'll probably need to "quote" the filename.
\item
The region must be set with 4 unsigned integers (the separator used is
the colon ':'). Values are:
\begin{itemize}
\item
startx: first index on X
\item
starty: first index on Y
\item
startx: first index on X
(starting with 0)
\item
starty: first index on Y
(starting with 0)
\item
sizex: size along X
\item
sizey: size along Y
\end{itemize}
...
...
@@ -349,6 +369,26 @@ IMPORTANT: Note that you'll probably need to "quote" the filename.
itk::Size classes. The origin of the region within the image with which it
is associated is defined by Index
\end{itemize}
\item
\begin{verbatim}
&
bands=r1,r2,...,rn
\end{verbatim}
\begin{itemize}
\item
Select a subset of bands from the output image
\item
The syntax is inspired by Python indexing syntax with
bands=r1,r2,r3,...,rn where each ri is a band range that can be :
\begin{itemize}
\item
a single index (1-based) :
\begin{itemize}
\item
$
'
2
'
$
means 2nd band
\item
$
'
-
1
'
$
means last band
\end{itemize}
\item
or a range of bands :
\begin{itemize}
\item
$
'
3
:'
$
means 3rd band until the last one
\item
$
':
-
2
'
$
means the first bands until the second to last
\item
$
'
2
:
4
'
$
means bands 2,3 and 4
\end{itemize}
\end{itemize}
\item
empty by default (all bands are write from the output image)
\end{itemize}
\end{itemize}
...
...
Modules/Applications/AppSARUtils/CMakeLists.txt
0 → 100644
View file @
e38ade22
project
(
OTBAppSARUtils
)
otb_module_impl
()
Modules/Applications/AppSARUtils/app/CMakeLists.txt
0 → 100644
View file @
e38ade22
set
(
OTBAppSARUtils_LINK_LIBS
${
OTBSARUtils_LIBRARIES
}
${
OTBApplicationEngine_LIBRARIES
}
)
otb_create_application
(
NAME ComputeModulusAndPhase
SOURCES otbComputeModulusAndPhase.cxx
LINK_LIBRARIES
${${
otb-module
}
_LIBRARIES
}
)
Modules/Applications/AppSARUtils/app/otbComputeModulusAndPhase.cxx
0 → 100644
View file @
e38ade22
/*
* Copyright (C) 2005-2017 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 <otbMultiToMonoChannelExtractROI.h>
#include "itkComplexToPhaseImageFilter.h"
#include "itkComplexToModulusImageFilter.h"
#include <itkMacro.h>
namespace
otb
{
// Application class is defined in Wrapper namespace.
namespace
Wrapper
{
/** \class ComputeModulusAndPhase
* \brief ComputeModulusAndPhase is an application that
* computes modulus and phase from a complex SAR image.
*
* \ingroup AppSARUtils
*/
class
ComputeModulusAndPhase
:
public
Application
{
public:
// Class declaration is followed by ITK public types for the class, the superclass and smart pointers.
typedef
ComputeModulusAndPhase
Self
;
typedef
Application
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Standard macro */
itkNewMacro
(
Self
);
itkTypeMacro
(
ComputeModulusAndPhase
,
otb
::
Wrapper
::
Application
);
//typedefs for the application
typedef
otb
::
MultiToMonoChannelExtractROI
<
typename
ComplexFloatVectorImageType
::
InternalPixelType
,
typename
ComplexFloatImageType
::
PixelType
>
ExtractFilterType
;
typedef
itk
::
ComplexToModulusImageFilter
<
ComplexFloatImageType
,
FloatImageType
>
ModulusFilterType
;
typedef
itk
::
ComplexToPhaseImageFilter
<
ComplexFloatImageType
,
FloatImageType
>
PhaseFilterType
;
private:
void
DoInit
()
{
SetName
(
"ComputeModulusAndPhase"
);
SetDescription
(
"This application computes the modulus and the phase of a complex SAR image."
);
SetDocName
(
"Compute Modulus And Phase"
);
SetDocLongDescription
(
"This application computes the modulus and the phase of a "
"complex SAR image. The input shoud be a single band image with "
"complex pixels."
);
SetDocLimitations
(
"None"
);
SetDocAuthors
(
"Alexia Mondot (alexia.mondot@c-s.fr) and Mickael Savinaud (mickael.savinaud@c-s.fr)"
);
SetDocSeeAlso
(
"SARPolarMatrixConvert, SARPolarSynth"
);
AddDocTag
(
Tags
::
SAR
);
// Input images
AddParameter
(
ParameterType_ComplexInputImage
,
"in"
,
"Input Image"
);
SetParameterDescription
(
"in"
,
"Input image (complex single band)"
);
// Outputs
AddParameter
(
ParameterType_OutputImage
,
"modulus"
,
"Modulus"
);
SetParameterDescription
(
"modulus"
,
"Modulus of the input: sqrt(real*real + imag*imag)."
);
AddParameter
(
ParameterType_OutputImage
,
"phase"
,
"Phase"
);
SetParameterDescription
(
"phase"
,
"Phase of the input: atan2(imag, real)."
);
AddRAMParameter
();
// Doc example parameter settings
SetDocExampleParameterValue
(
"in"
,
"monobandComplexFloat.tif"
);
SetDocExampleParameterValue
(
"modulus"
,
"modulus.tif"
);
SetDocExampleParameterValue
(
"phase"
,
"phase.tif"
);
}
// DoUpdateParameters() is called as soon as a parameter value change.
void
DoUpdateParameters
()
{
}
// DoExecute() contains the application core.
void
DoExecute
()
{
m_Modulus
=
ModulusFilterType
::
New
();
m_Phase
=
PhaseFilterType
::
New
();
ComplexFloatVectorImageType
::
Pointer
inImage
=
GetParameterComplexImage
(
"in"
);
if
(
inImage
->
GetNumberOfComponentsPerPixel
()
!=
1
)
{
otbAppLogFATAL
(
"Input must be a single band complex image."
);
}
// Get first band
m_Extract
=
ExtractFilterType
::
New
();
m_Extract
->
SetInput
(
inImage
);
// Compute modulus and phase
m_Modulus
->
SetInput
(
m_Extract
->
GetOutput
());
m_Phase
->
SetInput
(
m_Extract
->
GetOutput
());
SetParameterOutputImage
(
"modulus"
,
m_Modulus
->
GetOutput
()
);
SetParameterOutputImage
(
"phase"
,
m_Phase
->
GetOutput
());
}
ExtractFilterType
::
Pointer
m_Extract
;
ModulusFilterType
::
Pointer
m_Modulus
;
PhaseFilterType
::
Pointer
m_Phase
;
};
}
// namespace Wrapper
}
// namespace otb
OTB_APPLICATION_EXPORT
(
otb
::
Wrapper
::
ComputeModulusAndPhase
)
Modules/Applications/AppSARUtils/otb-module.cmake
0 → 100644
View file @
e38ade22
set
(
DOCUMENTATION
"SAR Utils application."
)
otb_module
(
OTBAppSARUtils
DEPENDS
OTBApplicationEngine
TEST_DEPENDS
OTBTestKernel
OTBCommandLine
DESCRIPTION
"
${
DOCUMENTATION
}
"
)
Modules/Applications/AppSARUtils/test/CMakeLists.txt
0 → 100644
View file @
e38ade22
otb_module_test
()
#----------- ComputeModulusAndPhase TESTS ----------------
otb_test_application
(
NAME apTvUtComputeModulusAndPhase_1inputComplex
APP ComputeModulusAndPhase
OPTIONS -in
${
INPUTDATA
}
/monobandComplexFloat.tif
-modulus
${
TEMP
}
/apTvUtMod1inputComplex.tif
-phase
${
TEMP
}
/apTvUtPha1inputComplex.tif
VALID --compare-n-images
${
EPSILON_6
}
2
${
BASELINE
}
/Mod_monobandComplexFloat.tif
${
TEMP
}
/apTvUtMod1inputComplex.tif
${
BASELINE
}
/Pha_monobandComplexFloat.tif
${
TEMP
}
/apTvUtPha1inputComplex.tif
)
Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx
View file @
e38ade22
...
...
@@ -100,7 +100,7 @@ private:
AddRAMParameter
();
// Doc example parameter settings
SetDocExampleParameterValue
(
"in"
,
"
avions.tif
"
);
SetDocExampleParameterValue
(
"in"
,
"
maur_rgb.png
"
);
SetDocExampleParameterValue
(
"inseg"
,
"merged.tif"
);
SetDocExampleParameterValue
(
"out"
,
"vector.shp"
);
SetDocExampleParameterValue
(
"tilesizex"
,
"256"
);
...
...
Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
View file @
e38ade22
...
...
@@ -109,8 +109,8 @@ private:
// Doc example parameter settings
SetDocExampleParameterValue
(
"in"
,
"maur_rgb.png"
);
SetDocExampleParameterValue
(
"fout"
,
"
MeanShift_FilterOutput
.tif"
);
SetDocExampleParameterValue
(
"foutpos"
,
"
MeanShift_SpatialOutput
.tif"
);
SetDocExampleParameterValue
(
"fout"
,
"
smooth
.tif"
);
SetDocExampleParameterValue
(
"foutpos"
,
"
position
.tif"
);
SetDocExampleParameterValue
(
"spatialr"
,
"16"
);
SetDocExampleParameterValue
(
"ranger"
,
"16"
);
SetDocExampleParameterValue
(
"thres"
,
"0.1"
);
...
...
Modules/Core/ImageBase/include/otbImageIOBase.h
View file @
e38ade22
...
...
@@ -303,7 +303,6 @@ public:
virtual
void
SetOutputImagePixelType
(
bool
isComplexInternalPixelType
,
bool
isVectorImage
)
=
0
;
/*-------- This part of the interfaces deals with reading data ----- */
/** Determine the file type. Returns true if this ImageIO can read the
...
...
@@ -421,6 +420,12 @@ public:
*/
const
ArrayOfExtensionsType
&
GetSupportedWriteExtensions
()
const
;
/** Remap band order in an input buffer using band mapping bandList
* This operation is done in-place. The buffer size should enough to
* contain extracted bands before and after mapping. bandList mapping
* between origin components and output components (before any
* conversion)*/
void
DoMapBuffer
(
void
*
buffer
,
size_t
numberOfPixels
,
std
::
vector
<
unsigned
int
>&
bandList
);
protected:
ImageIOBase
();
...
...
Modules/Core/ImageBase/src/otbImageIOBase.cxx
View file @
e38ade22
...
...
@@ -1269,6 +1269,54 @@ ImageIOBase
return
axis
;
}
void
ImageIOBase
::
DoMapBuffer
(
void
*
buffer
,
size_t
numberOfPixels
,
std
::
vector
<
unsigned
int
>&
bandList
)
{
size_t
componentSize
=
this
->
GetComponentSize
();
size_t
inPixelSize
=
componentSize
*
this
->
GetNumberOfComponents
();
size_t
outPixelSize
=
componentSize
*
bandList
.
size
();
char
*
inPos
=
static_cast
<
char
*>
(
buffer
);
char
*
outPos
=
static_cast
<
char
*>
(
buffer
);
bool
workBackward
=
(
outPixelSize
>
inPixelSize
);
char
*
pixBuffer
=
new
char
[
outPixelSize
];
memset
(
pixBuffer
,
0
,
outPixelSize
);
if
(
workBackward
)
{
inPos
=
inPos
+
numberOfPixels
*
inPixelSize
;
outPos
=
outPos
+
numberOfPixels
*
outPixelSize
;
for
(
size_t
n
=
0
;
n
<
numberOfPixels
;
n
++
)
{
inPos
-=
inPixelSize
;
outPos
-=
outPixelSize
;
for
(
unsigned
int
i
=
0
;
i
<
bandList
.
size
()
;
i
++
)
{
memcpy
(
pixBuffer
+
i
*
componentSize
,
inPos
+
bandList
[
i
]
*
componentSize
,
componentSize
);
}
// copy pixBuffer to output
memcpy
(
outPos
,
pixBuffer
,
outPixelSize
);
}
}
else
{
for
(
size_t
n
=
0
;
n
<
numberOfPixels
;
n
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
bandList
.
size
()
;
i
++
)
{
memcpy
(
pixBuffer
+
i
*
componentSize
,
inPos
+
bandList
[
i
]
*
componentSize
,
componentSize
);
}
// copy pixBuffer to output
memcpy
(
outPos
,
pixBuffer
,
outPixelSize
);
inPos
+=
inPixelSize
;
outPos
+=
outPixelSize
;
}
}
delete
[]
pixBuffer
;
}
void
ImageIOBase
::
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
{
Superclass
::
PrintSelf
(
os
,
indent
);
...
...
Modules/Filtering/MathParser/src/otbParser.cxx
View file @
e38ade22
...
...
@@ -62,6 +62,7 @@ public:
{
m_MuParser
.
DefineFun
(
"ndvi"
,
Self
::
NDVI
);
m_MuParser
.
DefineFun
(
"NDVI"
,
Self
::
NDVI
);
m_MuParser
.
DefineFun
(
"atan2"
,
Self
::
ATAN2
);
#ifdef OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS
/* Starting with muParser 2.0.0, logical operators have been
...
...
@@ -208,6 +209,11 @@ private:
}
return
(
niri
-
r
)
/
(
niri
+
r
);
}
static
ValueType
ATAN2
(
ValueType
y
,
ValueType
x
)
{
return
vcl_atan2
(
y
,
x
);
}
#ifdef OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS
static
ValueType
AND
(
ValueType
left
,
ValueType
right
)
...
...
Modules/IO/ExtendedFilename/include/otbExtendedFilenameHelper.h
View file @
e38ade22
...
...
@@ -55,6 +55,30 @@ public:
itkGetStringMacro
(
ExtendedFileName
);
itkGetStringMacro
(
SimpleFileName
);
struct
GenericBandRange
:
std
::
pair
<
int
,
int
>
{
GenericBandRange
()
{}
GenericBandRange
(
int
a
);
GenericBandRange
(
const
std
::
pair
<
int
,
int
>&
a
);
GenericBandRange
(
int
a
,
int
b
);
bool
SetString
(
const
std
::
string
&
str
,
size_t
start
=
0
,
size_t
size
=
std
::
string
::
npos
);
void
Print
(
std
::
ostream
&
os
);
};
/** Decode the string into a list of GenericBandRange, band indexes are
* 1-based. */
std
::
vector
<
ExtendedFilenameHelper
::
GenericBandRange
>
GetGenericBandRange
(
const
std
::
string
&
bandRange
)
const
;
/** Resolve the list of band ranges into real band indexes, according to
* a total number of bands in the image. Note that the output indexes are
* zero-based (0 is the first component) */
bool
ResolveBandRange
(
const
std
::
string
&
bandRange
,
const
unsigned
int
&
nbBands
,
std
::
vector
<
unsigned
int
>
&
output
)
const
;
protected:
ExtendedFilenameHelper
()
{}
~
ExtendedFilenameHelper
()
ITK_OVERRIDE
{}
...
...
Modules/IO/ExtendedFilename/include/otbExtendedFilenameToReaderOptions.h
View file @
e38ade22
...
...
@@ -35,6 +35,13 @@ namespace otb
* - &resol : resolution factor for jpeg200 files
* - &skipcarto : switch to skip the cartographic information
* - &skipgeom : switch to skip the geometric information
* - &bands : select a band composition different from the input image,
* syntax is bands=r1,r2,r3,...,rn where each ri is a band range
* that can be :
* - a single index (1-based) : '2' means 2nd band, '-1' means last band
* - a range of bands : '3:' means 3rd band until the last one
* ':-2' means the first bands until the second to last
* '2:4' means bands 2,3 and 4
*
* \sa ImageFileReader
*
...
...
@@ -67,6 +74,7 @@ public:
std
::
pair
<
bool
,
bool
>
skipCarto
;
std
::
pair
<
bool
,
bool
>
skipGeom
;
std
::
pair
<
bool
,
bool
>
skipRpcTag
;
std
::
pair
<
bool
,
std
::
string
>
bandRange
;
std
::
vector
<
std
::
string
>
optionList
;
};
...
...
@@ -86,6 +94,10 @@ public:
bool
GetSkipGeom
()
const
;
bool
SkipRpcTagIsSet
()
const
;
bool
GetSkipRpcTag
()
const
;
std
::
string
GetBandRange
()
const
;
/** Test if band range extended filename is set */
bool
BandRangeIsSet
()
const
;
protected:
ExtendedFilenameToReaderOptions
();
...
...
Modules/IO/ExtendedFilename/include/otbExtendedFilenameToWriterOptions.h
View file @
e38ade22
...
...
@@ -72,6 +72,7 @@ public:
std
::
pair
<
bool
,
std
::
string
>
streamingSizeMode
;
std
::
pair
<
bool
,
double
>
streamingSizeValue
;
std
::
pair
<
bool
,
std
::
string
>
box
;
std
::
pair
<
bool
,
std
::
string
>
bandRange
;
std
::
vector
<
std
::
string
>
optionList
;
};
...
...
@@ -91,10 +92,13 @@ public:
std
::
string
GetStreamingSizeMode
()
const
;
bool
StreamingSizeValueIsSet
()
const
;
double
GetStreamingSizeValue
()
const
;
std
::
string
GetBandRange
()
const
;
bool
BoxIsSet
()
const
;
std
::
string
GetBox
()
const
;
/** Test if band range extended filename is set */
bool
BandRangeIsSet
()
const
;
protected:
ExtendedFilenameToWriterOptions
();
...
...
Modules/IO/ExtendedFilename/src/otbExtendedFilenameHelper.cxx
View file @
e38ade22
...
...
@@ -20,6 +20,8 @@
#include "otbExtendedFilenameHelper.h"
#include "otb_boost_string_header.h"
#include "otbStringUtils.h"
namespace
otb
{
...
...
@@ -43,32 +45,31 @@ ExtendedFilenameHelper
{
boost
::
split
(
tmp2
,
tmp1
[
1
],
boost
::
is_any_of
(
"&"
),
boost
::
token_compress_on
);
for
(
unsigned
int
i
=
0
;
i
<
tmp2
.
size
();
i
++
)
if
(
tmp2
[
i
].
length
()
>
0
)
if
(
!
tmp2
[
i
].
empty
()
)
{
std
::
vector
<
std
::
string
>
tmp
;
boost
::
split
(
tmp
,
tmp2
[
i
],
boost
::
is_any_of
(
"="
),
boost
::
token_compress_on
);
if
(
tmp
.
size
()
>
1
)
{
if
(
tmp
[
1
].
length
()
>
0
)
{
if
(
m_OptionMap
[
tmp
[
0
]].
empty
())
{
m_OptionMap
[
tmp
[
0
]]
=
tmp
[
1
];
}
else
{
itkWarningMacro
(
"Duplicated option detected: "
<<
tmp
[
0
]
<<
". Using value "
<<
tmp
[
1
]
<<
"."
);
}
}
else
itkGenericExceptionMacro
(
<<
"Value for option '"
<<
tmp
[
0
]
<<
"' is not set."
);
}
std
::
vector
<
std
::
string
>
tmp
;
boost
::
split
(
tmp
,
tmp2
[
i
],
boost
::
is_any_of
(
"="
),
boost
::
token_compress_on
);
if
(
tmp
.
size
()
>
1
)
{
if
(
!
tmp
[
1
].
empty
()
)
{
if
(
m_OptionMap
[
tmp
[
0
]].
empty
())
{
m_OptionMap
[
tmp
[
0
]]
=
tmp
[
1
];
}