python - opencv warpPerspective parameter count -
in script have following code:
src = numpy.array(cornerssheet, numpy.float32) dst = numpy.array(cornersdesired, numpy.float32) transform = cv2.getperspectivetransform(src,dst) finished = cv2.warpperspective(img, transform, img.shape)
python says:
traceback (most recent call last): file "./script.py", line 138, in <module> finished = cv2.warpperspective(img, transform, img.shape) typeerror: function takes 2 arguments (3 given)
but according documentation:
python: cv2.warpperspective(src, m, dsize[, dst[, flags[, bordermode[, bordervalue]]]]) → dst
three parameters ok. have same issue cv2.warpaffine
.
problem solved. img.shape
returns tuple 3 elements, warpperspective expects tuple 2.
Comments
Post a Comment