Where the frame-registration engine came from ============================================= `src/engine/registration.js` is written in JavaScript, by us, and no line of any other project's source is copied into it. But its DESIGN is not ours, and several of the projects it was designed from carry notices that must travel with anything derived from them. This file is the register: for every piece, what was taken, from where, under which licence, and what the obligation is. It is published as part of the site rather than kept in the repository, because a notice that is not distributed with the thing it covers is not a notice. It is served at /vendor/registration/licences/registration-notices.txt 1. ASTERISM MATCHING -- astroalign, MIT --------------------------------------- TAKEN, as design: the triangle invariant pair [L3/L2, L2/L1] of the sorted side lengths; the canonical (a, b, c) vertex ordering, where a is the vertex shared by the two shortest sides and so on; the r = 0.1 ball match on the invariant plane; the one-triangle RANSAC whose inlier test is the MAXIMUM residual over a triangle's three vertices; and the "refit on everything that agreed" loop after it. CHANGED: the random draw that chooses which triangle to seed from is replaced by a vote over the (scale, rotation) each candidate implies, because on real frames the inlier fraction is about 0.5% and a bounded random search fails outright on two consecutive pairs in nine. A second, mutual exclusion by target as well as by source was added. The similarity fit is closed-form rather than scikit-image's general estimator. NOT TAKEN, deliberately: astroalign's own star detection. `astroalign.py:537` is `import sep` inside `_find_sources`, and `sep` is LGPL-3.0. astroalign's MIT covers the matching only. `sep`'s source, and SExtractor's, were not read. MIT License Copyright (c) 2016 Martin Beroiz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2. THE RANSAC INSIDE IT -- Andrew D. Straw, BSD-3-Clause -------------------------------------------------------- astroalign's `_ransac` carries this notice, and astroalign retains it. So do we, for the same reason: the structure of the routine our matcher is built on is his, by way of Beroiz's modification of it. Copyright (c) 2004-2007, Andrew D. Straw. 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 the Andrew D. Straw 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 OWNER 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. 3. THE CLOSED-FORM SIMILARITY -- scikit-image `_umeyama`, BSD-3-Clause ---------------------------------------------------------------------- TAKEN, as design: demean both point sets, form the cross-covariance, take the nearest orthogonal matrix by SVD, and flip the last singular direction when the determinant is negative so that the answer is a proper rotation rather than a reflection; then Umeyama's equations (41) and (42) for the scale. CHANGED: written out for two dimensions, where the SVD has a closed form -- the optimal angle is atan2(A10 - A01, A00 + A11) -- so no matrix decomposition is needed. `test/registration.test.js` checks the shortcut against a brute-force sweep over ten thousand angles, including reflected input. The underlying method is published: Shinji Umeyama, "Least-squares estimation of transformation parameters between two point patterns", IEEE PAMI 13(4), 1991, doi:10.1109/34.88573. Copyright (C) 2019, the scikit-image 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. 3. Neither the name of skimage 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 AUTHOR ``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 AUTHOR 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. 4. STAR DETECTION -- clean-roomed from a published description --------------------------------------------------------------- This is the piece astroalign could not supply, because its detector is the LGPL-3.0 `sep`. It is written instead from the published DAOFIND algorithm: P. B. Stetson, "DAOPHOT: A Computer Program for Crowded-Field Stellar Photometry", Publications of the Astronomical Society of the Pacific 99, 191 (1987). and from the DESIGN of photutils' `DAOStarFinder` -- the sequence of steps and the meaning of the sharpness and roundness statistics -- not from its source. The matched filter is re-derived here from first principles rather than transcribed: fitting `a * g + b` to the pixels under a Gaussian kernel by least squares gives `a = sum((g - mean g) * d) / sum((g - mean g)^2)`, so convolving with the mean-subtracted, energy-normalised Gaussian yields the least-squares amplitude of a star at every pixel, and a flat field of any level yields exactly zero. DELIBERATE DEPARTURES, so that nobody reads this as DAOFIND and expects DAOFIND's numbers: the sharpness statistic is normalised so that a perfect star of the assumed width scores exactly 1.0 rather than DAOFIND's 0.2-1.0 band; only the marginal-Gaussian roundness ("sround") is implemented and its default limit is deliberately loose, because a long exposure draws a star as a short streak and refusing elongated sources would refuse the frames this engine exists for; the sub-pixel centre is the first moment of the FILTERED image rather than a marginal Gaussian fit, which was chosen by measuring the registration error each produced; and the star width the filter is built for is measured from the effective pixel count rather than from a second moment, because this corpus is undersampled. photutils is BSD-3-Clause and its notice is retained here even though no line of it was copied, because its design is what the detector's shape came from. Copyright (c) 2011-2026, Photutils Developers 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. 3. Neither the name of the copyright holder 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 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. 5. THE RESAMPLING KERNELS -- published, no licence obligation ------------------------------------------------------------- The BC-spline family, of which Catmull-Rom (B = 0, C = 1/2) is the one this engine ships, is published mathematics: Don P. Mitchell and Arun N. Netravali, "Reconstruction Filters in Computer Graphics", SIGGRAPH '88, Computer Graphics 22(4), 221-228. The polynomial form is written out directly from that paper. Which member of the family to ship was decided by measurement on real stars, not by the paper's recommendation, and the measurements are in `src/engine/registration.js` and asserted in `test/registration.test.js`. 6. WHAT WAS NOT READ -------------------- Kept deliberately shut, and recorded so that a later reader knows the boundary was a decision rather than an oversight: sep LGPL-3.0 SExtractor GPL-3.0 DeepSkyStacker GPL, and the aircraft/registration code in it in particular OpenCV's estimateAffine* Apache-2.0, which is compatible, but it was not needed and reading it would have made the clean-room claim above unprovable None of these contributed anything to `src/engine/registration.js`. 7. THE FRAMES THE NUMBERS COME FROM ------------------------------------ Every accuracy figure in the engine and its tests was measured on real photographs, not simulations: Zenodo record 3736793, "A set of allsky camera images from latitude 55 degrees North", CC-BY-4.0. Ten 400x300 crops of it are committed as `test/fixtures/wide/wide-*.png`; the 38-frame measurement is reproduced by `research/registration-drift.mjs` against the published record.