Importing legacy OpenCV modules from OpenCV 2 in Python

Some of the legacy modules like Horn Schunck Optical Flow in OpenCV 2.4 are located in cv instead of cv2 . Note that legacy modules are no longer available in OpenCV 3.

To be cross-platform compatible with OpenCV 2.4,

import cv2
from cv2 import cv

Instead of using OpenCV 2.4, use pure Python for Horn Schunck and Lucas Kanade Optical Flow

Tags:

Categories:

Updated:

Leave a Comment