[][src]Function opencv::imgproc::line

pub fn line(
    img: &mut dyn ToInputOutputArray,
    pt1: Point,
    pt2: Point,
    color: Scalar,
    thickness: i32,
    line_type: i32,
    shift: i32
) -> Result<()>

Draws a line segment connecting two points.

The function line draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.

Parameters

  • img: Image.
  • pt1: First point of the line segment.
  • pt2: Second point of the line segment.
  • color: Line color.
  • thickness: Line thickness.
  • lineType: Type of the line. See #LineTypes.
  • shift: Number of fractional bits in the point coordinates.

C++ default parameters

  • thickness: 1
  • line_type: LINE_8
  • shift: 0