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

How to handle separate image parts #23

Open DesperationSoftware opened 1 year ago

DesperationSoftware commented 1 year ago

Description

I was trying to coregister two image on my hard-drive. The two images are single band and in ENVI format (.dat + .hdr) and as far as I know they are whole continuous rasters. The polygonization for the reference image goes smoothly, but for the target image I do receive this warning message: "UserWarning: The footprint of the image to be shifted contains multiple separate image parts. AROSICS will only process the largest image part.".

What does this mean? What are these "image parts" and how should I address this?

What I Did

from arosics import COREG
im_reference='path/to/reference/reference.dat'
im_target='path/to/target/target.dat
CR = COREG(im_reference,im_target,path_out='auto',ws=(1000,1000),max_iter=10,max_shift=5000)

Calculating footprint polygon and actual data corner coordinates for reference image...
Polygonize progress     |==================================================| 100.0% Complete  => 0:00:13
Bounding box of calculated footprint for reference image:
    (8.59946497, 39.755379260520726, 8.602139895096082, 39.7569057540526)
Automatically detected nodata value for GeoArray_CoReg 'multi_0r100_96_banda550_ROI2': 0.0
Calculating footprint polygon and actual data corner coordinates for image to be shifted...
Polygonize progress     |==================================================| 100.0% Complete  => 0:00:01
C:\Users\Modelstation\anaconda3\envs\geospat\lib\site-packages\arosics\CoReg.py:131: UserWarning: The footprint of the image to be shifted contains multiple separate image parts. AROSICS will only process the largest image part.
  warnings.warn('The footprint of the %s contains multiple separate image parts. '
Bounding box of calculated footprint for image to be shifted:
    (8.60030944, 39.755828594898944, 8.600481910600001, 39.755989860377824)
Matching window position (X,Y): 8.600379388116444/39.7559138623294
danschef commented 1 year ago

Could you post an RGB screenshot of the target image?

DesperationSoftware commented 1 year ago

Unfortunately RGB no because it's a single band, but I think I see the problem now. The image is a strip of land imaged by a UAV and there are parts where, due to geometric errors, the strip is interrupted by small sections of no data value. I guess that AROSICS finds these sections of separated data values and considers them separate parts. In fact, this does not happen in the reference image which does not have these kind of artefacts.

danschef commented 1 year ago

That is exactly the problem, yes. AROSICS is mainly written for satellite image data which usually not consist of several large parts but in some cases may have some fragmented data (very small parts) for which it does not make sense to compute any tie points. Therefore, AROSICS only computes them for the largest part at the moment.

However, it would make sense to consider the number of pixels in every part to make sure only small parts are skipped. I will see if I can improve that if I have some time left. As a workaround, you can simply disable the automatic footprint computation by setting the calc_corners parameter to False. This may slow down the computation time but allows you to compute a result.