line
import { line } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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.
line(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number, lineType: number, shift: number): void;4 available overloads
line(img: Mat, pt1: Point, pt2: Point, color: Scalar): void;line(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number): void;line(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number, lineType: number): void;line(img: Mat, pt1: Point, pt2: Point, color: Scalar, thickness: number, lineType: number, shift: number): void;imgInput/output value, modified by the native operation. Image.
pt1First point of the line segment.
pt2Second point of the line segment.
colorLine color.
thicknessLine thickness.
lineTypeType of the line. See #LineTypes.
shiftNumber of fractional bits in the point coordinates.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.