video699.quadrangle.geos¶
This module implements a coordinate map between a video frame and projection screen coordinate systems based on a quadrangle specifying the screen corners in the video frame coordinate system. The implementation uses the GEOS library exposed through the Shapely Python package.
Module Contents¶
-
video699.quadrangle.geos.CONFIGURATION¶
-
class
video699.quadrangle.geos.GEOSConvexQuadrangle(top_left, top_right, bottom_left, bottom_right, aspect_ratio=None)¶ Bases:
video699.interface.ConvexQuadrangleABCA convex quadrangle specifying a map between video frame and projection screen coordinates.
The quadrangle specifies the screen corners in a video frame coordinate system.
Parameters: - top_left ((scalar, scalar)) – The top left corner of the quadrangle in a video frame coordinate system.
- top_right ((scalar, scalar)) – The top right corner of the quadrangle in a video frame coordinate system.
- bottom_left ((scalar, scalar)) – The bottom left corner of the quadrangle in a video frame coordinate system.
- bottom_right ((scalar, scalar)) – The bottom right corner of the quadrangle in a video frame coordinate system.
- aspect_ratio (Fraction or None, optional) – The aspect ratio of the quadrangle in a screen coordinate system. If
Noneor unspecified, the aspect ratio will be the ratio between the longest adjacent sides of the quadrangle in the video frame coordinate system.
-
top_left¶ (scalar, scalar) – The top left corner of the quadrangle in a video frame coordinate system.
-
top_right¶ (scalar, scalar) – The top right corner of the quadrangle in a video frame coordinate system.
-
top_right_bound¶ (scalar, scalar) – The top right corner of the minimal bounding box that bounds the quadrangle in a video frame coordinate system.
-
bottom_left¶ (scalar, scalar) – The bottom left corner of the quadrangle in a video frame coordinate system.
-
bottom_left_bound¶ (scalar, scalar) – The bottom left corner of the minimal bounding box that bounds the quadrangle in a video frame coordinate system.
-
bottom_right¶ (scalar, scalar) – The bottom right corner of the quadrangle in a video frame coordinate system.
-
width¶ int – The width of the quadrangle in a screen coordinate system.
-
height¶ int – The height of the quadrangle in a screen coordinate system.
-
area¶ scalar – The area of the screen in the video frame coordinate system.
-
transform_matrix¶ 3x3 ndarray of scalar – The homography from the frame coordinate system to the screen coordinate system.
-
top_left
-
top_right
-
top_left_bound¶
-
bottom_left
-
bottom_right
-
bottom_right_bound¶
-
width
-
height
-
area
-
intersection_area(self, other)¶
-
union_area(self, other)¶
-
transform(self, frame_image)¶
-
__hash__(self)¶