Commit 911f5847 authored by Daniel Scheffler's avatar Daniel Scheffler Committed by Mathias Peters
Browse files

added assertion

geo.coord_calc.calc_FullDataset_corner_positions():
- added input assertion
parent a6a86d10
......@@ -41,6 +41,10 @@ def calc_FullDataset_corner_positions(mask_1bit, assert_four_corners=True, algor
:return: [UL, UR, LL, LR] as [(ULrow,ULcol),(URrow,URcol),...]
"""
pixVals = np.unique(mask_1bit)
assert True in pixVals or 1 in pixVals, 'According to the given mask the mask extent is completely outside the ' \
'image. No calculation of image corner coordinates possible.'
rows, cols = mask_1bit.shape[:2]
if sum([mask_1bit[0,0], mask_1bit[0,cols-1], mask_1bit[rows-1,0], mask_1bit[rows-1,cols-1]]) == 4:
......
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