官术网_书友最值得收藏!

Drawing lines

The first function we are going to see is cv2.line(). The signature is as follows:

img = line(img, pt1, pt2, color, thickness=1, lineType=8, shift=0)

This function draws a line on the img image connecting pt1 and pt2:

cv2.line(image, (0, 0), (400, 400), colors['green'], 3)
cv2.line(image, (0, 400), (400, 0), colors['blue'], 10)
cv2.line(image, (200, 0), (200, 400), colors['red'], 3)
cv2.line(image, (0, 200), (400, 200), colors['yellow'], 10)

After coding these lines, we call the show_with_matplotlib(image, 'cv2.line()') function. The result is shown in the next screenshot:

主站蜘蛛池模板: 通榆县| 湘乡市| 军事| 搜索| 邢台县| 宝鸡市| 汨罗市| 长阳| 龙州县| 大安市| 西吉县| 和硕县| 尼木县| 玉田县| 黑龙江省| 定陶县| 郎溪县| 衡阳市| 乌海市| 汉源县| 武山县| 六枝特区| 金塔县| 达尔| 安仁县| 灵山县| 获嘉县| 宁蒗| 神农架林区| 当涂县| 淮北市| 昌宁县| 东山县| 九寨沟县| 河北省| 剑川县| 呼图壁县| 小金县| 侯马市| 周宁县| 丰镇市|