[Git][debian-gis-team/otb][upstream] New upstream version 8.1.0~rc2+dfsg
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Fri Sep 2 16:47:39 BST 2022
Bas Couwenberg pushed to branch upstream at Debian GIS Project / otb
Commits:
d6982cfd by Bas Couwenberg at 2022-09-02T17:29:02+02:00
New upstream version 8.1.0~rc2+dfsg
- - - - -
8 changed files:
- Modules/Applications/AppProjection/app/CMakeLists.txt
- − Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx
- Modules/Applications/AppProjection/app/otbSuperimpose.cxx
- Modules/Applications/AppProjection/test/CMakeLists.txt
- Modules/Filtering/Projection/src/otbRPCSolver.cxx
- Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx
- RELEASE_NOTES.txt
- i18n/fr_FR.ts
Changes:
=====================================
Modules/Applications/AppProjection/app/CMakeLists.txt
=====================================
@@ -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
=====================================
@@ -1,287 +0,0 @@
-/*
- * 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
=====================================
@@ -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 exemple
+ 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
=====================================
@@ -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)
#----------- GridBasedImageResampling TESTS ----------------
=====================================
Modules/Filtering/Projection/src/otbRPCSolver.cxx
=====================================
@@ -148,15 +148,15 @@ void computeCoefficients(const std::vector<PrecisionType> & f,
PrecisionType res = std::numeric_limits<PrecisionType>::max();
VectorType coeffs;
+ UpdateMatrix(r, x, y ,z ,M);
for (int i =0; i<10; i++)
{
if (res < epsilon)
{
break;
}
+
auto w2 = weights * weights;
-
- UpdateMatrix(r, x, y ,z ,M);
vnl_svd<PrecisionType> svd(M.transpose()*w2*M);
@@ -388,4 +388,4 @@ void RPCSolver::Solve(const GCPsContainerType& gcpContainer, PrecisionType& rmsE
rmsError = std::sqrt(rmseAcc/numberOfPoints);
}
-}
\ No newline at end of file
+}
=====================================
Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx
=====================================
@@ -62,8 +62,8 @@ void ElevationParametersHandler::AddElevationParameters(Application::Pointer app
"Use a geoid grid to get the height "
"above the ellipsoid in case there is no DEM available, no coverage for "
"some points or pixels with no_data in the DEM tiles. A version of the "
- "geoid can be found on the OTB website"
- "(https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/blob/master/Input/DEM/egm96.grd).");
+ "geoid can be found on the OTB website (egm96.grd and egm96.grd.hdr at "
+ "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/master/Data/Input/DEM).");
app->MandatoryOff(oss.str());
std::string geoidFromConfig = otb::ConfigurationManager::GetGeoidFile();
=====================================
RELEASE_NOTES.txt
=====================================
@@ -1,8 +1,9 @@
-OTB-v 8.1.0 - Changes since version 8.0.1 (August 11th, 2022)
+OTB-v 8.1.0 - Changes since version 8.0.1 (September 2nd, 2022)
---------------------------------------------------------------------
Features added:
+ * !926: rpcSolver: Avoid setting equation system multiple times by Julien Osman
* !917: Avoid reloading the same DEM directory by Julien Osman
* !904: Add default radius value to NewFunctorFilter overload by Laurențiu Nicola
@@ -16,9 +17,14 @@ Bugs fixed:
Documentation:
+ * !915: Some documentation adjustments by Julien Osman
* !889: HaralickTextureExtraction: Clarify the definition of the parameters xrad and yrad by Julien Osman
* !887: Improve Python errors of mismatched types by Luc Hermitte
+Refactoring:
+
+ * !925: Remove code related to GenerateRPCSensorModel by Julien Osman
+
Licence and legislation matters:
* !905: Remove the 'Lena' image by Julien Osman
=====================================
i18n/fr_FR.ts
=====================================
@@ -278,8 +278,8 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi.
<translation>Version OTB M.m.pl (nom_de_code)</translation>
</message>
<message>
- <source><html><head/><body><p>Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)</p><p>Monteverdi is part of Orfeo Toolbox</p><p><a href="https://www.orfeo-toolbox.org/"><span style=" text-decoration: underline; color:#0000ff;">https://www.orfeo-toolbox.org/</span></a></p><p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with<br/>the License. You may obtain a copy of the License at:</p><p><a href="http://www.apache.org/licenses/LICENSE-2.0"><span style=" text-decoration: underline; color:#0000ff;">http://www.apache.org/licenses/LICENSE-2.0</span></a></p><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an <br/>"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License<br/>for the specific language governing permissions and limitations under the License.</p></body></html></source>
- <translation></translation>
+ <source><html><head/><body><p>Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)</p><p>Monteverdi is part of Orfeo Toolbox</p><p><a href="https://www.orfeo-toolbox.org/"><span style=" text-decoration: underline; color:#0000ff;">https://www.orfeo-toolbox.org/</span></a></p><p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with<br/>the License. You may obtain a copy of the License at:</p><p><a href="http://www.apache.org/licenses/LICENSE-2.0"><span style=" text-decoration: underline; color:#0000ff;">http://www.apache.org/licenses/LICENSE-2.0</span></a></p><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an <br/>"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License<br/>for the specific language governing permissions and limitations under the License.</p></body></html></source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/-/commit/d6982cfd079e5f77cab098cd35f4a81246094407
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/-/commit/d6982cfd079e5f77cab098cd35f4a81246094407
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220902/2b8b49e6/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list