Skip to content

error during video compression #71

@cooketho

Description

@cooketho

I'm getting the following error when I use Tierpsy Tracker on the test data set:

Capture_Ch1_18062015_140908 Starting video compression.
ERROR: 
ValueError: not enough values to unpack (expected 3, got 2)
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
Traceback (most recent call last):
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 108, in <module>
    ProcessWorker(**args, cmd_original = subprocess.list2cmdline(sys.argv))
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 38, in __init__
    self.execAllPoints()
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 66, in execAllPoints
    cmd_original = self.cmd_original)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/trackProvenance.py", line 28, in execThisPoint
    func(**argkws)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/processVideo.py", line 142, in processVideo
    compressVideo(video_file, masked_image_file, **compress_vid_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 366, in compressVideo
    mask = getROIMask(img_reduce, **mask_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 76, in getROIMask
    mask.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
'/Users/tom/opt/anaconda3/envs/tierpsy/bin/python' '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py' '/Users/tom/Desktop/example_data/multiworm/Capture_Ch1_18062015_140908.mov' --masks_dir '/Users/tom/Tmp/MaskedVideos/' --results_dir '/Users/tom/Tmp/Results/' --json_file '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/extras/param_files/MULTIWORM_OPENWORM.json' --analysis_checkpoints 'COMPRESS' 'TRAJ_CREATE' 'TRAJ_JOIN' 'SKE_INIT' 'BLOB_FEATS' 'SKE_CREATE' 'SKE_FILT' 'SKE_ORIENT' 'INT_PROFILE' 'INT_SKE_ORIENT' 'FEAT_CREATE'
*************************************************
Tasks: 1 finished, 0 remaining. Total_time 0:00:48.
*************************************************

So I copied and pasted that last subprocess command to the command line, and got the following:

(tierpsy) Toms-MacBook-Pro:~ tom$ '/Users/tom/opt/anaconda3/envs/tierpsy/bin/python' '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py' '/Users/tom/Desktop/example_data/multiworm/Capture_Ch1_18062015_140908.mov' --masks_dir '/Users/tom/Tmp/MaskedVideos/' --results_dir '/Users/tom/Tmp/Results/' --json_file '/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/extras/param_files/MULTIWORM_OPENWORM.json' --analysis_checkpoints 'COMPRESS' 'TRAJ_CREATE' 'TRAJ_JOIN' 'SKE_INIT' 'BLOB_FEATS' 'SKE_CREATE' 'SKE_FILT' 'SKE_ORIENT' 'INT_PROFILE' 'INT_SKE_ORIENT' 'FEAT_CREATE'
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning:numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
Capture_Ch1_18062015_140908 Starting checkpoint: COMPRESS
COMPRESS
(1.0, 1.0, 'frames') (1.0, 'pixels') 1
Capture_Ch1_18062015_140908 Extracting video metadata...
Capture_Ch1_18062015_140908 Extracting video metadata. Total time = 0:00:14, fps = 37.0; Frame 500
Capture_Ch1_18062015_140908 Extracting video metadata. Total time = 0:00:29, fps = 32.4; Frame 1000
cannot read
Capture_Ch1_18062015_140908 Starting video compression.
Traceback (most recent call last):
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 108, in <module>
    ProcessWorker(**args, cmd_original = subprocess.list2cmdline(sys.argv))
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 38, in __init__
    self.execAllPoints()
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/ProcessWorker.py", line 66, in execAllPoints
    cmd_original = self.cmd_original)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/processing/trackProvenance.py", line 28, in execThisPoint
    func(**argkws)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/processVideo.py", line 142, in processVideo
    compressVideo(video_file, masked_image_file, **compress_vid_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 366, in compressVideo
    mask = getROIMask(img_reduce, **mask_param)
  File "/Users/tom/opt/anaconda3/envs/tierpsy/lib/python3.6/site-packages/tierpsy/analysis/compress/compressVideo.py", line 76, in getROIMask
    mask.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)

I saw in a closed post that some users had been having problems with openCV. I'm using the latest version, openCV version 4.2.0 on macOS Catalina 10.15.2. Could it be that Tierpsy is not compatible with the newest openCV? If so, can you please advise as to how this can be fixed? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions