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

How to apply the CoRegPoints of one band tif file to other bands tif file? #32

Open
rubikube2237 opened this issue Sep 22, 2023 · 1 comment

Comments

@rubikube2237
Copy link

  • arosics version: 1.9.2
  • Python version: 3.9
  • Operating System: Ubuntu

Description

Now I have a task, correcting displacements of different bands tif files of one multiband image with Landsat-8 images. Because the limitted CPU numbers, I found correcting one band tif file takes about 5 mins, and I have 10 bands, the time consuming is unbearing in my task.
I have tried to tune the grid_res, and I can get the result in 3 mins, with around 3000 tie points. I wonder if this number of points is enough, as well as, the 3 mins for one band is still long to me.
I found different bands always calculate same number of tie points, so I guess these tie points are at the same coordinate points in every band tif file. I wonder if I could just calculate the points only once, and applying them to other bands tif file? Because I found the main time usage of the correction is tie points grid calculation, and this will save a lot of time.
Or are there other ways to reduce time? I tried to use the global correction method, but I don't know how to judge the quality of the results.
Thank you in advance!

@roelofvandijkO
Copy link

roelofvandijkO commented Feb 26, 2024

It seems like your bands are in separate tif files.

Option 1

Arosics can warp multiband images while only determining the warp on one band. Try combining your 10 bands into one file and process that. You can choose the band used for GCP determination with the r_b4match and s_b4match parameters. Only one band will be used for GCP determination. Look into gdalmerge.py for merging the bands.

Option 2

Use the DESHIFTER class. Use one band to determine the warp, then use DESHIFTER(im_target1, CR.coreg_info).correct_shifts() on each image.

Option 3

If you want to do it manually, here is one way: Use gdalwarp from the Python bindings or from the command line. Here is an example.

Again, determine the warp on one band. CRL_local.coreg_info["GCPList"] will return a list of osgeo.gdal.GCP which you can directly use in the gdalwarp call.

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

No branches or pull requests

2 participants