Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
ca429a75
Commit
ca429a75
authored
Nov 03, 2022
by
Thibaut ROMAIN
Browse files
Merge branch 'develop' into remove-visualization-modules
parents
858b8803
c8cde1f4
Changes
51
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ca429a75
...
...
@@ -51,6 +51,7 @@ stages:
-
build
-
report
-
deploy
-
docker
.general
:
retry
:
...
...
@@ -422,3 +423,18 @@ release-container:
--form ref=master
--form variables[OTB_TAG]=$CI_COMMIT_TAG
https://gitlab.orfeo-toolbox.org/api/v4/projects/126/trigger/pipeline
release-docker
:
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
stage
:
docker
only
:
refs
:
-
/^release-[0-9]+\.[0-9]+$/
script
:
-
/kaniko/executor --cleanup
--verbosity warn
--context $CI_PROJECT_DIR/Docker
--dockerfile $CI_PROJECT_DIR/Docker/Dockerfile
--destination $CI_REGISTRY_IMAGE/orfeotoolbox/otb:$CI_COMMIT_BRANCH
CI/headers_check.py
View file @
ca429a75
...
...
@@ -129,6 +129,8 @@ excludedfiles = set([
'./CMake/exportheader.cmake.in'
,
'./CMake/pre-commit'
,
'./CMake/qt.conf.in'
,
'./Docker/Dockerfile'
,
'./Docker/system-dependencies.txt'
,
'./Documentation/Cookbook/Art/residual_registration-figure.tex'
,
'./Documentation/Cookbook/rst/Makefile.in'
,
'./Documentation/Cookbook/rst/conf.py.in'
,
...
...
Docker/Dockerfile
0 → 100644
View file @
ca429a75
#
# Copyright (C) 2005-2022 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.
#
FROM
ubuntu:20.04
ARG
OTB_RELEASE=8.0.0
# Install system dependencies
COPY
system-dependencies.txt .
RUN
apt-get update
-y
\
&&
apt-get upgrade
-y
\
&&
cat
system-dependencies.txt |
DEBIAN_FRONTEND
=
noninteractive xargs apt-get
install
-y
--no-install-recommends
\
&&
apt-get clean
\
&&
rm
-rf
/var/lib/apt/lists/
*
system-dependencies.txt
# Install pre-compiled OTB binaries
RUN
curl https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-
$OTB_RELEASE
-Linux64
.run
-o
OTB-
$OTB_RELEASE
-Linux64
.run
\
&&
chmod
+x OTB-
$OTB_RELEASE
-Linux64
.run
\
&&
./OTB-
$OTB_RELEASE
-Linux64
.run
--target
/opt/otb
\
&&
rm
OTB-
$OTB_RELEASE
-Linux64
.run
# Symlink Python library to a known path for OTB
RUN
ln
-s
/usr/lib/x86_64-linux-gnu/libpython3.8.so /opt/otb/lib/libpython3.8.so.rh-python38-1.0
# Persistant env
ENV
CMAKE_PREFIX_PATH=/opt/otb
ENV
PYTHONPATH=/opt/otb/lib/python
ENV
GDAL_DRIVER_PATH=disable
ENV
GDAL_DATA=/opt/otb/share/gdal
ENV
PROJ_LIB=/opt/otb/share/proj
ENV
PATH=/opt/otb/bin:$PATH
ENV
OTB_APPLICATION_PATH=/opt/otb/lib/otb/applications
ENV
LC_NUMERIC=C
# Default command when using 'docker run' or 'docker create'
CMD
/bin/bash
Docker/system-dependencies.txt
0 → 100644
View file @
ca429a75
ca-certificates
curl
libxcb1
libxcb-composite0
libxcb-glx0
libxcb-icccm4
libxcb-image0
libxcb-keysyms1
libxcb-randr0
libxcb-render0
libxcb-render-util0
libxcb-util1
libxcb-shm0
libxcb-xfixes0
libxcb-xinerama0
libxcb-xinput0
libxcb-xkb1
libxcb-shape0
libx11-xcb1
libglu1-mesa
libxrender1
libxi6
libxkbcommon0
libxkbcommon-x11-0
libxinerama1
python3
python3-dev
python3-numpy
libtool
libopengl0
Documentation/Cookbook/Art/plugins_config.png
0 → 100644
View file @
ca429a75
122 KB
Documentation/Cookbook/_static/html/versions.html
View file @
ca429a75
...
...
@@ -16,6 +16,7 @@
<dd><a
href=
"https://www.orfeo-toolbox.org/CookBook-7.3/"
>
7.3.0
</a></dd>
<dd><a
href=
"https://www.orfeo-toolbox.org/CookBook-7.4/"
>
7.4.0
</a></dd>
<dd><a
href=
"https://www.orfeo-toolbox.org/CookBook-8.0/"
>
8.0.1
</a></dd>
<dd><a
href=
"https://www.orfeo-toolbox.org/CookBook-8.1/"
>
8.1.0
</a></dd>
<dd><a
href=
"https://www.orfeo-toolbox.org/CookBook-develop/"
>
develop
</a></dd>
</dl>
</div>
...
...
Documentation/Cookbook/rst/CompilingOTBFromSource.rst
View file @
ca429a75
...
...
@@ -27,25 +27,53 @@ process:
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| **Library** | **Mandatory** | **Minimum version** | **Superbuild Version** |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `Boost <http://www.boost.org>`_ | Yes | | 1.72.0 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `Expat <https://sourceforge.net/projects/expat/>`_ | Yes | | 2.4.8 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `FreeType <https://freetype.org/>`_ | Yes | | 2.6.0 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `Geos <https://libgeos.org/>`_ | Yes | | 3.9.3 / 3.6.5 (windows) |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `ITK <http://www.itk.org>`_ | Yes | 4.6.0 | 4.13.3 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `GDAL <http://www.gdal.org>`_ | Yes | 2.4.1 | 3.4.2 |
| `GDAL <http://www.gdal.org>`_ | Yes | 2.4.1 | 3.4.2 / 3.2.2 (windows) |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `HDF4 <https://www.hdfgroup.org/solutions/hdf4/>`_ | Yes | | 4.2.13 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `HDF5 <https://www.hdfgroup.org/solutions/hdf5/>`_ | Yes | | 1.10.1 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `libgeotiff <http://trac.osgeo.org/geotiff/>`_ | Yes | | 1.7.1 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `libjpeg-turbo <http://sourceforge.net/projects/libjpeg-turbo>`_ | Yes | | 1.5.3 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `lib
geotiff
<http://
trac.osgeo.org/geotiff/>`_
| Yes | | 1.
7.0
|
| `lib
png
<http
s
://
downloads.sourceforge.net/project/libpng>`_
| Yes | | 1.
6.37
|
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `boost <http://www.boost.org>`_ | Yes | | 1.72.0 |
| `libtiff <http://www.libtiff.org/>`_ | Yes | | 4.4.0 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `NetCDF <https://github.com/Unidata/netcdf-c>`_ | Yes | | 4.7.4 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `Noto Fonts <https://fonts.google.com/noto>`_ | Yes | | |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `OpenJPEG <https://github.com/uclouvain/openjpeg>`_ | Yes | | 2.3.1 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `PROJ <https://proj.org/>`_ | Yes | | 8.2.0 / 6.2.1 (windows) |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `SQLITE <https://www.sqlite.org>`_ | Yes | | 3.36.0 / 3.8.8 (windows) |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `tinyXML <http://www.grinninglizard.com/tinyxml>`_ | Yes | | 2.6.2 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `ZLIB <https://zlib.net>`_ | Yes | | 1.2.12 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `6S <http://6s.ltdri.org>`_ | No | | |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `Curl <http://www.curl.haxx.se>`_ | No | | 7.54.1 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `FFTW <http://www.fftw.org>`_ | No | | 3.3.
9
|
| `FFTW <http://www.fftw.org>`_ | No | | 3.3.
10
|
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `libKML <https://github.com/google/libkml>`_ | No | 1.2 | 1.3.0 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `libSVM <http://www.csie.ntu.edu.tw/~cjlin/libsvm>`_ | No | 2.0 | 3.2
2
|
| `libSVM <http://www.csie.ntu.edu.tw/~cjlin/libsvm>`_ | No | 2.0 | 3.2
5
|
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `MPI <https://www.open-mpi.org/>`_ | No | | |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
...
...
@@ -53,7 +81,7 @@ process:
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `MuParserX <http://muparserx.beltoforion.de>`_ | No | 4.0.7 | 4.0.8 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `OpenCV <http://opencv.org>`_ | No | 3.0.0 | 4.
5.1
|
| `OpenCV <http://opencv.org>`_ | No | 3.0.0 | 4.
6.0
|
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `Shark <http://image.diku.dk/shark/>`_ | No | 4 | 4.0 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
...
...
@@ -61,6 +89,8 @@ process:
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `SPTW <https://github.com/remicres/sptw.git>`_ | No | | |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
| `SWIG <https://www.swig.org/>`_ | No | | 4.0.2 |
+------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+
GNU/Linux and macOS
-------------------
...
...
Documentation/Cookbook/rst/QGISInterface.rst
View file @
ca429a75
...
...
@@ -12,6 +12,8 @@ You can configure OTB for QGIS according to the:
.. image:: Art/plugins.png
.. image:: Art/plugins_config.png
Compatibility between QGIS and OTB versions
-------------------------------------------
...
...
Documentation/Cookbook/rst/ReleaseNote8.rst
View file @
ca429a75
What is new with OTB 8.0
========================
.. note:: To see the complete list of updates, see the `RELEASE NOTES
<https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/RELEASE_NOTES.txt>`_.
OSSIM is used for geometric **sensor modelling** and **metadata
parsing**. It has been a dependency of the OTB since its
beginning. Then adapter classes have been added to hide OSSIM headers
...
...
Documentation/Cookbook/rst/RemoteModules.rst
View file @
ca429a75
...
...
@@ -152,6 +152,7 @@ the applications of your module will be installed in the same folder as OTB appl
mkdir /Path/to/Module/build && cd /Path/to/Module/build
cmake -DOTB_DIR=/PathTo/OTB/install -DOTB_BUILD_MODULE_AS_STANDALONE=ON
-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
-DCMAKE_INSTALL_PREFIX=/theModulePath/install -DCMAKE_INSTALL_RPATH=/theModulePath/install/lib
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE ../
make install
...
...
Modules/Adapters/GdalAdapters/test/CMakeLists.txt
View file @
ca429a75
...
...
@@ -67,7 +67,7 @@ otb_add_test(NAME TvOGRExtendedFilename
otb_add_test
(
NAME TvOGRExtendedFilenameGDALCreate
COMMAND otbOGRTestDriver
otbOGRExtendedFileNameGDALCreate
${
TEMP
}
/test_OGRExtendedFilenameGDALCreate.shp?gdal:co:creationOption=OPTION
${
TEMP
}
/test_OGRExtendedFilenameGDALCreate.shp?
&
gdal:co:creationOption=OPTION
)
otb_add_test
(
NAME TvOGRExtendedFilenameGDALLayer
...
...
Modules/Applications/AppProjection/app/CMakeLists.txt
View file @
ca429a75
...
...
@@ -28,12 +28,6 @@ otb_create_application(
SOURCES otbConvertCartoToGeoPoint.cxx
LINK_LIBRARIES
${${
otb-module
}
_LIBRARIES
}
)
# TODO refactor this application
#otb_create_application(
# NAME GenerateRPCSensorModel
# SOURCES otbGenerateRPCSensorModel.cxx
# LINK_LIBRARIES ${${otb-module}_LIBRARIES})
otb_create_application
(
NAME GridBasedImageResampling
SOURCES otbGridBasedImageResampling.cxx
...
...
Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx
deleted
100644 → 0
View file @
858b8803
/*
* Copyright (C) 2005-2022 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.
*/
// Wrappers
#include
"otbWrapperApplicationFactory.h"
#include
"otbWrapperChoiceParameter.h"
#include
"otbWrapperElevationParametersHandler.h"
#include
"otbWrapperMapProjectionParametersHandler.h"
#include
"otbSensorModelAdapter.h"
#include
"otbRPCSolverAdapter.h"
#include
"itkEuclideanDistanceMetric.h"
#include
"otbGenericRSTransform.h"
#include
"otbOGRDataSourceWrapper.h"
#include
"ogrsf_frmts.h"
#include
"otbDEMHandler.h"
namespace
otb
{
namespace
Wrapper
{
class
GenerateRPCSensorModel
:
public
Application
{
public:
/** Standard class typedefs. */
typedef
GenerateRPCSensorModel
Self
;
typedef
Application
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
otb
::
RPCSolverAdapter
::
Point3DType
Point3DType
;
typedef
otb
::
RPCSolverAdapter
::
Point2DType
Point2DType
;
typedef
itk
::
Statistics
::
EuclideanDistanceMetric
<
Point3DType
>
DistanceType
;
typedef
otb
::
RPCSolverAdapter
::
GCPType
TiePointType
;
typedef
otb
::
RPCSolverAdapter
::
GCPsContainerType
TiePointsType
;
typedef
otb
::
GenericRSTransform
<
double
,
3
,
3
>
RSTransformType
;
/** Standard macro */
itkNewMacro
(
Self
);
itkTypeMacro
(
GenerateRPCSensorModel
,
otb
::
Application
);
private:
void
DoInit
()
override
{
SetName
(
"GenerateRPCSensorModel"
);
SetDescription
(
"Generate a RPC sensor model from a list of Ground Control Points."
);
SetDocLongDescription
(
"This application generates a RPC sensor model from a list of Ground Control Points. "
"At least 20 points are required for estimation without elevation support, "
"and 40 points for estimation with elevation support. "
"Elevation support will be automatically deactivated if an insufficient amount of points is provided. "
"The application can optionally output a file containing accuracy statistics for each point,"
" and a vector file containing segments representing points residues. "
"The map projection parameter allows defining a map projection in which the accuracy is evaluated."
);
AddDocTag
(
Tags
::
Geometry
);
SetDocLimitations
(
"None"
);
SetDocSeeAlso
(
"OrthoRectication,HomologousPointsExtraction,RefineSensorModel"
);
SetDocAuthors
(
"OTB-Team"
);
AddParameter
(
ParameterType_OutputFilename
,
"outgeom"
,
"Output geom file"
);
SetParameterDescription
(
"outgeom"
,
"Geom file containing the generated RPC sensor model"
);
AddParameter
(
ParameterType_InputFilename
,
"inpoints"
,
"Input file containing tie points"
);
SetParameterDescription
(
"inpoints"
,
"Input file containing tie points. Points are stored in following format: col row lon lat. Spaced by a space or tab character. "
"Line beginning with # are ignored."
);
AddParameter
(
ParameterType_OutputFilename
,
"outstat"
,
"Output file containing output precision statistics"
);
SetParameterDescription
(
"outstat"
,
"Output file containing the following info: ref_lon ref_lat elevation predicted_lon predicted_lat x_error_ref(meters) "
"y_error_ref(meters) global_error_ref(meters) x_error(meters) y_error(meters) overall_error(meters)"
);
MandatoryOff
(
"outstat"
);
DisableParameter
(
"outstat"
);
AddParameter
(
ParameterType_OutputFilename
,
"outvector"
,
"Output vector file with residues"
);
SetParameterDescription
(
"outvector"
,
"File containing segments representing residues"
);
MandatoryOff
(
"outvector"
);
DisableParameter
(
"outvector"
);
// Build the Output Map Projection
MapProjectionParametersHandler
::
AddMapProjectionParameters
(
this
,
"map"
);
// Elevation
ElevationParametersHandler
::
AddElevationParameters
(
this
,
"elev"
);
// Doc example parameter settings
SetDocExampleParameterValue
(
"outgeom"
,
"output.geom"
);
SetDocExampleParameterValue
(
"inpoints"
,
"points.txt"
);
SetDocExampleParameterValue
(
"map"
,
"epsg"
);
SetDocExampleParameterValue
(
"map.epsg.code"
,
"32631"
);
SetOfficialDocLink
();
}
void
DoUpdateParameters
()
override
{
// Nothing to do here : all parameters are independent
}
void
DoExecute
()
override
{
OGRMultiLineString
mls
;
// Setup the DEM Handler
otb
::
Wrapper
::
ElevationParametersHandler
::
SetupDEMHandlerFromElevationParameters
(
this
,
"elev"
);
// Parse the input file for ground control points
std
::
ifstream
ifs
;
ifs
.
open
(
GetParameterString
(
"inpoints"
));
TiePointsType
tiepoints
;
while
(
!
ifs
.
eof
())
{
std
::
string
line
;
std
::
getline
(
ifs
,
line
);
double
x
,
y
,
z
,
lat
,
lon
;
// Avoid commented lines or too short ones
if
(
!
line
.
empty
()
&&
line
[
0
]
!=
'#'
)
{
std
::
istringstream
iss
(
line
);
iss
>>
x
>>
y
>>
lon
>>
lat
;
z
=
otb
::
DEMHandler
::
GetInstance
().
GetHeightAboveEllipsoid
(
lon
,
lat
);
otbAppLogDEBUG
(
"Adding tie point x="
<<
x
<<
", y="
<<
y
<<
", z="
<<
z
<<
", lon="
<<
lon
<<
", lat="
<<
lat
);
Point2DType
p1
;
Point3DType
p2
;
p1
[
0
]
=
x
;
p1
[
1
]
=
y
;
p2
[
0
]
=
lon
;
p2
[
1
]
=
lat
;
p2
[
2
]
=
z
;
tiepoints
.
push_back
(
std
::
make_pair
(
p1
,
p2
));
}
}
ifs
.
close
();
otbAppLogINFO
(
"Optimization in progress ..."
);
double
rms
;
otb
::
RPCSolverAdapter
::
Solve
(
tiepoints
,
rms
,
GetParameterString
(
"outgeom"
));
otbAppLogINFO
(
"Done.
\n
"
);
otb
::
SensorModelAdapter
::
Pointer
sm
=
otb
::
SensorModelAdapter
::
New
();
sm
->
ReadGeomFile
(
GetParameterString
(
"outgeom"
));
double
rmse
=
0
;
double
rmsex
=
0
;
double
rmsey
=
0
;
double
meanx
=
0
;
double
meany
=
0
;
DistanceType
::
Pointer
distance
=
DistanceType
::
New
();
RSTransformType
::
Pointer
rsTransform
=
RSTransformType
::
New
();
rsTransform
->
SetOutputProjectionRef
(
MapProjectionParametersHandler
::
GetProjectionRefFromChoice
(
this
,
"map"
));
rsTransform
->
InstantiateTransform
();
std
::
ofstream
ofs
;
ofs
<<
std
::
fixed
;
ofs
.
precision
(
12
);
if
(
IsParameterEnabled
(
"outstat"
))
{
ofs
.
open
(
GetParameterString
(
"outstat"
));
ofs
<<
"#ref_lon ref_lat elevation predicted_lon predicted_lat elevation x_error(meters) y_error(meters) global_error(meters)"
<<
std
::
endl
;
}
for
(
TiePointsType
::
const_iterator
it
=
tiepoints
.
begin
();
it
!=
tiepoints
.
end
();
++
it
)
{
Point3DType
tmpPoint
,
ref
;
sm
->
ForwardTransformPoint
(
it
->
first
[
0
],
it
->
first
[
1
],
it
->
second
[
2
],
tmpPoint
[
0
],
tmpPoint
[
1
],
tmpPoint
[
2
]);
tmpPoint
=
rsTransform
->
TransformPoint
(
tmpPoint
);
ref
[
0
]
=
it
->
second
[
0
];
ref
[
1
]
=
it
->
second
[
1
];
ref
[
2
]
=
it
->
second
[
2
];
ref
=
rsTransform
->
TransformPoint
(
ref
);
OGRLineString
ls
;
ls
.
addPoint
(
tmpPoint
[
0
],
tmpPoint
[
1
]);
ls
.
addPoint
(
ref
[
0
],
ref
[
1
]);
mls
.
addGeometry
(
&
ls
);
double
gerror
=
distance
->
Evaluate
(
ref
,
tmpPoint
);
double
xerror
=
ref
[
0
]
-
tmpPoint
[
0
];
double
yerror
=
ref
[
1
]
-
tmpPoint
[
1
];
if
(
IsParameterEnabled
(
"outstat"
))
ofs
<<
ref
[
0
]
<<
"
\t
"
<<
ref
[
1
]
<<
"
\t
"
<<
it
->
second
[
2
]
<<
"
\t
"
<<
tmpPoint
[
0
]
<<
"
\t
"
<<
tmpPoint
[
1
]
<<
"
\t
"
<<
tmpPoint
[
2
]
<<
"
\t
"
<<
xerror
<<
"
\t
"
<<
yerror
<<
"
\t
"
<<
gerror
<<
std
::
endl
;
rmse
+=
gerror
*
gerror
;
rmsex
+=
xerror
*
xerror
;
rmsey
+=
yerror
*
yerror
;
meanx
+=
xerror
;
meany
+=
yerror
;
}
rmse
/=
tiepoints
.
size
();
rmsex
/=
tiepoints
.
size
();
rmsey
/=
tiepoints
.
size
();
meanx
/=
tiepoints
.
size
();
meany
/=
tiepoints
.
size
();
double
stdevx
=
std
::
sqrt
(
rmsex
-
meanx
*
meanx
);
double
stdevy
=
std
::
sqrt
(
rmsey
-
meany
*
meany
);
rmse
=
std
::
sqrt
(
rmse
);
rmsex
=
std
::
sqrt
(
rmsex
);
rmsey
=
std
::
sqrt
(
rmsey
);
otbAppLogINFO
(
"Estimation of final accuracy: "
);
otbAppLogINFO
(
"Overall Root Mean Square Error: "
<<
rmse
<<
" meters"
);
otbAppLogINFO
(
"X Mean Error: "
<<
meanx
<<
" meters"
);
otbAppLogINFO
(
"X standard deviation: "
<<
stdevx
<<
" meters"
);
otbAppLogINFO
(
"X Root Mean Square Error: "
<<
rmsex
<<
" meters"
);
otbAppLogINFO
(
"Y Mean Error: "
<<
meany
<<
" meters"
);
otbAppLogINFO
(
"Y standard deviation: "
<<
stdevy
<<
" meters"
);
otbAppLogINFO
(
"Y Root Mean Square Error: "
<<
rmsey
<<
" meters"
);
if
(
IsParameterEnabled
(
"outstat"
))
ofs
.
close
();
if
(
IsParameterEnabled
(
"outvector"
))
{
// Create the datasource (for matches export)
otb
::
ogr
::
Layer
layer
(
nullptr
,
false
);
otb
::
ogr
::
DataSource
::
Pointer
ogrDS
;
ogrDS
=
otb
::
ogr
::
DataSource
::
New
(
GetParameterString
(
"outvector"
),
otb
::
ogr
::
DataSource
::
Modes
::
Overwrite
);
std
::
string
projref
=
MapProjectionParametersHandler
::
GetProjectionRefFromChoice
(
this
,
"map"
);
OGRSpatialReference
oSRS
(
projref
.
c_str
());
// and create the layer
layer
=
ogrDS
->
CreateLayer
(
"matches"
,
&
oSRS
,
wkbMultiLineString
);
OGRFeatureDefn
&
defn
=
layer
.
GetLayerDefn
();
ogr
::
Feature
feature
(
defn
);
feature
.
SetGeometry
(
&
mls
);
layer
.
CreateFeature
(
feature
);
}
}
};
}
}
OTB_APPLICATION_EXPORT
(
otb
::
Wrapper
::
GenerateRPCSensorModel
)
Modules/Applications/AppProjection/app/otbSuperimpose.cxx
View file @
ca429a75
...
...
@@ -220,6 +220,14 @@ private:
itk
::
NumericTraits
<
FloatVectorImageType
::
PixelType
>::
SetLength
(
defaultValue
,
movingImage
->
GetNumberOfComponentsPerPixel
());
defaultValue
.
Fill
(
GetParameterFloat
(
"fv"
));
// If the origin product is in sensor geometry, superimpose should keep the RPC parameters for orthorectification for example
if
(
refImage
->
GetProjectionRef
().
empty
()
&&
refImage
->
GetImageMetadata
().
HasSensorGeometry
())
{
std
::
string
out_FileName
=
GetParameterString
(
"out"
);
out_FileName
.
append
(
"?&writerpctags=true"
);
SetParameterString
(
"out"
,
out_FileName
);
}
if
(
GetParameterString
(
"mode"
)
==
"default"
)
{
FloatVectorImageType
::
SpacingType
defSpacing
;
...
...
Modules/Applications/AppProjection/test/CMakeLists.txt
View file @
ca429a75
...
...
@@ -155,29 +155,7 @@ otb_test_application(NAME apTvPrConvertCartoToGeoPoint
TESTENVOPTIONS
${
TEMP
}
/apTvPrConvertCartoToGeoPoint.txt
VALID --compare-ascii
${
EPSILON_7
}
${
BASELINE_FILES
}
/apTvPrConvertCartoToGeoPoint.txt
${
TEMP
}
/apTvPrConvertCartoToGeoPoint.txt
)
#----------- GenerateRPCSensorModel TESTS ----------------
# Remove baseline for OSSIM >= 2.2, as ossimRPCProjection.optimizeFit() is broken
# set(VALID_CONDITION)
# if(OTB_OSSIM_VERSION LESS 20200)
# set(VALID_CONDITION
# VALID --compare-ascii ${EPSILON_3}
# ${BASELINE_FILES}/apTvPrGenerateRPCSensorModelGeomOutput.geom
# ${TEMP}/apTvPrGenerateRPCSensorModelGeomOutput.geom)
# endif()
# otb_test_application(NAME apTvPrGenerateRPCSensorModel
# APP GenerateRPCSensorModel
# OPTIONS -inpoints ${INPUTDATA}/QB_TOULOUSE_MUL_Extract_500_500_in_tie_points.txt
# -outgeom ${TEMP}/apTvPrGenerateRPCSensorModelGeomOutput.geom
# -outstat ${TEMP}/apTvPrGenerateRPCSensorModelStatsOutput.txt
# -outvector ${TEMP}/apTvPrGenerateRPCSensorModelVectorOutput.shp
# -map utm -map.utm.zone 31 -map.utm.northhem 1
# -elev.dem ${INPUTDATA}/DEM/srtm_directory
# -elev.geoid ${INPUTDATA}/DEM/egm96.grd
# ${VALID_CONDITION})
${
TEMP
}
/apTvPrConvertCartoToGeoPoint.txt
)