pyorc.Frames.project#

Frames.project(method: Literal['cv', 'numpy'] = 'cv', resolution: Optional[float] = None, reducer: Optional[str] = 'mean')[source]#

Project frames into a projected frames object, with information from the camera_config attr.

This requires that the CameraConfig contains full gcp information. If a CRS is provided, also “lat” and “lon” variables will be added to the output, containing geographical latitude and longitude coordinates.

Parameters:
  • method (str, optional) – can be numpy or cv. Currently cv is still default but this may change in a future release. With cv (opencv) resampling is performed by first undistorting images, and then by resampling to the desired grid. With heavily distorted images and part of the area of interest outside of the field of view, the orthoprojection of the corners may end up in the wrong space. With numpy each individual orthoprojected grid cell is mapped to the image pixels space. For oversampled areas, this is also done vice versa. Undersampled areas result in nearest-neighbour interpolations, whilst for oversampled, this results in a reduced value (which can be defined by the user). We recommend switching to numpy if you experience strange results with cv.

  • resolution (float, optional) –

    resolution to project to. If not provided, this will be taken from the camera config in the metadata

    (Default value = None)

  • reducer (str, optional) – Currently only used when method=”numpy”. Default “mean”, resulting in averaging of oversampled grid cells.

Returns:

frames – projected frames and x and y in local coordinate system (origin: top-left), lat and lon if a crs was provided.

Return type:

xr.DataArray