cars.applications.grid_generation.grids
Grids module: contains functions used for epipolar grid creation and correction
Module Contents
Functions
|
Check path, if exists, creates new one |
|
Write an epipolar rectification grid to file |
|
Computes the left and right epipolar grids |
|
Compute ground terrain location of epipolar grids at disp_min and disp_max |
- cars.applications.grid_generation.grids.get_new_path(path)
Check path, if exists, creates new one
- Parameters
path (str) – path to check
:return : new path :rtype: str
- cars.applications.grid_generation.grids.write_grid(grid, fname, origin, spacing)
Write an epipolar rectification grid to file
- Parameters
grid (3D numpy array) – the grid to write
fname (string) – the filename to which the grid will be written
origin ((float, float)) – origin of the grid
spacing ((float, float)) – spacing of the grid
- cars.applications.grid_generation.grids.generate_epipolar_grids(conf, geometry_loader_to_use, dem: Union[None, str], default_alt: Union[None, float] = None, epipolar_step: int = 30, geoid: Union[str, None] = None)
Computes the left and right epipolar grids
- Parameters
conf – input configuration dictionary
geometry_loader_to_use (str) – geometry loader to use
dem – path to the dem folder
default_alt – default altitude to use in the missing dem regions
epipolar_step – step to use to construct the epipolar grids
geoid – path to the geoid file
- Returns
Tuple composed of :
the left epipolar grid as a numpy array
the right epipolar grid as a numpy array
the left grid origin as a list of float
the left grid spacing as a list of float
the epipolar image size as a list of int (x-axis size is given with the index 0, y-axis size with index 1)
the disparity to altitude ratio as a float
- cars.applications.grid_generation.grids.compute_epipolar_grid_min_max(geometry_loader_to_use, grid, epsg, conf, disp_min=None, disp_max=None)
Compute ground terrain location of epipolar grids at disp_min and disp_max
- Parameters
geometry_loader_to_use (str) – geometry loader to use
grid (np.ndarray of shape (N,M,2)) – The epipolar grid to project
epsg (Int) – EPSG code of the terrain projection
conf (Dict) – Configuration dictionary from prepare step
disp_min (Float or None) – Minimum disparity (if None, read from configuration dictionary)
disp_max (Float or None) – Maximum disparity (if None, read from configuration dictionary)
- Returns
a tuple of location grid at disp_min and disp_max
- Return type
Tuple(np.ndarray, np.ndarray) same shape as grid param