cars.pipelines.sensor_to_dense_dsm.sensors_inputs

CARS containing inputs checking for sensor input data Used for full_res and low_res pipelines

Module Contents

Functions

sensors_check_inputs(conf[, config_json_dir, ...])

Check the inputs given

get_usable_geometry_plugin([conf_geom_plugin])

Find a usable geometry plugin.

check_geometry_plugin(conf_inputs, conf_geom_plugin)

Check the geometry plugin with inputs

generate_geometry_plugin_with_dem(conf_geom_plugin, ...)

Generate geometry plugin with dem and geoid

modify_to_absolute_path(config_json_dir, overloaded_conf)

Modify input file path to absolute path

validate_epipolar_a_priori(conf, overloaded_conf, ...)

Validate inner epipolar configuration

check_srtm(srtm_dir)

Check srtm data

check_input_data(image, color)

Check data of the image and color

check_input_size(image, mask, color, classif)

Check image, mask, classif and color given

check_nbits(mask, classif)

Check the bits number of the mask, classif

compare_image_type(imgs, image_type, key1, key2)

Compare the data type between a pair of images

check_all_nbits_equal_one(nbits)

Check if all the nbits = 1

generate_inputs(conf, geometry_plugin)

Generate sensors inputs form inputs conf :

update_conf(conf[, grid_correction_coef, dmin, dmax, ...])

Update the conf with grid correction and disparity range

Attributes

CARS_GEOID_PATH

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.CARS_GEOID_PATH = 'geoid/egm96.grd'
cars.pipelines.sensor_to_dense_dsm.sensors_inputs.sensors_check_inputs(conf, config_json_dir=None, check_epipolar_a_priori=True)

Check the inputs given

Parameters
  • conf (dict) – configuration of inputs

  • config_json_dir (str) – path to dir containing json

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.get_usable_geometry_plugin(conf_geom_plugin=None)

Find a usable geometry plugin. Default is OTB if installed

Returns

plugin to use

Return type

str

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.check_geometry_plugin(conf_inputs, conf_geom_plugin)

Check the geometry plugin with inputs :param conf_geom_plugin: name of geometry plugin :type conf_geom_plugin: str :param conf_inputs: checked configuration of inputs :type conf_inputs: type

Returns

overload inputs conf overloaded geometry plugin conf geometry plugin without dem geometry plugin with dem

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.generate_geometry_plugin_with_dem(conf_geom_plugin, conf_inputs, dem=None, crop_dem=True)

Generate geometry plugin with dem and geoid

Parameters
  • conf_geom_plugin – plugin configuration

  • conf_inputs – inputs configuration

  • dem – dem to overide the one in inputs

Returns

geometry plugin object, with a dem

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.modify_to_absolute_path(config_json_dir, overloaded_conf)

Modify input file path to absolute path

Parameters
  • config_json_dir (str) – directory of the json configuration

  • overloaded_conf – overloaded configuration json

Dict overloaded_conf

dict

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.validate_epipolar_a_priori(conf, overloaded_conf, checker_epipolar)

Validate inner epipolar configuration

:param conf : input configuration json :type conf: dict :param overloaded_conf : overloaded configuration json :type overloaded_conf: dict :param checker_epipolar : json checker :type checker_epipolar: Checker

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.check_srtm(srtm_dir)

Check srtm data

Parameters

srtm_dir (str) – directory of srtm

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.check_input_data(image, color)

Check data of the image and color

Parameters
  • image (str) – image path

  • color (str) – color path

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.check_input_size(image, mask, color, classif)

Check image, mask, classif and color given

Images must have same size

Parameters
  • image (str) – image path

  • mask (str) – mask path

  • color (str) – color path

  • classif (str) – classif path

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.check_nbits(mask, classif)

Check the bits number of the mask, classif mask and classification are limited to 1 bits per band

Parameters
  • mask (str) – mask path

  • classif (str) – classif path

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.compare_image_type(imgs, image_type, key1, key2)

Compare the data type between a pair of images

Parameters
  • imgs (str) – list of image paths

  • key1 (str) – key of the images pair

  • image_type (int) – type of cardataset image (IMG, MASK, CLASSIF…)

  • key1 – other key of the images pair

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.check_all_nbits_equal_one(nbits)

Check if all the nbits = 1 :param nbits: list of the nbits :return: True if all the nbits = 1

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.generate_inputs(conf, geometry_plugin)

Generate sensors inputs form inputs conf :

a list of (sensor_left, sensor_right)

Parameters

conf (dict) – input conf

Returns

list of sensors pairs

Return type

list(tuple(dict, dict))

cars.pipelines.sensor_to_dense_dsm.sensors_inputs.update_conf(conf, grid_correction_coef=None, dmin=None, dmax=None, pair_key=None, dem_median=None, dem_min=None, dem_max=None)

Update the conf with grid correction and disparity range :param grid_correction_coef: grid correction coefficient :type grid_correction_coef: list :param dmin: disparity range minimum :type dmin: float :param dmax: disparity range maximum :type dmax: float :param pair_key: name of the inputs key pair :type pair_key: str