Ask Your Question

Revision history [back]

I assume you got the code from here

The result from zip(*loc[::-1]) is a tuple that is stored in pt. At this point, pt has the structure (x, y) and p[0] == x and p[1] == y.

Now, let's take a turn and look at OpenCV documentation of cv2.rectangle(). You will see that the third and fourth arguments are of type Point. A peek into Point shows that its attributes are x,y. In Python, this definition is encapsulated into a tuple since data type declaration is not a thing.

I think this is enough for you to put two and two together and understand exactly what that drawing function does.

Happy coding, Cheers mate :)

I assume you got the code from here

The result from zip(*loc[::-1]) is a tuple that is stored in pt. At this point, pt has the structure (x, y) and p[0] == x and p[1] == y.

Now, let's take a turn and look at OpenCV documentation of cv2.rectangle(). You will see that the third and fourth arguments are of type Point. A peek into Point shows that its attributes are x,y. In Python, this type definition is encapsulated into a tuple since data type declaration is not a thing.

I think this is enough for you to put two and two together and understand exactly what that drawing function does.

Happy coding, Cheers mate :)