pyarchinit-photogrammetry-core (ppg_core)
Copyright (C) Enzo Cocca. Licensed under the GNU General Public License, version 2 or later.

This package includes RTKLIB, built into the extension for the post-processing of GNSS
observations (ppk_solve) and, from 0.8, for the conversion of raw receiver logs into RINEX
(raw_to_rinex, what RTKLIB's convbin does):

  RTKLIB-EX v2.5.1 (https://github.com/rtklibexplorer/RTKLIB, tag v2.5.1,
  commit 62d4677ed8425a4e2748c6d390b500d1afb493fc), sources in vendor/rtklib/src, unchanged
  but for one line of src/rtkpos.c (the time mark of an epoch), three of src/convrnx.c (the
  name, not the path, of a log in the headers of the RINEX files) and some lines of readrnxobs()
  in src/rinex.c (which records after an external event of a RINEX file are read through or
  discarded): see vendor/rtklib/VERSION.

  Of its receiver decoders (vendor/rtklib/src/rcv):
    ublox.c       u-blox,     Copyright (C) 2007-2020 by T. Takasu; Copyright (C) 2014 by T. Suzuki
    novatel.c     NovAtel,    Copyright (C) 2007-2020 by T. Takasu
    septentrio.c  Septentrio, Copyright (C) 2013 by Fabrizio Tappero; Copyright (C) 2015 by Jens Reimann
    rt17.c        Trimble RT-17, Copyright (C) 2014, 2016 Daniel A. Cook; Copyright (C) 2020 T. Takasu
    unicore.c     Unicore,    Copyright (C) 2024 Avinab Malla
  Their headers carry these copyright lines (most "All rights reserved") and name no licence of
  their own. ublox.c and novatel.c are T. Takasu's, the copyright holder of RTKLIB's license.txt:
  that they are under its BSD 2-clause licence below is inferred, not stated in the files.
  septentrio.c, rt17.c and unicore.c name other authors and carry no licence header of their own;
  they are distributed with RTKLIB-EX, which is licensed as a whole under the BSD 2-clause licence
  below, and are included here on that basis.

Not part of this package: RTKLIB's other receiver decoders, streams and applications, and the
routines of the IAU SOFA library that RTKLIB bundles in sofa.c for the positions of the Sun and the
Moon (an option that is not built; SOFA has a licence of its own). See vendor/rtklib/VERSION.

The Rust crates compiled into the extension (PyO3, numpy, rayon, wgpu, spade for the constrained
Delaunay triangulation of the TIN, nalgebra for the linear algebra of the two-view solvers, and
their dependencies) are distributed under the MIT or the Apache-2.0 license, both compatible with
the GPL.

The SIFT kernels of the extension - native/engine/src/gpu_sift.rs (on the GPU, wgpu) and
native/engine/src/sift_cpu.rs (its twin on the CPU) - follow the structure and the identifiers of
VLFeat's sift.c (the scale space, the extrema and their refinement, the orientation histogram, the
descriptor and the layout of its bins; sigman, winf, magnif, wsigma, xper), so that the points they
find are those of VLFeat and of COLMAP, which uses VLFeat. No file of VLFeat is compiled into the
extension. VLFeat is distributed under the BSD 2-clause license below (after RTKLIB's).

The minimal solvers of two views - native/engine/src/geometry/solvers.rs - are arranged as
COLMAP's estimators (src/colmap/estimators/essential_matrix.cc, fundamental_matrix.cc,
homography_matrix.cc, utils.cc and src/colmap/geometry/essential_matrix.cc, triangulation.cc):
the five-point algorithm with its null space, Gauss-Jordan elimination, 3 x 3 polynomial matrix
and tenth-degree determinant, the seven-point cubic, the normalised eight-point algorithm, the
direct linear transform of the homography, the Sampson and transfer errors, the decomposition of
the essential matrix and the choice of its pose by the triangulated points. The coefficient
tables COLMAP generates offline are computed by polynomial arithmetic, and the roots and the
decompositions are found by methods of this file's own; no file of COLMAP is compiled into the
extension. The robust estimation and the configuration of a pair - native/engine/src/geometry/
ransac.rs and two_view.rs - are arranged as COLMAP's LO-RANSAC (src/colmap/optim/loransac.h,
ransac.h, support_measurement.h: the support, the local optimisation, the dynamic number of
trials and its bound) and as its estimation of the two-view geometry
(src/colmap/estimators/two_view_geometry.cc: the thresholds, the decision between the essential,
fundamental and homography models by their inlier counts, the watermark detection with its
translation estimator, the relative pose), with the decomposition of the homography of
src/colmap/geometry/homography_matrix.cc (Malis and Vargas 2007); the PROSAC sampler is written
from the paper (Chum and Matas 2005). COLMAP is distributed under the BSD 3-clause license below
(after VLFeat's).

The view graph of the native mapper - native/engine/src/mapper/graph.rs - is arranged as GLOMAP's
(https://github.com/colmap/glomap): the calibration of the guessed focal lengths from the
fundamental matrices of the pairs (glomap/estimators/view_graph_calibration.h and .cc: the pairs
of a calibrated or uncalibrated configuration, the Cauchy loss of scale 1e-2, the cameras with a
prior focal length held, the estimates beyond a tenth or ten times the guess rejected, every focal
length of the model set to the estimate), with the residual of Sweeney et al. 2015 on the
singular values; and the relative poses estimated again from the inliers of every verified pair
(glomap/estimators/relpose_estimation.cc, with PoseLib's epipolar threshold of 1 pixel). The
least squares and the robust estimation are this package's own; no file of GLOMAP is compiled
into the extension. The rotation averaging - native/engine/src/mapper/rotation.rs - is arranged as
GLOMAP's (glomap/estimators/global_rotation_averaging.h and .cc, glomap/math/tree.cc,
glomap/processors/relpose_filter.cc and the order of glomap/controllers/global_mapper.cc): the
rotations started from the maximum spanning tree of the pairs, the tangent-space errors of the
relative rotations with the update R exp(-w), the rounds of L1 regression and the iteratively
reweighted least squares with the Geman-McClure weights of scale 5 degrees, their numbers of
iterations and convergence thresholds, the pairs that disagree by more than 10 degrees dropped and
the largest connected part averaged a second time. The L1 solver (the alternating direction method
of Boyd et al. 2011), the inverse Jacobians of the linearisation, the line search, the loops of
three photos that order the spanning tree and the moving of a photo to the rotation most of its
pairs agree on are this package's own. The filter of the observations of the triangulated points
- native/engine/src/mapper/triangulate.rs - is arranged as COLMAP's global mapper filters them
(src/colmap/sfm/observation_manager.cc, FilterPoints3DWithLargeReprojectionError with the
normalised error and FilterPoints3DWithSmallTriangulationAngle; src/colmap/geometry/triangulation.cc,
CalculateTriangulationAngle): an observation beyond the threshold goes, all of a point's go when
fewer than two are left or when no two of its rays meet at the smallest angle, the angle of two
rays the smaller of it and its supplement. The union-find of the tracks, the selection of the
tracks over each photo and the least squares of the triangulation are this package's own. The
global positioning - native/engine/src/mapper/positioning.rs - is arranged as GLOMAP's
(glomap/estimators/global_positioning.h and .cc, the BATAPairwiseDirectionError of
glomap/estimators/cost_function.h, glomap/estimators/optimization_base.h): the residual of an
observation, the scale of that observation times the point less the centre against the unit ray
in the world, under the Huber loss of scale 0.1; the scales started at 1 (or from the point
already placed) with the lower bound 1e-5 and the first one held; the observations of a camera
without a prior focal length weighed by a half; the tracks of at least three views; the random
start of the centres and then of the points, uniform in a cube of 100, with the seed 1; and the
100 iterations of a solve (300 from the random start: this package's figure). The positions of
the photos as residuals with a bias per flight, the frame turned onto them from the directions of
the pairs, the robust similarity with a translation per flight, the solver and the generator of
the random start are this package's own. GLOMAP is distributed under the BSD 3-clause license
below (after COLMAP's).

The rounds of adjustment of the native mapper - native/engine/src/mapper/rounds.rs - follow the
order of COLMAP's global mapper (src/colmap/sfm/global_mapper.cc, IterativeBundleAdjustment and
IterativeRetriangulateAndRefine): the positioned tracks filtered at 10 times the normalised
reprojection threshold, the threshold of the filter after each adjustment 3, 2, then 1 times it,
every track triangulated again with the poses held, filtered at the plain threshold, adjusted once
more and filtered again; the robust loss on the reprojection errors and its scale are those of
pycolmap's options of that mapper. The adjustment with the positions of the photos and the biases
of the flights, the intrinsics freed in turn, the accuracy of the positions estimated again with
the redundancy of each (variance components after Foerstner, the trace of Hutchinson) and the
filter between the rounds that takes observations back are this package's own. The model on disk
- native/engine/src/mapper/model_io.rs - is written in COLMAP's binary format as
src/colmap/scene/reconstruction_io_binary.cc writes it (rigs.bin, cameras.bin, frames.bin,
images.bin and points3D.bin, their fields and their order), with a rig per camera and a frame per
image as src/colmap/scene/reconstruction_io_utils.cc makes them for a model without rigs; no file
of COLMAP is compiled into the extension.

RTKLIB's license (vendor/rtklib/license.txt) follows, then VLFeat's, then COLMAP's, then GLOMAP's.

================================================================================


The RTKLIB software package is distributed under the following BSD 2-clause
license. Users are permitted to develop, produce or sell their own non-
commercial or commercial products utilizing, linking or including RTKLIB as long
as they comply with the license.

--------------------------------------------------------------------------------

         Copyright (c) 2007-2020, T. Takasu, All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer. Redistributions in binary form must
reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the
distribution.

The software package includes some companion executive binaries or shared
libraries necessary to execute APs on Windows. These licenses succeed to the
original ones of these software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------

Notes:
Previous versions of RTKLIB until ver. 2.4.1 had been distributed under GPLv3
license.

================================================================================

VLFeat's license (its file COPYING) follows; it applies to native/engine/src/gpu_sift.rs and
native/engine/src/sift_cpu.rs as explained above.

--------------------------------------------------------------------------------

Copyright (C) 2007-11, Andrea Vedaldi and Brian Fulkerson
Copyright (C) 2012-13, The VLFeat Team
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================================================

COLMAP's license (its file COPYING.txt) follows; it applies to
native/engine/src/geometry/solvers.rs, ransac.rs, two_view.rs, native/engine/src/mapper/
triangulate.rs, rounds.rs and model_io.rs as explained above.

--------------------------------------------------------------------------------

The COLMAP library is licensed under the new BSD license. Note that this text
refers only to the license for COLMAP itself, independent of its dependencies,
which are separately licensed. Building COLMAP with these dependencies may
affect the resulting COLMAP license.

    Copyright (c), ETH Zurich and UNC Chapel Hill.
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:

        * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.

        * Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.

        * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of
          its contributors may be used to endorse or promote products derived
          from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.

================================================================================

GLOMAP's license (its file LICENSE) follows; it applies to native/engine/src/mapper/graph.rs and
native/engine/src/mapper/rotation.rs as explained above.

--------------------------------------------------------------------------------

Copyright (c) 2024, ETH Zurich.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

    * Neither the name of ETH Zurich nor the names of its contributors may
      be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
