cars.core.geometry.otb_geometry

this module contains the otb geometry class

Module Contents

Classes

OTBGeometry

OTB geometry class

class cars.core.geometry.otb_geometry.OTBGeometry(geometry_plugin, dem=None, geoid=None, default_alt=None, **kwargs)

Bases: cars.core.geometry.abstract_geometry.AbstractGeometry

OTB geometry class

property conf_schema

Returns the input configuration fields required by the geometry plugin as a json checker schema. The available fields are defined in the cars/conf/input_parameters.py file

Returns

the geo configuration schema

static check_otb_remote_modules() List[str]

Check all remote module compiled by cars :return list of not available modules

static check_product_consistency(sensor: str, geomodel: dict) bool

Check if the image have RPC information readable by the OTB :param sensor: path to the image :param geomodel: path and attributes for geometric model :return: unchanged sensor path and geomodel dict

static triangulate(sensor1, sensor2, geomodel1, geomodel2, mode: str, matches: Union[xarray.Dataset, numpy.ndarray], grid1: str, grid2: str, roi_key: Union[None, str] = None) numpy.ndarray

Performs triangulation from cars disparity or matches dataset

Parameters
  • sensor1 – path to left sensor image

  • sensor2 – path to right sensor image

  • geomodel1 – path and attributes for left geomodel

  • geomodel2 – path and attributes for right geomodel

  • mode – triangulation mode (cst.DISP_MODE or cst.MATCHES)

  • matches – cars disparity dataset or matches as numpy array

  • grid1 – path or dataset for epipolar grid of image 1

  • grid2 – path or dataset for epipolar grid of image 2

  • roi_key – dataset roi to use (can be cst.ROI or cst.ROI_WITH_MARGINS)

Returns

the long/lat/height numpy array in output of the triangulation

generate_epipolar_grids(sensor1, sensor2, geomodel1, geomodel2, epipolar_step: int = 30) Tuple[numpy.ndarray, numpy.ndarray, List[float], List[float], List[int], float]

Computes the left and right epipolar grids

Parameters
  • sensor1 – path to left sensor image

  • sensor2 – path to right sensor image

  • geomodel1 – path and attributes for left geomodel

  • geomodel2 – path and attributes for right geomodel

  • epipolar_step – step to use to construct the epipolar grids

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

direct_loc(sensor, geomodel, x_coord: numpy.array, y_coord: numpy.array, z_coord: numpy.array = None) numpy.ndarray

For a given image point list , compute the latitudes, longitudes, altitudes

Be careful: When SRTM is used, the default elevation (altitude) doesn’t work anymore (OTB function) when ConvertSensorToGeoMultiPointFast is called again. Check the values.

Advice: to be sure, use x,y,z inputs only

Parameters
  • sensor – path to sensor image

  • geomodel – path and attributes for geometrical model

  • x_coord – X Coordinates list in input image sensor

  • y_coord – Y Coordinates list in input image sensor

  • z_coord – Z Altitude coordinates list to take the image

Returns

Latitude, Longitude, Altitude coordinates list as a numpy array

image_envelope(sensor, geomodel, shp=None)

Export the image footprint to a shapefile

Parameters
  • sensor – path to sensor image

  • geomodel – path and attributes for geometrical model

  • shp – Path to the output shapefile

inverse_loc(sensor, geomodel, lat_coord: numpy.array, lon_coord: numpy.array, z_coord: numpy.array = None) numpy.ndarray

For a given image points list, compute the latitudes, longitudes, altitudes

Advice: to be sure, use x,y,z list inputs only

Parameters
  • sensor – path to sensor image

  • geomodel – path and attributes for geomodel

  • lat_coord – latitute Coordinate list

  • lon_coord – longitude Coordinates list

  • z_coord – Z Altitude list

Returns

X / Y / Z Coordinates list in input image as a numpy array