Commit 82629ef7 authored by Daniel Scheffler's avatar Daniel Scheffler Committed by Daniel Scheffler
Browse files

Replaced all occurrences of "quality grid" with "tie point grid". Updated version info.

parent 2fe651ce
Pipeline #1149 passed with stages
in 6 minutes and 14 seconds
......@@ -327,7 +327,7 @@ CRL.correct_shifts()
Corner coordinates of image to be shifted:
[[319460.0, 5790510.0], [352270.0, 5900040.0], [409790.0, 5900040.0], [409790.0, 5790250.0], [319460.0, 5790250.0]]
Matching window position (X,Y): 372220.10753674706/5841066.947109019
Calculating geometric quality grid (1977 points) in mode 'multiprocessing'...
Calculating tie point grid (1977 points) in mode 'multiprocessing'...
progress: |==================================================| 100.0% [1977/1977] Complete 9.75 sek
Found 1144 valid GCPs.
Correcting geometric shifts...
......@@ -379,9 +379,9 @@ CRL = COREG_LOCAL(GeoArray(ref_ndarray, ref_gt, ref_prj),GeoArray(tgt_ndarray, t
CRL.correct_shifts()
```
#### visualize geometric quality grid with INITIAL shifts present in your input target image
#### visualize tie point grid with INITIAL shifts present in your input target image
Use the function COREG_LOCAL.view_CoRegPoints() to visualize the geometric quality grid with the calculated absolute lenghts of the shift vectors (the unit corresponds to the input projection - UTM in the shown example, thus the unit is 'meters'.).
Use the function COREG_LOCAL.view_CoRegPoints() to visualize the tie point grid with the calculated absolute lenghts of the shift vectors (the unit corresponds to the input projection - UTM in the shown example, thus the unit is 'meters'.).
NOTE: a calculation of reliable shifts above cloud covered areas is not possible. In the current version of AROSICS these areas are not masked. A proper masking is planned.
......@@ -401,7 +401,7 @@ CRL.view_CoRegPoints(figsize=(15,15),backgroundIm='ref')
The output figure shows the calculated absolute lenghts of the shift vectors - in this case with shifts up to ~25 meters.
#### visualize geometric quality grid with shifts present AFTER shift correction
#### visualize tie point grid with shifts present AFTER shift correction
The remaining shifts after local correction can be calculated and visualized by instanciating COREG_LOCAL with the output path of the above instance of COREG_LOCAL.
......@@ -419,7 +419,7 @@ CRL_after_corr.view_CoRegPoints(figsize=(15,15),backgroundIm='ref')
[[319460.0, 5790540.0], [352270.0, 5900030.0], [409780.0, 5900030.0], [409780.0, 5790260.0], [322970.0, 5790250.0], [319460.0, 5790280.0]]
Matching window position (X,Y): 372216.38593955856/5841068.390957352
Note: array has been downsampled to 1000 x 1000 for faster visualization.
Calculating geometric quality grid (1977 points) in mode 'multiprocessing'...
Calculating tie point grid (1977 points) in mode 'multiprocessing'...
progress: |==================================================| 100.0% [1977/1977] Complete 10.78 sek
......@@ -429,7 +429,7 @@ CRL_after_corr.view_CoRegPoints(figsize=(15,15),backgroundIm='ref')
The output figure shows a significant reduction of geometric shifts.
#### show the points table of the calculated geometric quality grid
#### show the points table of the calculated tie point grid
NOTE: Point records where no valid match has been found are filled with -9999.
......@@ -1507,11 +1507,11 @@ CRL.CoRegPoints_table
#### export geometric quality grid to an ESRI point shapefile
#### export tie point grid to an ESRI point shapefile
```python
CRL.quality_grid.to_PointShapefile(path_out='/path/to/your/output_shapefile.shp')
CRL.tiepoint_grid.to_PointShapefile(path_out='/path/to/your/output_shapefile.shp')
```
......
......@@ -48,7 +48,7 @@ class COREG_LOCAL(object):
:param im_ref(str, GeoArray): source path of reference image (any GDAL compatible image format is supported)
:param im_tgt(str, GeoArray): source path of image to be shifted (any GDAL compatible image format is
supported)
:param grid_res: quality grid resolution in pixels of the target image (x-direction)
:param grid_res: tie point grid resolution in pixels of the target image (x-direction)
:param max_points(int): maximum number of points used to find coregistration tie points
NOTE: Points are selected randomly from the given point grid (specified by
'grid_res'). If the point does not provide enough points, all available points
......@@ -115,7 +115,7 @@ class COREG_LOCAL(object):
ignored if footprint_poly_ref is given.
:param data_corners_tgt(list): map coordinates of data corners within image to be shifted.
ignored if footprint_poly_tgt is given.
:param outFillVal(int): if given the generated geometric quality grid is filled with this value in case
:param outFillVal(int): if given the generated tie point grid is filled with this value in case
no match could be found during co-registration (default: -9999)
:param nodata(tuple): no data values for reference image and image to be shifted
:param calc_corners(bool): calculate true positions of the dataset corners in order to get a useful
......@@ -138,7 +138,7 @@ class COREG_LOCAL(object):
geographic extent and projection like 'im_ref'. The mask is used to
check if the chosen matching window position is valid in the sense of
useful data. Otherwise this window position is rejected.
:param CPUs(int): number of CPUs to use during calculation of geometric quality grid
:param CPUs(int): number of CPUs to use during calculation of tie point grid
(default: None, which means 'all CPUs available')
:param progress(bool): show progress bars (default: True)
:param v(bool): verbose mode (default: False)
......@@ -244,7 +244,7 @@ class COREG_LOCAL(object):
if mask_baddata_tgt is not None:
self.COREG_obj.shift.mask_baddata = mask_baddata_tgt
self._tiepoint_grid = None # set by self.quality_grid
self._tiepoint_grid = None # set by self.tiepoint_grid
self._CoRegPoints_table = None # set by self.CoRegPoints_table
self._coreg_info = None # set by self.coreg_info
self.deshift_results = None # set by self.correct_shifts()
......@@ -317,7 +317,7 @@ class COREG_LOCAL(object):
def CoRegPoints_table(self):
"""Returns a GeoDataFrame with the columns 'geometry','POINT_ID','X_IM','Y_IM','X_UTM','Y_UTM','X_WIN_SIZE',
'Y_WIN_SIZE','X_SHIFT_PX','Y_SHIFT_PX', 'X_SHIFT_M', 'Y_SHIFT_M', 'ABS_SHIFT' and 'ANGLE' containing all
information containing all the results frm coregistration for all points in the geometric quality grid.
information containing all the results frm coregistration for all points in the tie point grid.
"""
return self.tiepoint_grid.CoRegPoints_table
......@@ -337,9 +337,9 @@ class COREG_LOCAL(object):
def view_CoRegPoints(self, attribute2plot='ABS_SHIFT', cmap=None, exclude_fillVals=True, backgroundIm='tgt',
hide_filtered=True, figsize=None, savefigPath='', savefigDPI=96, showFig=True,
vmin=None, vmax=None, return_map=False, zoomable=False):
"""Shows a map of the calculated quality grid with the target image as background.
"""Shows a map of the calculated tie point grid with the target image as background.
:param attribute2plot: <str> the attribute of the quality grid to be shown (default: 'ABS_SHIFT')
:param attribute2plot: <str> the attribute of the tie point grid to be shown (default: 'ABS_SHIFT')
:param cmap: <plt.cm.<colormap>> a custom color map to be applied to the plotted grid points
(default: 'RdYlGn_r')
:param exclude_fillVals: <bool> whether to exclude those points of the grid where spatial shift detection
......@@ -372,7 +372,7 @@ class COREG_LOCAL(object):
# fig, ax, map2show = backgroundIm.show_map_utm(figsize=(20,20), nodataVal=self.nodata[1], return_map=True)
plt.title(attribute2plot)
# transform all points of quality grid to LonLat
# transform all points of tie point grid to LonLat
outlierCols = [c for c in self.CoRegPoints_table.columns if 'OUTLIER' in c]
attr2include = ['geometry', attribute2plot] + outlierCols + ['X_SHIFT_M', 'Y_SHIFT_M']
GDF = self.CoRegPoints_table.loc[self.CoRegPoints_table.X_SHIFT_M != self.outFillVal, attr2include].copy()\
......@@ -401,7 +401,7 @@ class COREG_LOCAL(object):
palette = cmocean.cm.delta
# GDF['color'] = [*GDF[attribute2plot].map(lambda val: palette(norm(val)))]
# add quality grid to map
# add tie point grid to map
# plot_point = lambda row: \
# ax.plot(*map2show(*row['LonLat']), marker='o', markersize=7.0, alpha=1.0, color=row['color'])
# GDF.apply(plot_point, axis=1)
......@@ -472,7 +472,7 @@ class COREG_LOCAL(object):
def view_CoRegPoints_folium(self, attribute2plot='ABS_SHIFT', cmap=None, exclude_fillVals=True):
warnings.warn(UserWarning('This function is still under construction and may not work as expected!'))
assert self.CoRegPoints_table is not None, 'Calculate quality grid first!'
assert self.CoRegPoints_table is not None, 'Calculate tie point grid first!'
try:
import folium
......@@ -550,7 +550,7 @@ class COREG_LOCAL(object):
return self.coreg_info
def correct_shifts(self, max_GCP_count=None, cliptoextent=False, min_points_local_corr=5):
"""Performs a local shift correction using all points from the previously calculated geometric quality grid
"""Performs a local shift correction using all points from the previously calculated tie point grid
that contain valid matches as GCP points.
:param max_GCP_count: <int> maximum number of GCPs to use
......
......@@ -322,7 +322,7 @@ class Tie_Point_Grid(object):
if self.CPUs is None or self.CPUs > 1:
if not self.q:
cpus = self.CPUs if self.CPUs is not None else multiprocessing.cpu_count()
print("Calculating tie points grid (%s points) using %s CPU cores..." % (len(GDF), cpus))
print("Calculating tie point grid (%s points) using %s CPU cores..." % (len(GDF), cpus))
with multiprocessing.Pool(self.CPUs, initializer=mp_initializer, initargs=(self.ref, self.shift)) as pool:
if self.q or not self.progress:
......@@ -350,7 +350,7 @@ class Tie_Point_Grid(object):
global_shared_im2shift = self.shift
if not self.q:
print("Calculating tie points grid (%s points) 1 CPU core..." % len(GDF))
print("Calculating tie point grid (%s points) 1 CPU core..." % len(GDF))
results = np.empty((len(geomPoints), 14), np.object)
bar = ProgressBar(prefix='\tprogress:')
for i, coreg_kwargs in enumerate(list_coreg_kwargs):
......
......@@ -11,8 +11,8 @@ from arosics.Tie_Point_Grid import Tie_Point_Grid
__author__ = """Daniel Scheffler"""
__email__ = 'daniel.scheffler@gfz-potsdam.de'
__version__ = '0.4.32'
__versionalias__ = '2017-09-13_01'
__version__ = '0.4.33'
__versionalias__ = '2017-09-13_02'
# check optional dependencies
......
......@@ -253,7 +253,7 @@ def get_arosics_argparser():
locArg('path_tgt', type=str, help='source path of image to be shifted (any GDAL compatible image format is supported)')
locArg('grid_res', type=int, help='quality grid resolution in pixels of the target image')
locArg('grid_res', type=int, help='tie point grid resolution in pixels of the target image')
locArg('-max_points', nargs='?', type=int,
help="maximum number of points used to find coregistration tie points. NOTE: Points are selected randomly "
......
......@@ -27,7 +27,7 @@ test_requirements = requirements + ['coverage', 'nose', 'nose-htmloutput', 'redn
setup(
name='arosics',
version='0.4.32',
version='0.4.33',
description="An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data",
long_description=readme + '\n\n' + history,
author="Daniel Scheffler",
......
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