Creating modules

As in the case of our CaptureManager and WindowManager classes, our filters should be reusable outside Cameo. Thus, we should separate the filters into their own Python module or file.

Let's create a file called filters.py in the same directory as cameo.py. We need the following import statements in filters.py:

import cv2
import numpy
import utils

Let's also create a file called utils.py in the same directory. It should contain the following import statements:

import cv2
import numpy
import scipy.interpolate

We will be adding filter functions and classes to filters.py, while more general-purpose math functions will go in utils.py.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.83.176