AdamSpannbauer / python_video_stab

A Python package to stabilize videos using OpenCV
https://adamspannbauer.github.io/python_video_stab/html/index.html
MIT License
682 stars 118 forks source link

AttributeError: GFTT not a supported detector #4

Closed AdamSpannbauer closed 6 years ago

AdamSpannbauer commented 6 years ago

Recreation:

pip install -e git+https://github.com/AdamSpannbauer/python_video_stab.git#egg=vidstab[cv2]

Error:

Traceback (most recent call last):
  File "site-packages/imutils/feature/factories.py", line 81, in FeatureDetector_create
    detr = _DETECTOR_FACTORY[detector.upper()]
KeyError: 'GFTT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gen_example_output.py", line 6, in <module>
    stabilizer = VidStab()
  File "vidstab/vidstab/VidStab.py", line 56, in __init__
    blockSize=3)
  File "site-packages/imutils/feature/factories.py", line 86, in FeatureDetector_create
    raise AttributeError("{} not a supported detector".format(detector))
AttributeError: GFTT not a supported detector
AdamSpannbauer commented 6 years ago

Appears to be fixed after removing opencv-python as an extras_require.

Explanation:

The opencv-python package is actually a subset of opencv-contrib-python. Both packages are aliased as cv2 for import. If opencv-python is imported then no features of contrib are available. If opencv-contrib-python is imported then all features of contrib (and opencv-python) are available.