Skip to content

Commit

Permalink
add opencv dependency since headblur effect depends on it. (#540)
Browse files Browse the repository at this point in the history
fix CV_AA error when opencv version > 3
  • Loading branch information
bearney74 authored Apr 12, 2017
1 parent f6ceee3 commit 497e213
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ before_install:
- sudo apt-get install -y ffmpeg
- mkdir media
install:
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' || $TRAVIS_PYTHON_VERSION == '3.5' || $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install matplotlib; pip install -U scikit-learn; pip install scipy; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install scipy; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' || $TRAVIS_PYTHON_VERSION == '3.5' || $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install matplotlib; pip install -U scikit-learn; pip install scipy; pip install opencv-python; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install scipy; pip install opencv-python; fi
- pip install coveralls
- pip install pytest-cov
- python setup.py install
Expand Down
4 changes: 3 additions & 1 deletion moviepy/video/fx/headblur.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
try:
import cv2
headblur_possible = True
if cv2.__version__ >= '3.0.0':
cv2.CV_AA=cv2.LINE_AA
except:
headblur_possible = False
#-----------------------------------------------------------------------
Expand Down Expand Up @@ -51,7 +53,7 @@ def fl(gf,t):
if not headblur_possible:
doc = headblur.__doc__
def headblur(clip,fx,fy,r_zone,r_blur=None):
raise IOError("fx painting needs scikit-image or scipy")
raise IOError("fx painting needs opencv")

headblur.__doc__ = doc
#-----------------------------------------------------------------------

0 comments on commit 497e213

Please sign in to comment.