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

Description of my problem about running long play video file #20

Closed hyukhoon closed 1 year ago

hyukhoon commented 1 year ago

Q: Specify input data (codec, resolution), processing time and resources, output errors, and whether you have tried to trim a long video.

A: Codec: Timed metadata, H.264, MPEG-4 AAC Resolution: 1080 * 1920 Processing time: 10 minutes Output errors:

Traceback (most recent call last):
  File "/Users/hyuk-hoon/Desktop/Animal/animal-tracking-master/track.py", line 287, in <module>
    trace(filename)
  File "/Users/hyuk-hoon/Desktop/Animal/animal-tracking-master/track.py", line 236, in trace
    imgContour = cv2.add(imgPoints, imgTrack)
cv2.error: OpenCV(4.7.0) /Users/runner/work/opencv-python/opencv-python/opencv/modules/core/src/arithm.cpp:650:
 error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array'
 (where arrays have the same size and the same number of channels), nor 'array op scalar',
 nor 'scalar op array' in function 'arithm_op'
colinlaney commented 1 year ago

It looks like you have reshaped the frame on 171, 188, or 197 line such that the shapes of inherited frames differ (imgPoingts and imgTrack). But you can't add matrices of different sizes.

It's almost impossible to debug the hidden code. Please make a fork of the repository, push your changes, and refer to it here.

Show an example of your frames (unprocessed (original) and processed by track.py if any).