Skip to content

Incorrect error message in cv2.rectangle #16432

@ebeyabraham

Description

@ebeyabraham

cv2.rectangle(img,(x,y),(x+w,y+h)) gives TypeError: function takes exactly 4 arguments (2 given) when actually the number of arguments given is 3

Steps to reproduce

img = cv2.imread("path_to_img")
x,y,w,h = 10,10,10,10
cv2.rectangle(img,(x,y),(x+w,y+h))
cv2.imshow("Frame",img)

Expected Result

TypeError: function takes exactly 4 arguments (3 given)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions