Extract data from rect = cv2.minAreaRect(c) structure (tuple?)

I have rect = cv2.minAreaRect(c) which contains the data as (centre x,y), (size l,w), angle.

How can I extract the data so I have it in simple integer form?

Ie.

x=

y=

l=

w=

angle=

I know this is simple but I’m kind of struggling with the Python terminology I think.

Thanks,

JP

P.S.:

This is what I have working now, is there a better way?

    `(rx,ry),(rl,rw),ra = rect`

print (int(rx), int(ry), int(rl), int(rw), int(ra))

[CODE]

[/CODE]

and… where are the CODE tags?

That is how to do it.

The concept is called “destructuring bind”. It is not unique to Python. Other languages have this too.

This forum is a “Discourse” forum. It uses some variant of Markdown for styling. This is similar to reddit and stack overflow, which also use variants of Markdown. Right above the text box is a menu bar for styling. The text box can also be switched to a rich text editor, from that same menu bar.