Skip to content

get_velocities fails for non-Farneback algorithms because _get_velocities is None #106

Description

@hrehmaan

Hello Henrik

I noticed that mps_motion.list_optical_flow_algorithm() reports the following algorithms:

['farneback', 'dualtvl1', 'lucas_kanade', 'block_matching']

However, when I try to use get_velocities() with algorithms other than farneback, it fails because _get_velocities is None.

Than I tested

import mps
import mps_motion

data = mps.MPS("Control_1.czi", channel=1)

for alg in mps_motion.list_optical_flow_algorithm():
    opt_flow = mps_motion.OpticalFlow(data, flow_algorithm=alg)
    print("\nAlgorithm:", alg)
    print("_get_velocities:", opt_flow._get_velocities)
    print("callable:", callable(opt_flow._get_velocities))

and the output of it
Algorithm: farneback
_get_velocities: <function get_velocities at 0x1245656c0>
callable: True

Algorithm: dualtvl1
_get_velocities: None
callable: False

Algorithm: lucas_kanade
_get_velocities: None
callable: False

Algorithm: block_matching
_get_velocities: None
callable: False

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions