cars.applications.resampling.resampling
this module contains the abstract resampling application class.
Module Contents
Classes
Resampling |
- class cars.applications.resampling.resampling.Resampling(conf=None)
Bases:
cars.applications.application_template.ApplicationTemplate
Resampling
- available_applications: Dict
- default_application = 'bicubic'
- classmethod __init_subclass__(short_name, **kwargs)
- abstract run(sensor_image_left, sensor_image_right, grid_left, grid_right, orchestrator=None, pair_folder=None, pair_key='PAIR_0', margins_fun=None, tile_width=None, tile_height=None, step=None, add_color=True, epipolar_roi=None)
Run resampling application.
Creates left and right CarsDataset filled with xarray.Dataset, corresponding to sensor images resampled in epipolar geometry.
- Parameters
sensor_images_left (CarsDataset) – tiled sensor left image Dict Must contain keys : “image”, “color”, “geomodel”, “no_data”, “mask”, “classification”. Paths must be absolutes
sensor_images_right (CarsDataset) – tiled sensor right image Dict Must contain keys : “image”, “color”, “geomodel”, “no_data”, “mask”, “classification”. Paths must be absolutes
grid_left –
left epipolar grid Grid CarsDataset contains :
- A single tile stored in [0,0], containing a (N, M, 2) shape
array in xarray Dataset
Attributes containing: “grid_spacing”, “grid_origin”, “epipolar_size_x”, “epipolar_size_y”, “epipolar_origin_x”, “epipolar_origin_y”, epipolar_spacing_x”, “epipolar_spacing”, “disp_to_alt_ratio”, :type grid_left: CarsDataset
grid_right (CarsDataset) –
right epipolar grid. Grid CarsDataset contains :
A single tile stored in [0,0], containing a (N, M, 2) shape array in xarray Dataset
Attributes containing: “grid_spacing”, “grid_origin”, “epipolar_size_x”, “epipolar_size_y”, “epipolar_origin_x”, “epipolar_origin_y”, epipolar_spacing_x”, “epipolar_spacing”, “disp_to_alt_ratio”,
orchestrator – orchestrator used
pair_folder (directory to save files to) – folder used for current pair
pair_key (str) – pair id
margins (xr.Dataset) – margins to use
optimum_tile_size (int) – optimum tile size to use
add_color (bool) – add color image to dataset
epipolar_roi (list(int), [row_min, row_max, col_min, col_max]) – Epipolar roi to use if set. Set None tiles outsize roi
- Returns
left epipolar image, right epipolar image. Each CarsDataset contains:
N x M Delayed tiles. Each tile will be a future xarray Dataset containing:
data with keys : “im”, “msk”, “color”, “classif”
- attrs with keys: “margins” with “disp_min” and “disp_max” “transform”, “crs”, “valid_pixels”, “no_data_mask”,
”no_data_img”
attributes containing: “largest_epipolar_region”,”opt_epipolar_tile_size”
- Return type
Tuple(CarsDataset, CarsDataset)