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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -