2017-10-16 24 views
0

元組我使用這一行的OpenCV:關於SystemError:新型getargs格式,但參數不是OpenCV的

xsize = random.uniform(params['reshape_x_limits'][0],params['reshape_x_limits'][1]) 
ysize = random.uniform(params['reshape_x_limits'][0],params['reshape_x_limits'][1]) 
cv2.resize(fg,0,fg,xsize,ysize) 

這給錯誤

SystemError: new style getargs format but argument is not a tuple 

但是根據文檔: https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#resize

沒有參數應該是元組。什麼導致了這個錯誤?我正在使用Python 2.7和OpenCV 3.3.0.10。

回答

0

從您發佈的文檔,你可以看到有一個例子:

resize(src, dst, Size(), 0.5, 0.5, interpolation); 

參數Size()是一個元組(width, length)

另一個例子,你可以find in this tutorial about geometric transformations,例如:

res = cv2.resize(img,(2*width, 2*height), interpolation = cv2.INTER_CUBIC) 
相關問題