Detect Lines (Image Processing)


This operator detects (straight) lines in images.


This operator does three operations in order to find lines in images.

First the image is blurred. The reason for it is that otherwise single outliers may become an edge later on.

In the second step the Canny edge detector is used to detect edges within the image. An edge is a point where the intensity changes drastically from one pixel to the next.

Thirdly a Hough transform operation is used, to detect which edge is a line. For details on hough transform please see:


  • img

    The input image to detect the lines in


  • lines

    The image with the lines marked in them.

  • edges

    Output of the edge detection algorithm

  • exa (Data Table)

    A table with all detected lines. Most importantly their start and endpoint.

  • ori

    The original input image.


  • kernel_size Kernel size of the blurring operation. Range:
  • use_edge_detection_heuristics If set to true the two parameters of the canny edge detection are defined by just one sensetivity. The heuristic is: lower_threshold = max(0, (1.0 - sigma) * mean); upper_threshold = min(255, (1.0 + sigma) * mean); Where mean is the mean of all pixel values and sigma is the edge_detection_sensitivity Range:
  • edge_detection_sensitivity Sensitivity for the edge detection. the higher the value, the more points are edges. Range:
  • higher_edge_detection_threshold First threshold for the hysteresis procedure. The lower the number the more sensitive is the edge detection. Range:
  • lower_edge_detection_threshold Second threshold for the hysteresis procedure. The lower the number the more sensitive is the edge detection. Range:
  • distance_resolution Distance resolution of the accumulator in pixels. Range:
  • angle_resolution Angle resolution of the accumulator in degrees. Range:
  • line_detection_sensitivity Reciprocal value of accumulator threshold parameter. Only those lines are returned that get enough votes, i.e. more votes than 1/sensitivity. The lower this value, the more line are detected. Range:
  • min_line_length Minimum line length. Line segments shorter than that are rejected. Range:
  • max_line_gap Maximum allowed gap between points on the same line to link them. The higher the number the more you accept interrupted lines as one line. Range:

Tutorial Processes

Finding Lines in Hamlet Cover