Welcome to Raspbot repository
4.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 path:
/home/pi/Yahboom_Project/1.OpenCV_course/03IP_Draw_text_line_segments/ 04_Drawing line segment.ipynb
|
After running the following program, a picture will be displayed in the jupyterLab control interface, as shown below.