Welcome to Raspberry Pi 4B repository
4.Drawing line segment
Drawing line segment
When using OpenCV to process an image, sometimes, we need to draw line segments, rectangles, etc. on the image. OpenCV uses function line (dst, pt1, pt2, color, thickness = None, lineType = None, shift = None) to draw line segments.
Parameter Description
l dst: output image.
l pt1, pt2: required parameters, pt1 is the starting point, pt2 is the ending point.
l color: required parameters, be used to set color of line segment.
l Thickness: optional parameters, be used to set weight of line segment.
lineType: optional parameters, be used to set the type of line segment, 8 (8 adjacent connection line-default), 4 (4 adjacent connection line) and cv2.LINE_AA are anti-aliased
Code:
|
After running the following program, a picture will be displayed in the jupyterLab control interface, as shown below.