cars.applications.rasterization.simple_gaussian

this module contains the dense_matching application class.

Module Contents

Classes

SimpleGaussian

PointsCloudRasterisation

Functions

rasterization_wrapper(cloud, resolution, epsg, profile)

Wrapper for rasterization step :

raster_final_function(orchestrator, future_object)

Apply function to current object, reading already rasterized data

class cars.applications.rasterization.simple_gaussian.SimpleGaussian(conf=None)

Bases: cars.applications.rasterization.point_cloud_rasterization.PointCloudRasterization

PointsCloudRasterisation

check_conf(conf)

Check configuration

Parameters

conf (dict) – configuration to check

Returns

overloaded configuration

Return type

dict

get_resolution()

Get the resolution used by rasterization application

Returns

resolution in meters or degrees

get_margins()

Get the margin to use for terrain tiles

Returns

margin in meters or degrees

get_optimal_tile_size(max_ram_per_worker, superposing_point_clouds=1, point_cloud_resolution=0.5)

Get the optimal tile size to use, depending on memory available

Parameters
  • max_ram_per_worker (int) – maximum ram available

  • superposing_point_clouds (int) – number of point clouds superposing

  • point_cloud_resolution (float) – resolution of point cloud

Returns

optimal tile size in meter

Return type

float

run(points_clouds, epsg, orchestrator=None, dsm_file_name=None, color_file_name=None, color_dtype=None)

Run PointsCloudRasterisation application.

Creates a CarsDataset filled with dsm tiles.

Parameters
  • points_clouds (CarsDataset filled with pandas.DataFrame) –

    merged point cloud or list of array points clouds

    . CarsDataset contains:

    • Z x W Delayed tiles. Each tile will be a future pandas DataFrame containing:

      • data with keys “x”, “y”, “z”, “corr_msk” optional: “color”, “mask”, “data_valid”, “z_inf”, “z_sup” “coord_epi_geom_i”, “coord_epi_geom_j”, “idx_im_epi”

      • attrs with keys “epsg”, “ysize”, “xsize”, “xstart”, “ystart”

    • attributes containing “bounds”, “ysize”, “xsize”, “epsg”

    OR

    Tuple(list of CarsDataset Arrays, bounds). With list of point

    clouds: list of CarsDataset of type array, with: - data with keys x”, “y”, “z”, “corr_msk”, “z_inf”, “z_sup” optional: “color”, “mask”, “data_valid”, “coord_epi_geom_i”, “coord_epi_geom_j”, “idx_im_epi”

  • epsg (str) – epsg of raster data

  • orchestrator – orchestrator used

  • dsm_file_name (str) – path of dsm

  • color_file_name (str) – path of color

  • color_dtype (str (numpy type)) – output color image type

Returns

raster DSM. CarsDataset contains:

  • Z x W Delayed tiles. Each tile will be a future xarray Dataset containing:

    • data : with keys : “hgt”, “img”, “raster_msk”,optional : “n_pts”, “pts_in_cell”, “hgt_mean”, “hgt_stdev”, “hgt_inf”, “hgt_sup”

    • attrs with keys: “epsg”

  • attributes containing: None

:rtype : CarsDataset filled with xr.Dataset

cars.applications.rasterization.simple_gaussian.rasterization_wrapper(cloud, resolution, epsg, profile, window=None, terrain_region=None, terrain_full_roi=None, list_computed_layers: List[str] = None, saving_info=None, sigma: float = None, radius: int = 1, dsm_no_data: int = np.nan, color_no_data: int = np.nan, msk_no_data: int = 255, source_pc_names=None)

Wrapper for rasterization step : - Convert a list of clouds to correct epsg - Rasterize it with associated colors

if terrain_region is not provided: region is computed from point cloud,

with margin to use

Parameters
  • cloud (pandas.DataFrame) – combined cloud

  • terrain_region – terrain bounds

  • resolution (float) – Produced DSM resolution (meter, degree [EPSG dependent])

  • epsg_code (int) – epsg code for the CRS of the output DSM

  • window (int) – Window considered

  • margin (int) – margin in pixel to use

  • profile (dict) – rasterio profile

  • list_computed_layers – list of computed output data

  • saving_info (dict) – information about CarsDataset ID.

  • sigma – sigma for gaussian interpolation. (If None, set to resolution)

  • radius – Radius for hole filling.

  • dsm_no_data – no data value to use in the final raster

  • color_no_data – no data value to use in the final colored raster

  • msk_no_data – no data value to use in the final mask image

  • source_pc_names – list of names of points cloud before merging : name of sensors pair or name of point cloud file

Returns

digital surface model + projected colors

Return type

xr.Dataset

cars.applications.rasterization.simple_gaussian.raster_final_function(orchestrator, future_object)

Apply function to current object, reading already rasterized data

Parameters
  • orchestrator – orchestrator

  • future_object – Dataset

Returns

update object