Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Scheffler
py_tools_ds
Commits
911f5847
Commit
911f5847
authored
Jan 25, 2017
by
Daniel Scheffler
Committed by
Mathias Peters
Jan 25, 2017
Browse files
added assertion
geo.coord_calc.calc_FullDataset_corner_positions(): - added input assertion
parent
a6a86d10
Changes
1
Hide whitespace changes
Inline
Side-by-side
ptds/geo/coord_calc.py
View file @
911f5847
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment