Commit 4991fef7 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfix for deadlock in multiprocessing in case matching window size greater...

Bugfix for deadlock in multiprocessing in case matching window size greater than 2x grid_res. Bugfix for wrong image grid equalization in case reference image has a lower resolution than target image.

components.CoReg.COREG:
- equalize_pixGrids(): bugfix for not respecting which pixel grid is to be used for coregistration

components.Geom_Quality_Grid.Geom_Quality_Grid:
- get_CoRegPoints_table(): updated array caching calls

- updated __version__
parent ab3d5de9
......@@ -9,7 +9,7 @@ from .components import utilities
from .components import geometry
__author__ = 'Daniel Scheffler'
__version__= '2017-01-20_02'
__version__= '2017-01-20_03'
__all__=['COREG',
'COREG_LOCAL',
......
......@@ -381,8 +381,15 @@ class COREG(object):
if not (prj_equal(self.ref.prj, self.shift.prj) and self.ref.xygrid_specs==self.shift.xygrid_specs):
if not self.q: print("Equalizing pixel grids and projections of reference and target image...")
self.shift.arr = self.shift[:,:,self.shift.band4match]
self.shift.reproject_to_new_grid(prototype=self.ref, CPUs=self.CPUs)
if self.grid2use=='ref':
# resample target image to refernce image
self.shift.arr = self.shift[:,:,self.shift.band4match]
self.shift.reproject_to_new_grid(prototype=self.ref, CPUs=self.CPUs)
else:
# resample reference image to target image
# FIXME in case of different projections this will change the projection of the reference image!
self.ref.arr = self.ref[:,:,self.ref.band4match]
self.ref.reproject_to_new_grid(prototype=self.shift, CPUs=self.CPUs)
def show_image_footprints(self):
......
......@@ -251,8 +251,11 @@ class Geom_Quality_Grid(object):
global global_shared_imref,global_shared_im2shift
assert self.ref .footprint_poly # this also checks for mask_nodata and nodata value
assert self.shift.footprint_poly
if not self.ref .is_inmem: self.ref.cache_array_subset(self.ref [self.COREG_obj.ref .band4match])
if not self.shift.is_inmem: self.ref.cache_array_subset(self.shift[self.COREG_obj.shift.band4match])
# ensure the input arrays for CoReg are in memory -> otherwise the code will get stuck in multiprocessing if
# neighboured matching windows overlap during reading from disk!!
self.ref.cache_array_subset([self.COREG_obj.ref .band4match])
self.ref.cache_array_subset([self.COREG_obj.shift.band4match])
global_shared_imref = self.ref
global_shared_im2shift = self.shift
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment