cars.data_structures.format_transformation

Contains function for format transformation between region and windows:

Module Contents

Functions

grid_margins_2_overlaps(grid, margins_fun)

Convert margins to overlap grid format used in CarsDatasets

get_corresponding_indexes(row, col)

Get point cloud tiling grid indexes, corresponding to

terrain_coords_to_pix(point_cloud_cars_ds, resolution)

Compute the tiling grid in pixels, from a tiling grid in

region_margins_from_window(window, left_overlaps, ...)

Convert window to margins. Add used disp min and max used for resampling

cars.data_structures.format_transformation.grid_margins_2_overlaps(grid, margins_fun)

Convert margins to overlap grid format used in CarsDatasets

Parameters
  • grid (np.ndarray) – region grid

  • margins_fun (fun) – function to compute margis

Returns

overlap grid left, overlap grid right

Return type

np.ndarray, np.ndarray

cars.data_structures.format_transformation.get_corresponding_indexes(row, col)

Get point cloud tiling grid indexes, corresponding to given raster indexes. In rasterio convention.

Parameters
  • row (int) – row

  • col (int) – col

Returns

corresponding indexes (row, col)

Return type

tuple(int, int)

cars.data_structures.format_transformation.terrain_coords_to_pix(point_cloud_cars_ds, resolution)

Compute the tiling grid in pixels, from a tiling grid in geocoordinates

Parameters
  • point_cloud_cars_ds (CarsDataset) – point clouds

  • resolution (float) – resolution

Returns

new tiling grid

Return type

np.ndarray

cars.data_structures.format_transformation.region_margins_from_window(window, left_overlaps, right_overlaps, used_disp_min=None, used_disp_max=None)

Convert window to margins. Add used disp min and max used for resampling

Parameters
  • window (Dict) – window to use

  • left_overlaps (Dict) – left overlap to use

  • right_overlaps (Dict) – right overlap to use

  • used_disp_min – min disp min used in resampling

  • used_disp_max – max disp max used in resampling

Returns

Region, Margin

Return type

Tuple(List, List)