cars.applications.rasterization.simple_gaussian
this module contains the dense_matching application class.
Module Contents
Classes
PointCloudRasterisation |
Functions
|
Wrapper for rasterization step : |
|
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
PointCloudRasterisation
- check_conf(conf)
Check configuration
- Parameters
conf (dict) – configuration to check
- Returns
overloaded configuration
- Return type
dict
- get_margins(resolution)
Get the margin to use for terrain tiles
- Parameters
resolution – resolution of raster data (in target CRS unit)
- 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(point_clouds, epsg, resolution, orchestrator=None, dsm_file_name=None, color_file_name=None, mask_file_name=None, classif_file_name=None, performance_map_file_name=None, contributing_pair_file_name=None, filling_file_name=None, color_dtype=None, dump_dir=None)
Run PointCloudRasterisation application.
Creates a CarsDataset filled with dsm tiles.
- Parameters
point_clouds (CarsDataset filled with pandas.DataFrame) –
merged point cloud or list of array point 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 (float) – epsg of raster data
resolution – resolution of raster data (in target CRS unit)
orchestrator – orchestrator used
dsm_file_name (str) – path of dsm
color_file_name (str) – path of color
mask_file_name (str) – path of color
classif_file_name – path of color
performance_map_file_name (str) – path of performance map file
contributing_pair_file_name (str) – path of contributing pair file
filling_file_name (str) – path of filling file
color_dtype (str (numpy type)) – output color image type
dump_dir (str) – directory used for outputs with no associated filename
- 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 point 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