Command line

CARS CLI organization

cars command line is the entry point for CARS to run 3D pipelines.

It enables to run pipelines through Configuration

cars -h

usage: cars [-h] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--version] conf

CARS: CNES Algorithms to Reconstruct Surface

positional arguments:
  conf                  Inputs Configuration File

optional arguments:
  -h, --help            show this help message and exit
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logger level (default: WARNING. Should be one of (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  --version, -v         show program's version number and exit

Mainly, CARS cli takes only one json file as command line argument:

cars configfile.json

See Configuration for global configuration, Sensor to full resolution dsm main pipeline for main pipeline configuration and Applications for each 3D steps sections for dedicated configuration.

Loglevel parameter

The loglevel option allows to parameter the loglevel. By default, the WARNING loglevel gives few information: only criticals, errors and warnings execution messages.

Note

Use cars configfile.json --loglevel INFO to get many detailed information about each CARS steps.

Inputs

Images and Geometric models

CARS supports the following official sensors raster products:

  • Pléiades (PHR)

  • Spot 6/7

  • DigitalGlobe

More generally, all rasters for which GDAL can interpret the image geometric model through RPC coefficients may work. For now, however, CARS has been mainly tested on Pléiades products.

Warning

Please check input rasters and associated geometric model are well read with OTB ReadImageInfo application

Considering the raster images with a Dimap format (Pléiades, Spot 6/7), it is possible to directly use the XML DIMAP files. This enables to avoid a potential sub-grid division of the products, or an impeding geo-referencing of the image files (usually done for the official products), which would degrade the restitution.

An additional image can be provided to be projected on the same grid as the one of the final DSM (ortho-image) for radiometric superposition with the DSM.

CARS also supports the products’ extracts done with the otbcli_ExtractROI OTB application. See Frequently Asked Questions for details.

See Inputs.

Initial Input Digital Elevation Model

For now, CARS uses an initial input Digital Elevation Model which is integrated in the stereo-rectification to minimize the disparity intervals to explore. Any geotiff file can be used.

For example, the SRTM data corresponding to the zone to process can be used through the otbcli_DownloadSRTMTiles OTB command.

The parameter is initial_elevation as seen in Sensor to full resolution dsm main pipeline

Masks

CARS can use a mask for each image in order to ignore some image regions (for instance water mask). This mask is taken into account during the whole 3D restitution process.

The masks can be “two-states” ones: 0 values will be considered as valid data, while any other value will be considered as unvalid data and thus will be masked during the 3D restitution process.

The masks can also be multi-classes ones: they contain several values, one for each class (forest, water, cloud…). To use a multi-classes mask, a json file has to be indicated by the user in the configuration file. See the Sensor to full resolution dsm main pipeline for more details.

Warning : The value 255 is reserved for CARS internal use, thus no class can be represented by this value in the multi-classes masks.

Outputs

In fine, CARS produces a geotiff file dsm.tif which contains the Digital Surface Model in the required cartographic projection and at the resolution defined by the user.

If the user provides an additional input image, an ortho-image clr.tif is also produced. The latter is stackable to the DSM (See Getting Started).

Those two products can be visualized with QGIS for example.

dsm.tif

clr.tif

QGIS Mix

dsm

clr

dsmclr

CARS generates also a lot of stats described in Sensor to full resolution dsm main pipeline.