cars.applications.grid_generation.grid_generation_algo ====================================================== .. py:module:: cars.applications.grid_generation.grid_generation_algo .. autoapi-nested-parse:: Grids module: contains functions used for epipolar grid creation and correction Functions --------- .. autoapisummary:: cars.applications.grid_generation.grid_generation_algo.get_new_path cars.applications.grid_generation.grid_generation_algo.write_grid cars.applications.grid_generation.grid_generation_algo.generate_epipolar_grids cars.applications.grid_generation.grid_generation_algo.compute_epipolar_grid_min_max cars.applications.grid_generation.grid_generation_algo.terrain_region_to_epipolar Module Contents --------------- .. py:function:: get_new_path(path) Check path, if exists, creates new one :param path: path to check :type path: str :return : new path :rtype: str .. py:function:: write_grid(grid, fname, origin, spacing) Write an epipolar rectification grid to file :param grid: the grid to write :type grid: 3D numpy array :param fname: the filename to which the grid will be written :type fname: string :param origin: origin of the grid :type origin: (float, float) :param spacing: spacing of the grid :type spacing: (float, float) .. py:function:: generate_epipolar_grids(sensor1, sensor2, geomodel1, geomodel2, geometry_plugin, epipolar_step) Computes the left and right epipolar grids :param sensor1: path to left sensor image :param sensor2: path to right sensor image :param geomodel1: path and attributes for left geomodel :param geomodel2: path and attributes for right geomodel :param geometry_plugin: geometry plugin to use :type geometry_plugin: AbstractGeometry :param epipolar_step: step to use to construct the epipolar grids :return: 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 .. py:function:: compute_epipolar_grid_min_max(geometry_plugin, grid, sensor1, sensor2, geomodel1, geomodel2, grid1, grid2, epsg, disp_min_tiling, disp_max_tiling) Compute ground terrain location of epipolar grids at disp_min and disp_max :param geometry_plugin: geometry plugin to use :type geometry_plugin: AbstractGeometry :param grid: The epipolar grid to project :type grid: np.ndarray of shape (N,M,2) :param sensor1: path to left sensor image :type sensor1: str :param sensor2: path to right sensor image :type sensor2: str :param geomodel1: path and attributes for left geomodel :type geomodel1: dict :param geomodel2: path and attributes for right geomodel :type geomodel2: dict :param grid1: dict of the reference image grid file :type grid1: dict :param grid2: dict of the secondary image grid file :type grid2: dict :param epsg: EPSG code of the terrain projection :type epsg: Int :param disp_min_tiling: Minimum disparity tiling :type disp_min_tiling: np ndarray or int :param disp_max_tiling: Maximum disparity tiling :type disp_max_tiling: np ndarray or int :return: a tuple of location grid at disp_min and disp_max :rtype: Tuple(np.ndarray, np.ndarray) same shape as grid param .. py:function:: terrain_region_to_epipolar(region, sensor1, sensor2, geomodel1, geomodel2, grid_left, grid_right, geometry_plugin, epsg=4326, disp_min=0, disp_max=0, tile_size=100, epipolar_size_x=None, epipolar_size_y=None) Transform terrain region to epipolar region :param region: terrain region to use :param sensor1: path to left sensor image :param sensor2: path to right sensor image :param geomodel1: path and attributes for left geomodel :param geomodel2: path and attributes for right geomodel :param grid1: dataset of the reference image grid file :param grid2: dataset of the secondary image grid file :param geometry_plugin: geometry plugin to use :param epsg: epsg :param disp_min: minimum disparity :param disp_max: maximum disparity :param tile_size: tile size for grid :param epipolar_size_x: epipolar_size_x :param epipolar_size_y: epipolar_size_y :return: epipolar region to use, with tile_size a sample