colinlaney / animal-tracking

Object tracking with OpenCV in open field behavioral test (overhead view maze)
https://youtu.be/GebcshN4OdE
Creative Commons Zero v1.0 Universal
50 stars 23 forks source link

Two errors that I came across #6

Closed imr555 closed 5 years ago

imr555 commented 5 years ago

After pulling the latest version and running the code on the sample I came across this error

Traceback (most recent call last):
File "track.py", line 252, in <module>
floorCrop(filename)
File "track.py", line 91, in floorCrop
contours, hierarchy = cv2.findContours(mask, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
ValueError: too many values to unpack (expected 2)

Adding _, and a space before line 91, like this _, contours, hierarchy = cv2.findContours(mask, cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)`

I achieve another error sadly.This error comes after drawing a box around the rat,

Segmentation fault (core dumped)

colinlaney commented 5 years ago

@imr555, please pull new version.

imr555 commented 5 years ago

The previous issues are resolved. But theres a new error that has come up. After running the code twice each time at 120 sec, the program auto exits and this error shows up

Traceback (most recent call last):
  File "track.py", line 255, in <module>
    trace(filename)
  File "track.py", line 180, in trace
    x = int(M['m10']/M['m00'])
ZeroDivisionError: float division by zero
colinlaney commented 5 years ago

Yes, it's fixed too in c560eb0.