I'm using python 2.7 and opencv.
I'm trying to use:
cv2.resize(src, dst, Size(), 0.5, 0.5, interpolation=cv2.INTER_LINEAR);
NameError: global name 'Size' is not defined.
You are probably looking at the C++ api of
The python API looks something like this:
dst = cv2.resize(src, dsize)
src - Original image dsize - a tuple defining the final size of the image.
If you want to pass additional parameters then you may use the named parameters of the API as:
dst = cv2.resize(src, dsize, fx = 0.5, fy=0.5, interpolation = cv2.INTER_LINEAR)
Since dsize is required param but if you still want the
resize method to calculate the
dsize for you then you may pass the param as
dst = cv2.resize(src, None, fx = 0.5, fy=0.5)