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 handle separate image parts #23

Open
DesperationSoftware opened this issue Jun 7, 2023 · 3 comments
Open

How to handle separate image parts #23

DesperationSoftware opened this issue Jun 7, 2023 · 3 comments

Comments

@DesperationSoftware
Copy link

  • arosics version: 1.9.0
  • Python version: 3.10.11
  • Operating System: Windows 10 Enterprise

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
Copy link
Collaborator

danschef commented Jun 7, 2023

Could you post an RGB screenshot of the target image?

@DesperationSoftware
Copy link
Author

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
Copy link
Collaborator

danschef commented Jun 7, 2023

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.

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