cars.applications.dense_matching.dense_matching

this module contains the abstract matching application class.

Module Contents

Classes

DenseMatching

AbstractDenseMatching

class cars.applications.dense_matching.dense_matching.DenseMatching(conf=None)

Bases: cars.applications.application_template.ApplicationTemplate

AbstractDenseMatching

available_applications: Dict
default_application = 'census_sgm'
classmethod __init_subclass__(short_name, **kwargs)
abstract get_optimal_tile_size(disp_range_grid, max_ram_per_worker)

Get the optimal tile size to use during dense matching.

Parameters
  • disp_range_grid – minimum and maximum disparity grid

  • max_ram_per_worker – maximum ram per worker

Returns

optimal tile size

abstract get_margins_fun(grid_left, disp_min_grid, disp_max_grid)

Get Margins function that generates margins needed by matching method, to use during resampling

Parameters
  • grid_left – left epipolar grid

  • disp_min_grid – minimum disparity grid

  • disp_max_grid – maximum disparity grid

Returns

function that generates margin for given roi

abstract generate_disparity_grids(sensor_image_right, grid_right, geometry_plugin_with_dem_min, geometry_plugin_with_dem_max, geom_plugin_with_dem_and_geoid, dmin=None, dmax=None, altitude_delta_min=None, altitude_delta_max=None, dem_min=None, dem_max=None, pair_folder=None)

Generate disparity grids min and max, with given step

global mode: uses dmin and dmax local mode: uses dems

Parameters
  • sensor_image_right (dict) – sensor image

  • grid_right (CarsDataset) – right epipolar grid

  • geometry_plugin_with_dem_min (GeometryPlugin) – geometry plugin with dem min

  • geometry_plugin_with_dem_max (GeometryPlugin) – geometry plugin with dem max

  • geom_plugin_with_dem_and_geoid (GeometryPlugin) – geometry plugin with dem mean used to generate epipolar grids

  • dmin (float) – minimum disparity

  • dmax (float) – maximum disparity

  • altitude_delta_max (int) – Delta max of altitude

  • altitude_delta_min (int) – Delta min of altitude

  • dem_min (str) – path to minimum dem

  • dem_max (str) – path to maximum dem

  • pair_folder (str) – folder used for current pair

:return disparity grid range, containing grid min and max :rtype: CarsDataset

abstract run(epipolar_images_left, epipolar_images_right, local_tile_optimal_size_fun, orchestrator=None, pair_folder=None, pair_key='PAIR_0', disp_range_grid=None, compute_disparity_masks=False, disp_to_alt_ratio=None)

Run Matching application.

Create CarsDataset filled with xarray.Dataset, corresponding to epipolar disparities, on the same geometry than epipolar_images_left.

Parameters
  • epipolar_images_left (CarsDataset) –

    tiled left epipolar CarsDataset contains:

    • N x M Delayed tiles. Each tile will be a future xarray Dataset containing:

      • data with keys : “im”, “msk”, “color”

      • attrs with keys: “margins” with “disp_min” and “disp_max” “transform”, “crs”, “valid_pixels”, “no_data_mask”, “no_data_img”

    • attributes containing:

      ”largest_epipolar_region”,”opt_epipolar_tile_size”

  • epipolar_images_right (CarsDataset) –

    tiled right epipolar CarsDataset contains:

    • N x M Delayed tiles. Each tile will be a future xarray Dataset containing:

      • data with keys : “im”, “msk”, “color”

      • attrs with keys: “margins” with “disp_min” and “disp_max”

        ”transform”, “crs”, “valid_pixels”, “no_data_mask”, “no_data_img”

    • attributes containing:

      ”largest_epipolar_region”,”opt_epipolar_tile_size”

  • local_tile_optimal_size_fun (func) – function to compute local optimal tile size

  • orchestrator – orchestrator used

  • pair_folder (str) – folder used for current pair

  • pair_key (str) – pair id

  • disp_range_grid (CarsDataset) – minimum and maximum disparity grid

  • disp_to_alt_ratio (float) – disp to alti ratio used for performance map

Returns

disparity map: The CarsDataset contains:

  • N x M Delayed tiles. Each tile will be a future xarray Dataset containing:
    • data with keys : “disp”, “disp_msk”

    • attrs with keys: profile, window, overlaps

  • attributes containing:
    ”largest_epipolar_region”,”opt_epipolar_tile_size”,

    ”disp_min_tiling”, “disp_max_tiling”

Return type

CarsDataset