pyorc.Frames.project#
- Frames.project(method: Literal['cv', 'numpy'] = 'numpy', 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 (default numpy). 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 mean value (if the user uses mean as reducer). 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. We recommend using numpy and only use cv with simple cases such as nadir-looking videos.
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