Find Line Segment🔗

Detects the longest line segments from the input image. Every pixel whose intensity is greater (or less if invert is true) than threshold is assumed to belong to a line segment.

Inputs🔗

  • image: Input image. Usually, the input comes from an edge detector.

  • threshold: Threshold for binarization.

  • invert: Inversion flag. If this value is true, inverts the result so that pixels whose gray level is less than threshold are regarded as foreground.

  • trim: If this value is true, the tool interpolates the start and end points so that they are precisely at the points where the pixel intensities cross the threshold.

Outputs🔗

  • startPoint: The start point (x, y) of the line segment as an 1-by-2 matrix. Start point is chosen so that it is closer to the origin in world coordinates than the end point.

  • endPoint: The end point (x, y) of the detected line segment as an 1-by-2 matrix.

  • length: The length of the detected line segment or NAN if the segment was not found.