Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-structure coregistration affine methods, point-raster pre-processing, binning and fitting, and add pixel interpretation support #530

Merged
merged 30 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53c34f3
Incremental commit on affine reorg
rhugonnet May 24, 2024
ea0d71c
Merge remote-tracking branch 'upstream/main' into reorg_affine
rhugonnet Jun 7, 2024
77eabe1
Incremental commit to reorg
rhugonnet Jun 10, 2024
11449c1
Fix resolution error
rhugonnet Aug 6, 2024
f2c5952
Merge remote-tracking branch 'upstream/main' into reorg_affine
rhugonnet Aug 6, 2024
d23e3f1
Finalize same CRS reprojection based on SciPy, add test with GDAL rep…
rhugonnet Aug 6, 2024
0a4cca4
Add further comments on tests
rhugonnet Aug 6, 2024
7272267
Incremental commit to new affine coregs
rhugonnet Aug 23, 2024
4c1944f
Finalize new structure
rhugonnet Aug 24, 2024
530eaf5
Linting but not all mypy
rhugonnet Aug 24, 2024
fad5e89
Linting
rhugonnet Aug 27, 2024
be3bd68
Finalize tests and linting
rhugonnet Aug 28, 2024
c907bbd
Implement new coreg nested dictionary structure
rhugonnet Aug 29, 2024
ba0a7e3
Linting and corrections
rhugonnet Aug 29, 2024
f575f3f
Last adjustments
rhugonnet Aug 30, 2024
e878f9c
Linting
rhugonnet Aug 30, 2024
d082779
Last test fixes
rhugonnet Aug 30, 2024
b31acf9
Amaurys comments
rhugonnet Sep 4, 2024
ed62d57
Update geoutils' version
rhugonnet Sep 4, 2024
6f62783
Try with lower threshold
rhugonnet Sep 4, 2024
3d13cfa
Fix tests
rhugonnet Sep 4, 2024
1076a2b
Linting
rhugonnet Sep 4, 2024
021d783
Change default tolerance for tests
rhugonnet Sep 4, 2024
b01bbf7
Try like this
rhugonnet Sep 4, 2024
0c142f4
Linting
rhugonnet Sep 4, 2024
4884a12
Add tests for Coreg.info()
rhugonnet Sep 4, 2024
0a2d2b4
Linting
rhugonnet Sep 4, 2024
8cdc72a
Add test for Coreg.info
rhugonnet Sep 5, 2024
57d2055
Enlarge tolerance now that shifts are not in pixels anymore
rhugonnet Sep 5, 2024
bb0b6e3
Skip DirectionalBias test
rhugonnet Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- tqdm
- scikit-image=0.*
- scikit-gstat>=1.0,<1.1
- geoutils=0.1.8
- geoutils=0.1.9

# Development-specific, to mirror manually in setup.cfg [options.extras_require].
- pip
Expand Down
1 change: 0 additions & 1 deletion doc/source/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ To build and pass your coregistration pipeline to {func}`~xdem.DEM.coregister_3d
xdem.coreg.VerticalShift
xdem.coreg.NuthKaab
xdem.coreg.ICP
xdem.coreg.Tilt
```

### Bias-correction (including non-affine coregistration) methods
Expand Down
31 changes: 1 addition & 30 deletions doc/source/coregistration.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,35 +144,6 @@ aligned_dem = nuth_kaab.apply(tba_dem)
:add-heading:
```

## Tilt

{class}`xdem.coreg.Tilt`

- **Performs:** A 2D plane tilt correction.
- **Supports weights** (soon)
- **Recommended for:** Data with no horizontal offset and low to moderate rotational differences.

Tilt correction works by estimating and correcting for an 1-order polynomial over the entire dDEM between a reference and the DEM to be aligned.
This may be useful for correcting small rotations in the dataset, or nonlinear errors that for example often occur in structure-from-motion derived optical DEMs (e.g. Rosnell and Honkavaara [2012](https://doi.org/10.3390/s120100453); Javernick et al. [2014](https://doi.org/10.1016/j.geomorph.2014.01.006); Girod et al. [2017](https://doi.org/10.5194/tc-11-827-2017)).

### Limitations

Tilt correction does not account for horizontal (X/Y) shifts, and should most often be used in conjunction with other methods.
It is not perfectly equivalent to a rotational correction: values are simply corrected in the vertical direction, and therefore includes a horizontal scaling factor, if it would be expressed as a transformation matrix.
For large rotational corrections, [ICP] is recommended.

### Example

```{code-cell} ipython3
# Instantiate a tilt object.
tilt = coreg.Tilt()
# Fit the data to a suitable polynomial solution.
tilt.fit(ref_dem, tba_dem, inlier_mask=inlier_mask)

# Apply the transformation to the data (or any other data)
deramped_dem = tilt.apply(tba_dem)
```

## Vertical shift

{class}`xdem.coreg.VerticalShift`
Expand Down Expand Up @@ -278,7 +249,7 @@ The approach does not account for rotations in the dataset, however, so a combin
For small rotations, a 1st degree deramp could be used:

```{code-cell} ipython3
coreg.NuthKaab() + coreg.Tilt()
coreg.NuthKaab() + coreg.Deramp(poly_order=1)
```

For larger rotations, ICP is the only reliable approach (but does not outperform in sub-pixel accuracy):
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- tqdm
- scikit-image=0.*
- scikit-gstat>=1.0,<1.1
- geoutils=0.1.8
- geoutils=0.1.9
- pip

# To run CI against latest GeoUtils
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ scipy>=1.0,<1.13
tqdm
scikit-image==0.*
scikit-gstat>=1.0,<1.1
geoutils==0.1.8
geoutils==0.1.9
pip
Loading
Loading