.. _LineSegmentDetection: LineSegmentDetection ==================== Detect line segments in raster Description ----------- This application detects locally straight contours in a image. It is based on Burns, Hanson, and Riseman method and use an a contrario validation approach (Desolneux, Moisan, and Morel). The algorithm was published by Rafael Gromponevon Gioi, Jérémie Jakubowicz, Jean-Michel Morel and Gregory Randall. The given approach computes gradient and level lines of the image and detects aligned points in line support region. The application allows exporting the detected lines in a vector data. Parameters ---------- .. contents:: :local: .. |br| raw:: html
.. |em| raw:: html   **Input Image** :code:`-in image` *Mandatory* |br| Input image on which lines will be detected. **Output Detected lines** :code:`-out vectorfile` *Mandatory* |br| Output detected line segments (vector data). Elevation management ^^^^^^^^^^^^^^^^^^^^ This group of parameters allows managing elevation values. **DEM directory** :code:`-elev.dem directory` |br| This parameter allows selecting a directory containing Digital Elevation Model files. Note that this directory should contain only DEM files. Unexpected behaviour might occurs if other images are found in this directory. Input DEM tiles should be in a raster format supported by GDAL. **Geoid File** :code:`-elev.geoid filename [dtype]` |br| Use a geoid grid to get the height above the ellipsoid in case there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles. A version of the geoid can be found on the OTB website (egm96.grd and egm96.grd.hdr at https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/master/Data/Input/DEM). **Default elevation** :code:`-elev.default float` *Default value: 0* |br| This parameter allows setting the default height above ellipsoid when there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles, and no geoid file has been set. This is also used by some application as an average elevation value. ------------ **No rescaling in [0, 255]** :code:`-norescale bool` *Default value: false* |br| By default, the input image amplitude is rescaled between [0,255]. Turn on this parameter to skip rescaling **Available RAM (MB)** :code:`-ram int` *Default value: 256* |br| Available memory for processing (in MB). Examples -------- From the command-line: .. code-block:: bash otbcli_LineSegmentDetection -in QB_Suburb.png -out LineSegmentDetection.shp From Python: .. code-block:: python import otbApplication app = otbApplication.Registry.CreateApplication("LineSegmentDetection") app.SetParameterString("in", "QB_Suburb.png") app.SetParameterString("out", "LineSegmentDetection.shp") app.ExecuteAndWriteOutput() See also -------- | On Line demonstration of the LSD algorithm is available here: http://www.ipol.im/pub/algo/gjmr_line_segment_detector/ |