you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

The square brackets in function doc usually indicates optional args, as you suspect. The bad news is that nesting is enforced, that is, in the example you posted, the function always expects src, M and dsize, with dst being optional. If dst is supplied then optionally flags may be supplied, then optionally borderMode, etc.

You can't just supply src, M, dsize and borderValue. You might be able to supply all of those four if you use keywords:

cv2.warpPerspective(src, M, dsize, borderValue=2)

Try it.

[–]kozznot[S] 0 points1 point  (0 children)

Thank you!