Commit 1dd27111 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Some enhancements

- changed default value of window size to 256 px

- plot functions now return figure instances

- _reliability_thresholding(): changed default of min_reliability to 60

coreg_cmd: changed default of '-ws' to 256

updated __version__
parent 8f24d8b1
......@@ -122,7 +122,7 @@ class COREG(object):
"""See help(COREG) for documentation!"""
def __init__(self, im_ref, im_tgt, path_out=None, fmt_out='ENVI', out_crea_options=None, r_b4match=1, s_b4match=1,
wp=(None,None), ws=(512, 512), max_iter=5, max_shift=5, align_grids=False, match_gsd=False,
wp=(None,None), ws=(256, 256), max_iter=5, max_shift=5, align_grids=False, match_gsd=False,
out_gsd=None, target_xyGrid=None, resamp_alg_deshift='cubic', resamp_alg_calc='cubic',
footprint_poly_ref=None, footprint_poly_tgt=None, data_corners_ref=None, data_corners_tgt=None,
nodata=(None,None), calc_corners=True, binary_ws=True, mask_baddata_ref=None, mask_baddata_tgt=None,
......@@ -148,7 +148,7 @@ class COREG(object):
:param s_b4match(int): band of shift image to be used for matching (starts with 1; default: 1)
:param wp(tuple): custom matching window position as map values in the same projection like the
reference image (default: central position of image overlap)
:param ws(tuple): custom matching window size [pixels] (default: (512,512))
:param ws(tuple): custom matching window size [pixels] (default: (256,256))
:param max_iter(int): maximum number of iterations for matching (default: 5)
:param max_shift(int): maximum shift distance in reference image pixel units (default: 5 px)
:param align_grids(bool): align the coordinate grids of the image to be and the reference image (default: 0)
......@@ -434,7 +434,7 @@ class Tie_Point_Grid(object):
ax = fig.add_subplot(111)
if include_outliers:
ax.scatter(tbl_ol[x_attr], tbl_ol[y_attr], marker='+', c='r', label='false positives')
ax.scatter(tbl_ol[x_attr], tbl_ol[y_attr], marker='+', c='r', label='false-positives')
ax.scatter(tbl_il[x_attr], tbl_il[y_attr], marker='+', c='g', label='valid tie points')
# set axis limits
......@@ -450,15 +450,15 @@ class Tie_Point_Grid(object):
plt.text(xlim[1]-(xlim[1]/20),-ylim[1]+(ylim[1]/20), 'RMSE: %s m' % np.round(rmse, 2), ha='right',
va='bottom', fontsize=fontsize, bbox=dict(facecolor='w', pad=None, alpha=0.8))
# add grid
# add grid and increase linewidth of middle line
xgl = ax.get_xgridlines()
middle_xgl = xgl[int(np.median(np.array(range(len(xgl)))))]
ygl = ax.get_ygridlines()
middle_ygl = ygl[int(np.median(np.array(range(len(ygl)))))]
[tick.label.set_fontsize(fontsize) for tick in ax.xaxis.get_major_ticks()]
......@@ -792,7 +792,7 @@ class Tie_Point_Refiner(object):
return self.GDF, self.new_cols
def _reliability_thresholding(self, min_reliability=30):
def _reliability_thresholding(self, min_reliability=60):
"""Exclude all records where estimated reliability of the calculated shifts is below the given threshold.
:param min_reliability:
......@@ -17,6 +17,8 @@ def subplot_2dline(XY_tuples, titles=None, shapetuple=None, grid=False):
return fig
def subplot_imshow(ims, titles=None, shapetuple=None, grid=False):
ims = [ims] if not isinstance(ims,list) else ims
......@@ -31,6 +33,8 @@ def subplot_imshow(ims, titles=None, shapetuple=None, grid=False):
return fig
def subplot_3dsurface(ims,shapetuple=None):
ims = [ims] if not isinstance(ims,list) else ims
......@@ -48,4 +52,6 @@ def subplot_3dsurface(ims,shapetuple=None):
ax.contour(X, Y, Z, zdir='y',, offset=im.shape[1])
ax.set_xlabel('X'); ax.set_ylabel('Y'); ax.set_zlabel('Z')
\ No newline at end of file
return fig
\ No newline at end of file
......@@ -175,7 +175,7 @@ if __name__ == '__main__':
"(default: central position of image overlap)", default=(None,None))
gloArg('-ws', nargs=2, metavar=('X size', 'Y size'), type=float,
help="custom matching window size [pixels] (default: (512,512))", default=(512,512))
help="custom matching window size [pixels] (default: (256,256))", default=(256,256))
gloArg('-max_iter', nargs='?', type=int, help="maximum number of iterations for matching (default: 5)", default=5)
Supports Markdown
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