在我的脚本中,我有以下代码:
src = numpy.array(cornersSheet, numpy.float32)
dst = numpy.array(cornersDesired, numpy.float32)
transform = cv2.getPerspectiveTransform(src,dst)
finished = cv2.warpPerspective(img, transform, img.shape)
蟒蛇说:
Traceback (most recent call last):
File "./script.py", line 138, in <module>
finished = cv2.warpPerspective(img, transform, img.shape)
TypeError: function takes exactly 2 arguments (3 given)
但根据文档:
Python: cv2.warpPerspective(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) → dst
三个参数都OK。我有同样的问题cv2.warpAffine
。