Skip to content

Commit

Permalink
Merge pull request #123 from gilestrolab/qgeissmann-patch-issue-122
Browse files Browse the repository at this point in the history
patch division by zero (#122)
  • Loading branch information
ggilestro authored Jul 16, 2020
2 parents 0d12148 + d618f21 commit 5a0a19e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ethoscope/trackers/adaptive_bg_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ def _pre_process_input_minimal(self, img, mask, t, darker_fg=True):
#
mean = cv2.mean(self._buff_grey, mask)

scale = 128. / mean[0]
try:
scale = 128. / mean[0]
except ZeroDivisionError:
raise NoPositionError

cv2.multiply(self._buff_grey, scale, dst = self._buff_grey)

Expand Down Expand Up @@ -508,4 +511,4 @@ def _track(self, img, grey, mask,t):


self._previous_shape=np.copy(hull)
return [out]
return [out]

0 comments on commit 5a0a19e

Please sign in to comment.