dshean / demcoreg

Utilities for DEM and point cloud co-registration
MIT License
114 stars 45 forks source link

Fix polynomial fits to residuals #15

Open dshean opened 4 years ago

dshean commented 4 years ago

The initial dem_align.py planar fit to remove post-co-registration residuals worked well. The current n-order polynomial fit functionality is largely untested. User reports in Dec 2019 indicated this functionality is not working correctly, something that I was able to reproduce with quick tests, but didn't have the time to document and fix.

Change from geolib.ma_fitplane to geolib.ma_fitpoly: https://github.com/dshean/demcoreg/blob/abd6be75d326b35f52826ee30dff01f9e86b4b52/demcoreg/dem_align.py#L374

This pygeotools/geolib commit updated underlying fitting routines to support arbitrary higher-order polynomials: https://github.com/dshean/pygeotools/commit/fbd7b974b7b485ab65f7ed02224b531d7245d162#diff-0c9ae3a15902d51d1f8374a5976f4d79

Notes suggest we should consider numpy.polynomial.polynomial here. I need to revisit local branches - I thought I started this, but did not merge in master.

May be an issue of when/how the resulting "tiltcorr" correction is applied. I wanted another iteration of the main Nuth and Kaab optimization after the residual correction was removed, as it's possible that the final translation would be different after removing systematic residuals.

Should also rename command line option from -tiltcorr to -remove_residuals or something along those lines.