Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用OpenCV 2.4.10和Python 2.7.10调整错误大小_Python_Opencv_Image Processing - Fatal编程技术网

使用OpenCV 2.4.10和Python 2.7.10调整错误大小

使用OpenCV 2.4.10和Python 2.7.10调整错误大小,python,opencv,image-processing,Python,Opencv,Image Processing,我正在尝试使用OpenCV 2.4.10和Python 2.7.10调整图像的大小 这项工作: resized_patch = cv2.resize(patch, (3, 50, 50)) 但是,我对使用INTER_区域插值感兴趣。接下来,我试着: dst = numpy.zeros((3, 50, 50)) resized_patch = cv2.resize(patch, (3, 50, 50), dst=dst, fx=0, fy=0, interpolation=cv2.INTER_A

我正在尝试使用OpenCV 2.4.10和Python 2.7.10调整图像的大小

这项工作:

resized_patch = cv2.resize(patch, (3, 50, 50))
但是,我对使用INTER_区域插值感兴趣。接下来,我试着:

dst = numpy.zeros((3, 50, 50))
resized_patch = cv2.resize(patch, (3, 50, 50), dst=dst, fx=0, fy=0, interpolation=cv2.INTER_AREA)
但是,我从cv2.resize行得到的错误是:

TypeError: 'function takes exactly 2 arguments (3 given)'

有什么线索吗?

对于
dst.size()
而不是3D:

resized_patch = cv2.resize(patch, (3, 50, 50), dst=dst, fx=0, fy=0, interpolation=cv2.INTER_AREA)
                                      ^^^ #here 
请使用此“调整大小”而不是“cv2.resize”


谢谢还有,没有一个好方法可以同时调整所有3维的大小吗?@angela Welcome,实际上我不知道,但是这个问题对我很有帮助,这可能是一个评论。
from skimage.transform import resize