pyorc.CameraConfig.get_bbox#
- CameraConfig.get_bbox(camera: Optional[bool] = False, mode: Optional[Literal['camera', 'geographical', '3d']] = 'geographical', h_a: Optional[float] = None, z_a: Optional[float] = None, within_image: Optional[bool] = False, expand_exterior=True) Polygon [source]#
Get bounding box.
Can be retrieved in geographical or camera perpective.
- Parameters:
camera (bool, optional) – If set, the bounding box will be returned as row and column coordinates in the camera perspective. In this case
h_a
may be set to provide the right water level, to estimate the bounding box for. This option is deprecated, instead use mode=”camera”.mode (Literal["geographical", "camera", "3d"], optional) – Determines the type of bounding box to return. If set to “geographical” (default), the bounding box is returned in the geographical coordinates. If set to “camera”, the bounding box is returned in the camera perspective. If set to “3d”, the bounding box is returned as a 3D polygon in the CRS
h_a (float, optional) – If set with mode=”camera”, then the bbox coordinates will be transformed to the camera perspective, using h_a as a present water level (in local datum). In case a video with higher (lower) water levels is used, this will result in a different perspective plane than the control video.
z_a (float, optional) – similar to setting h_a, but z_a represent the vertical coordinate in the coordinate reference system of the camera configuration instead of the local datum.
within_image (bool, optional (default False)) – Set to True to make an attempt to remove parts of the polygon that lie outside of the image field of view
expand_exterior (bool, optional) – Set to True to expand the corner points to more points. This is particularly useful for plotting purposes.
- Returns:
A bounding box, that in the used CRS is perfectly rectangular, and aligned in the up/downstream direction.
It can (and certainly will) be rotated with respect to a typical bbox with xlim, ylim coordinates.
If user sets
mode="camera"
then the geographical bounding box will be converted into a camera perspective,using the homography belonging to the available ground control points and current water level.
This can then be used to reconstruct the grid for velocimetry calculations.