cars.pipelines.parameters.sensor_inputs

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

Attributes

CARS_GEOID_PATH

Functions

sensors_check_inputs(conf[, config_dir])

Check the inputs given

check_sensors(conf, overloaded_conf[, config_dir])

Check sensors

check_loaders(conf)

Check loaders section

check_filling(conf, classif_loader)

Check filling section

get_sensor_resolution(geom_plugin, sensor_path, geomodel)

Estimate the sensor image resolution in meters per pixel

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_dir, overloaded_conf)

Modify input file path to absolute path

check_srtm(srtm_dir)

Check srtm data

check_input_data(image, color)

Check data of the image and color

get_initial_elevation(config)

Return initial elevation parameters (dem and geoid paths)

check_input_size(image, mask, classif, edges)

Check image, mask, classif and color given

check_nbits(mask)

Check the bits number of the mask, classif

compare_image_type(sensors, sensor_type, key1, key2)

Compare the data type between a pair of images

check_classification_values(sensors, sensor_type, ...)

Compare the classification values between a pair of images

check_all_nbits_equal_one(nbits)

Check if all the nbits = 1

load_geomodels(conf, geometry_plugin)

Load geomodels directly on conf object

generate_pairs(conf)

Generate sensors inputs form inputs conf :

check_dsm_to_fill(conf)

Check dsm to fill section

Module Contents

cars.pipelines.parameters.sensor_inputs.CARS_GEOID_PATH = 'geoid/egm96.grd'
cars.pipelines.parameters.sensor_inputs.sensors_check_inputs(conf, config_dir=None)[source]

Check the inputs given

Parameters:
  • conf (dict) – configuration of inputs

  • config_dir (str) – path to dir containing json

cars.pipelines.parameters.sensor_inputs.check_sensors(conf, overloaded_conf, config_dir=None)[source]

Check sensors

cars.pipelines.parameters.sensor_inputs.check_loaders(conf)[source]

Check loaders section :param conf: loaders section of input conf :type conf: dict

cars.pipelines.parameters.sensor_inputs.check_filling(conf, classif_loader)[source]

Check filling section :param conf: filling section of input conf :type conf: dict

cars.pipelines.parameters.sensor_inputs.get_sensor_resolution(geom_plugin, sensor_path, geomodel, target_epsg=32631)[source]

Estimate the sensor image resolution in meters per pixel using geolocation of 3 corners of the image.

Parameters:
  • geom_plugin – geometry plugin instance

  • sensor_path (dict) – path to the sensor image

  • geomodel – geometric model for the sensor image

  • target_epsg (int) – target EPSG code for projection

Returns:

average resolution in meters/pixel along x and y

Return type:

float

cars.pipelines.parameters.sensor_inputs.check_geometry_plugin(conf_inputs, conf_geom_plugin, output_dem_dir)[source]

Check the geometry plugin with inputs

Parameters:
  • conf_inputs (type) – checked configuration of inputs

  • conf_advanced (type) – checked configuration of advanced

  • conf_geom_plugin (str) – name of geometry plugin

Returns:

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

cars.pipelines.parameters.sensor_inputs.generate_geometry_plugin_with_dem(conf_geom_plugin, conf_inputs, dem=None, crop_dem=True, output_dem_dir=None, scaling_coeff=1)[source]

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

  • scaling_coeff (float) – scaling factor for resolution

Returns:

geometry plugin object, with a dem

cars.pipelines.parameters.sensor_inputs.modify_to_absolute_path(config_dir, overloaded_conf)[source]

Modify input file path to absolute path

Parameters:
  • config_dir (str) – directory of the json configuration

  • overloaded_conf – overloaded configuration json

Dict overloaded_conf:

dict

cars.pipelines.parameters.sensor_inputs.check_srtm(srtm_dir)[source]

Check srtm data

Parameters:

srtm_dir (str) – directory of srtm

cars.pipelines.parameters.sensor_inputs.check_input_data(image, color)[source]

Check data of the image and color

Parameters:
  • image (str) – image path

  • color (str) – color path

cars.pipelines.parameters.sensor_inputs.get_initial_elevation(config)[source]

Return initial elevation parameters (dem and geoid paths) from input configuration.

Parameters:

config (str, dict or None) – input initial elevation

cars.pipelines.parameters.sensor_inputs.check_input_size(image, mask, classif, edges)[source]

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

  • edges (dict) – edges dict

cars.pipelines.parameters.sensor_inputs.check_nbits(mask)[source]

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.parameters.sensor_inputs.compare_image_type(sensors, sensor_type, key1, key2)[source]

Compare the data type between a pair of images

Parameters:
  • sensors (str) – list of sensor paths

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

  • key1 (str) – key of the images pair

  • key2 (str) – other key of the images pair

cars.pipelines.parameters.sensor_inputs.check_classification_values(sensors, sensor_type, key1, key2, filling)[source]

Compare the classification values between a pair of images

Parameters:
  • imgs (str) – list of image paths

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

  • key1 (str) – key of the images pair

  • key2 (str) – other key of the images pair

cars.pipelines.parameters.sensor_inputs.check_all_nbits_equal_one(nbits)[source]

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

cars.pipelines.parameters.sensor_inputs.load_geomodels(conf, geometry_plugin)

Load geomodels directly on conf object :param conf: input conf :type conf: dict

cars.pipelines.parameters.sensor_inputs.generate_pairs(conf)

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.parameters.sensor_inputs.check_dsm_to_fill(conf)[source]

Check dsm to fill section :param conf: conf :return: checked conf