mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-26 07:39:22 +02:00
estimate_skew_contours: ensure retval is always float
This commit is contained in:
parent
26afc5ddab
commit
9801129aa6
1 changed files with 1 additions and 1 deletions
|
|
@ -330,7 +330,7 @@ def estimate_skew_contours(contours):
|
||||||
if not np.any(usable):
|
if not np.any(usable):
|
||||||
raise ValueError("not enough contours with consistent length")
|
raise ValueError("not enough contours with consistent length")
|
||||||
if np.count_nonzero(usable) == 1:
|
if np.count_nonzero(usable) == 1:
|
||||||
return angle_in[usable]
|
return angle_in[usable][0]
|
||||||
# 4. there is no way to distinguish between +90 and -89.9 here,
|
# 4. there is no way to distinguish between +90 and -89.9 here,
|
||||||
# so map to [0,180] when calculating averages, then map back to [-90,90]
|
# so map to [0,180] when calculating averages, then map back to [-90,90]
|
||||||
# (we don't want -90 and +89 to average zero, or +1 and +179 to average 90)
|
# (we don't want -90 and +89 to average zero, or +1 and +179 to average 90)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue