class Rect – Rectangle Object

The rect object is an attrtuple returned by Image.find_rects(). It has 6 fields accessible as attributes or by index [0..5].

class image.rect

Please call Image.find_rects() to create this object.

x() int

Returns the rectangle’s top left corner’s x position. Index [0].

y() int

Returns the rectangle’s top left corner’s y position. Index [1].

w() int

Returns the rectangle’s width. Index [2].

h() int

Returns the rectangle’s height. Index [3].

magnitude() int

Returns the rectangle’s magnitude from the Hough transform. Index [4].

corners() Tuple[Tuple[int, int], Tuple[int, int], Tuple[int, int], Tuple[int, int]]

Returns a 4-tuple of (x, y) tuples for the 4 corners of the rectangle in sorted clock-wise order starting from the top left. Index [5].