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

Multi-polygon footprint: tie-points are computed, but image gets cut #35

Closed
remote-gianni opened this issue Jan 16, 2024 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@remote-gianni
Copy link

  • arosics version: 1.9.2
  • Python version: 3.11.6
  • Operating System: Windows 10 Pro

Description

I'm using AROSICS to perform local co-registration for several airborne flightlines.
For images with lines of missing data, not the entire flightlines get co-registered.

Unlike issue #23, the tie-points are actually computed, but the returned result gets cropped.

Is there a way to avoid AROSICS using py_tools_ds' fill_holes_within_poly() cropping the output?

What I Did

  • set calc_corners = False
  • pass the concave hulls of the image footprints instead

The image footprint:
footprint

The concave hull passed to AROSICS:
footprint_passed

The computed tie-points (graduated by absolute shift):
tie_points

The returned result (darkened):
result

The warning message:

...miniconda3\envs\arosics\Lib\site-packages\py_tools_ds\geo\vector\topology.py:199: RuntimeWarning: The given MultiPolygon contains 1 disjunct polygon(s) outside of the largest polygon. fill_holes_within_poly() will only return the largest polygon as a filled version.
@danschef
Copy link
Collaborator

Hi! Could you provide some more information how you called AROSICS and which step exactly crops your result? Is it the call of the COREG_LOCAL.correct_shifts method that crops it?

@danschef danschef added the enhancement New feature or request label Jan 17, 2024
@remote-gianni
Copy link
Author

Hi Daniel

Thanks for your quick reply.

Yes, I'm using COREG_LOCAL. Pointing out the correct_shifts() method already resolved my "issue"; the 'cliptoextent' argument was set to True in my code as attached below. Setting it back to its actual default value results in AROSICS shifting the entire image as expected.

Thanks a lot!

from arosics import COREG_LOCAL

# avoid error messages if reference does not cover entire image
import numpy as np
np.seterr(divide="ignore", invalid="ignore") 

reference = some image
reference_footprint = some concave hull
target = some other image
target_footprint = some other concave hull
out_path = some output path for the co-registered image
out_points = some output path for the tie-point grid

kwargs = {
    "grid_res": 50, 
    "window_size": (64, 64),
    "path_out": out_path,
    "fmt_out": "ENVI",
    "out_crea_options": None,
    "q": False,
    "nodata": (0, 0),
    "calc_corners": False,
    "ignore_errors": True,
    "footprint_poly_ref": reference_footprint,
    "footprint_poly_tgt": target_footprint,
    "max_shift": 5,
    "tieP_filter_level": 2,
}

CRL = COREG_LOCAL(reference, target, **kwargs)
CRL.correct_shifts(cliptoextent=True) 

CRL.CoRegPoints_table.to_csv(out_points, index=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants