pyorc.CameraConfig.get_bbox#
- CameraConfig.get_bbox(camera: Optional[bool] = False, 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.h_a (float, optional) – If set with
camera=True
, 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
camera=True
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.