xtract.bot
POST /api/image-detect-lines

Detect straight lines in an image. Returns each line as a pair of endpoints. Useful for finding edges of buildings, roads, table boundaries.

Finds straight lines in an image using the probabilistic Hough transform. Returns each line as `{x1, y1, x2, y2}`. Tunable: minimum line length, maximum gap between segments considered the same line, accumulator threshold. Defaults are OK for natural images; raise the threshold to find only the longest, most prominent lines.

Inputs

NameTypeDefaultDescription
image*fileInput image bytes.
cannyLowernumber (0…1000)50Canny lower hysteresis threshold.
cannyUppernumber (0…1000)150Canny upper hysteresis threshold.
thresholdnumber80Hough accumulator vote threshold.
minLineLengthnumber30Minimum line segment length in pixels.
maxLineGapnumber10Maximum allowed gap (px) when joining a single line.

Response

Modes: json. Cache: yes (24h TTL).