You need to have opencv installed in your system.
If you don't have it installed follow these steps to install opencv first.
For windows users: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_setup/py_setup_in_windows/py_setup_in_windows.html
For Linux users: https://docs.opencv.org/3.4/d7/d9f/tutorial_linux_install.html