5.6.8 Line segment detection

Detect line segments in raster

Detailed 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é©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 to export the detected lines in a vector data.

Parameters

This section describes in details the parameters available for this application. Table 5.44, page 571 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is LineSegmentDetection.




Parameter key

Parameter type

Parameter description




in

Input image

Input Image

out

Output vector data

Output Detected lines

elev

Group

Elevation management

elev.dem

Directory

DEM directory

elev.geoid

Input File name

Geoid File

elev.default

Float

Default elevation

norescale

Boolean

No rescaling in [0, 255]

inxml

XML input parameters file

Load otb application from xml file

outxml

XML output parameters file

Save otb application to xml file








Figure 5.44: Parameters table for Line segment detection.

Input Image Input image on which lines will be detected.

Output Detected lines Output detected line segments (vector data).

Elevation management This group of parameters allows to manage elevation values. Supported formats are SRTM, DTED or any geotiff. DownloadSRTMTiles application could be a useful tool to list/download tiles related to a product.

No rescaling in [0, 255] By default, the input image amplitude is rescaled between [0,255]. Turn on this parameter to skip rescaling

Load otb application from xml file Load otb application from xml file

Save otb application to xml file Save otb application to xml file

Example

To run this example in command-line, use the following:

otbcli_LineSegmentDetection -in QB_Suburb.png -out LineSegmentDetection.shp

To run this example from Python, use the following code snippet:

#!/usr/bin/python 
 
# Import the otb applications package 
import otbApplication 
 
# The following line creates an instance of the LineSegmentDetection application 
LineSegmentDetection = otbApplication.Registry.CreateApplication("LineSegmentDetection") 
 
# The following lines set all the application parameters: 
LineSegmentDetection.SetParameterString("in", "QB_Suburb.png") 
 
LineSegmentDetection.SetParameterString("out", "LineSegmentDetection.shp") 
 
# The following line execute the application 
LineSegmentDetection.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.

See also

These additional ressources can be useful for further information: