zoukankan      html  css  js  c++  java
  • python opencv3 —— 常用工具、辅助函数、绘图函数(图像添加文本、矩形等几何形状)

    1. cv2.hconcat()、cv2.vconcat()

    将从摄像头捕获的多个图像帧,横向(cv2.hconcat)或纵向(cv2.vconcat)拼接到一起,使得可以在一个 window 中进行显示,而不是在不同的 window 中分别显示。

    while True:
        ...
        final = cv2.hconcat((img1, img2))
        cv2.imshow('final', final)
        ...

    2. 添加文本和几何形状

    • 添加文本:cv2.putText(img, ‘IoU: {.4f}’.format(iou), (10, 30), cv2.FONT_HERSHEY_SIMPLEX, .6, (0, 255, 0), 2)
      • putText(img, text, org, fontFace, fontScale, color[, thickness[, lineType[, bottomLeftOrigin]]]) -> img
    • 几何形状:
      • cv2.rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> img
      • cv2.line(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> img
      • cv2.ellipse(img, center, axes, angle, startAngle, endAngle, color[, thickness[, lineType[, shift]]]) -> img or ellipse(img, box, color[, thickness[, lineType]]) -> img
      • cv2.circle(img, center, radius, color[, thickness[, lineType[, shift]]]) -> img
  • 相关阅读:
    常用命令
    添加云存储服务
    安装Prometheus-Opeartor
    Prometheus-operator架构详解
    Helm使用详解
    莫队乱搞--BZOJ2038: [2009国家集训队]小Z的袜子(hose)
    BZOJ1443: [JSOI2009]游戏Game
    BZOJ2006: [NOI2010]超级钢琴
    BZOJ4408: [Fjoi 2016]神秘数
    hdu6110:路径交
  • 原文地址:https://www.cnblogs.com/mtcnn/p/9421611.html
Copyright © 2011-2022 走看看