Skip to content

Commit

Permalink
fixes negative sqrt input silently failing
Browse files Browse the repository at this point in the history
  • Loading branch information
dlangenk committed Jul 23, 2024
1 parent a7c9666 commit e3522e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/resources/scripts/delphi_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@
s = 1.5 * laserdist
are = np.sqrt(s * np.power(s - laserdist, 3))
s = (a + b + c) / 2.
apx = np.sqrt(s * (s - a) * (s - b) * (s - c))
sqrtinp = s * (s - a) * (s - b) * (s - c)
if sqrtinp < 0:
print(json.dumps({
"error": True,
"message": "Computed pixel area is invalid.",
"method": detection
}))
exit(1)
apx = np.sqrt(sqrtinp)
if apx == 0:
print(json.dumps({
"error": True,
Expand Down

0 comments on commit e3522e5

Please sign in to comment.