GFZ / arosics

AROSICS - Automated and Robust Open-Source Image Co-Registration Software
https://git.gfz-potsdam.de/danschef/arosics
Apache License 2.0
150 stars 28 forks source link

Co-Registration of 2 Planet-Scope Scenes #12

Closed khanwaleed247 closed 2 years ago

khanwaleed247 commented 2 years ago

So , I have been trying to co-register 2 Planet Scope Images (24thMay2022 as Target and 12thMay2022 as Reference). Both the images have a valid Projection system. For testing I have created a small Patch of size 731*278 pixels, with the spatial resolution of 3 meters. Unfortunately I could observe no significant changes in the output image.

Following are the parameters I am using;

CRL = COREG_LOCAL(im_reference,im_target, min_reliability=0, resamp_alg_deshift='cubic', r_b4match=7, s_b4match=7, tieP_filter_level=0, v=True, **kwargs) CRL.correct_shifts()

Calculating footprint polygon and actual data corner coordinates for reference image...
Bounding box of calculated footprint for reference image:
    (331755.0, 3811431.0, 333948.0, 3812265.0)
Calculating footprint polygon and actual data corner coordinates for image to be shifted...
Bounding box of calculated footprint for image to be shifted:
    (331755.0, 3811431.0, 333948.0, 3812265.0)
resolutions:  3.0 3.0
100.00 percent of the image to be shifted is covered by the reference image.
Matching window position (X,Y): 332851.5/3811848.0
Initializing tie points grid...
Calculating tie point grid (22692 points) using 40 CPU cores...
    progress: |==================================================| 100.0% Complete  => 0:01:17
Found 15473 matches.
Visualizing CoReg points grid...
![image](https://user-images.githubusercontent.com/28726312/188570362-f4ca2e79-5771-4e68-81a0-6c88bb997b4c.png)

C:\ProgramData\Anaconda3\envs\arosics\lib\site-packages\arosics\Tie_Point_Grid.py:809: UserWarning: By far not more than 7000 tie points can be used for warping within a limited computation time (due to a GDAL bottleneck). Thus these 7000 points are randomly chosen out of the 15473 available tie points.
  warnings.warn('By far not more than 7000 tie points can be used for warping within a limited '
Correcting geometric shifts...
Translating progress |==================================================| 100.0% Complete  => 0:00:00
Warping progress     |==================================================| 100.0% Complete  => 0:03:32
Writing GeoArray of size (278, 731, 8) to C:\Users\Administrator\Arosics\my_project\24May2022_Subset_NDVI__shifted_to__12thMay2022_Stack_NDVI.bsq.
Time for shift correction: 213.66s
OrderedDict([('band', None),
             ('is shifted', True),
             ('is resampled', True),
             ('updated map info',
              ['UTM',
               1.0,
               1.0,
               331755.0,
               3812265.0,
               3.0,
               3.0,
               43,
               'North',
               'WGS-84']),
             ('updated geotransform',
              (331755.0, 3.0, 0.0, 3812265.0, 0.0, -3.0)),
             ('updated projection',
              'PROJCS["WGS 84 / UTM zone 43N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32643"]]'),
             ('arr_shifted',
              array([[[5.1691162e+02, 6.2286157e+02, 9.5002502e+02, ...,
                       1.4392135e+03, 3.7833020e+03, 6.1926514e-01],
                      [5.2485095e+02, 6.4213464e+02, 9.2360095e+02, ...,
                       1.4395481e+03, 3.8164568e+03, 6.3727146e-01],
                      [5.1366919e+02, 6.2153455e+02, 8.8556531e+02, ...,
                       1.4264115e+03, 3.8908386e+03, 6.5421081e-01],
                      ...,
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00]],

                     [[4.8211365e+02, 6.3224597e+02, 9.5452814e+02, ...,
                       1.4690365e+03, 3.7567310e+03, 6.1541229e-01],
                      [5.0605801e+02, 6.4919714e+02, 9.3783368e+02, ...,
                       1.4231816e+03, 3.7988254e+03, 6.2944686e-01],
                      [5.1318665e+02, 6.2196625e+02, 9.0978082e+02, ...,
                       1.4018073e+03, 3.7897664e+03, 6.3608944e-01],
                      ...,
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00]],

                     [[4.3969098e+02, 6.4787860e+02, 9.3250214e+02, ...,
                       1.5278831e+03, 3.7931028e+03, 6.2891763e-01],
                      [4.5031915e+02, 6.1409442e+02, 8.9264850e+02, ...,
                       1.5355651e+03, 3.8685659e+03, 6.5408939e-01],
                      [4.9446109e+02, 6.2649390e+02, 8.7522321e+02, ...,
                       1.4991145e+03, 3.7700913e+03, 6.5389913e-01],
                      ...,
                      [4.1612149e+02, 4.9888470e+02, 6.9238422e+02, ...,
                       1.1781205e+03, 3.2848918e+03, 6.2623322e-01],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00]],

                     ...,

                     [[5.6150049e+02, 7.2799567e+02, 9.4257562e+02, ...,
                       1.3858706e+03, 3.3391914e+03, 5.3953129e-01],
                      [5.6536530e+02, 7.7790088e+02, 9.6723969e+02, ...,
                       1.4955590e+03, 3.4495015e+03, 5.4462224e-01],
                      [6.1092493e+02, 7.8896686e+02, 1.0482058e+03, ...,
                       1.5426188e+03, 3.6017312e+03, 5.5377007e-01],
                      ...,
                      [4.4978790e+02, 5.4351776e+02, 8.3713287e+02, ...,
                       1.2971002e+03, 3.4834426e+03, 5.9206712e-01],
                      [4.5482117e+02, 5.6163263e+02, 8.4678961e+02, ...,
                       1.3083062e+03, 3.3055920e+03, 5.6058121e-01],
                      [4.5294797e+02, 5.9562366e+02, 8.7718829e+02, ...,
                       1.3207684e+03, 3.1543386e+03, 5.3590751e-01]],

                     [[5.6889673e+02, 7.6813019e+02, 9.4450049e+02, ...,
                       1.4431810e+03, 3.4461997e+03, 5.5896771e-01],
                      [5.9078284e+02, 8.0053156e+02, 9.8821832e+02, ...,
                       1.5254041e+03, 3.5515068e+03, 5.5965680e-01],
                      [6.2618774e+02, 7.8582227e+02, 1.0160637e+03, ...,
                       1.5985081e+03, 3.5878027e+03, 5.5603844e-01],
                      ...,
                      [4.3241763e+02, 5.5197534e+02, 8.1118701e+02, ...,
                       1.3490410e+03, 3.7112981e+03, 6.3143462e-01],
                      [4.3765381e+02, 5.4210858e+02, 7.9900201e+02, ...,
                       1.2938691e+03, 3.4908877e+03, 5.9475356e-01],
                      [4.4274686e+02, 5.7692609e+02, 8.3055682e+02, ...,
                       1.2853013e+03, 3.2458530e+03, 5.6592232e-01]],

                     [[0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      [0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,
                       0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
                      ...,
                      [4.4160391e+02, 5.6882043e+02, 7.9755798e+02, ...,
                       1.3799280e+03, 3.9198376e+03, 6.6877884e-01],
                      [4.4434021e+02, 5.4780078e+02, 8.0337720e+02, ...,
                       1.2980499e+03, 3.6674060e+03, 6.3202173e-01],
                      [4.4072449e+02, 5.4255408e+02, 8.1256836e+02, ...,
                       1.2559352e+03, 3.2854695e+03, 5.8393079e-01]]], dtype=float32)),
             ('GeoArray_shifted',
              <geoarray.baseclasses.GeoArray at 0x71a2c1a80>)])
CRL.view_CoRegPoints(figsize=(15,15), backgroundIm='ref')
danschef commented 2 years ago

Probably, it helps, if you post a screenshot of the target and reference images here (only those bands used for co-registration). How large is the actual shift between both images? I would recommend not to use too small subsets, this makes it harder to find the correct shift.

danschef commented 2 years ago

I close this due to inactivity. Feel free to re-open if needed.