• aircv 工具使用


    """
    sudo pip3 install opencv-python
    sudo pip3 install -i http://gfx-assets.fm.intel.com/artifactory/api/pypi/pypi-gsae/simple --trusted-host gfx-assets.fm.intel.com pbr
    sudo pip3 install -i http://gfx-assets.fm.intel.com/artifactory/api/pypi/pypi-gsae/simple --trusted-host gfx-assets.fm.intel.com aircv
    """

    import cv2
    import aircv as ac

    """
    主要有
    cv2.line()// 画线,
    cv2.circle() // 画圆
    cv2.rectangle()// 长方形
    cv2.ellipse() // 椭圆
    cv2.putText() // 文字绘制

    主要参数
    img:源图像
    color:需要传入的颜色
    thickness: 线条的粗细,默认值是1
    linetype:线条的类型,8连接,抗锯齿等。默认情况是8连接。
    cv2.LINE_AA为抗锯齿,这样看起来会非常平滑
    原文链接:
    https://blog.csdn.net/weixin_41115751/article/details/84137783
    """

    def draw_circle(img,pos,circle_radius,color,line_width):
    cv2.circle(img,pos,circle_radius,color,line_width)
    cv2.imshow('objDetect',imsrc)
    cv2.waitKey(0)
    cv2.destroyAllWindows()


    import platform
    print(platform.uname())

    if __name__=="__main__":
    png_path=r'/img/start.png'
    aid_path='./img/start1.png'
    imsrc=ac.imread(png_path)
    imobj=ac.imread(aid_path)

    pos=ac.find_template(imsrc,imobj)
    circle_center_pos = tuple(list(map(int,list(pos['result']))))
    print("圆心位置",circle_center_pos)
    circle_radius=50
    color = (255,0,0)
    line_width = 2
    draw_circle(imsrc,circle_center_pos,circle_radius,color,line_width)

  • 相关阅读:
    mysql常用基本命令
    mysql8.0.13下载与安装图文教程
    k8s ingress 增加跨域配置
    Jenkins 备份恢复插件 thinBackup 使用
    k8s HA master 节点宕机修复
    nginx 跨域问题解决
    mongodb 3.4.24 主从复制
    k8s 线上安装 jenkins并结合 jenkinsfile 实现 helm 自动化部署
    k8s helm 运用与自建helm仓库chartmuseum
    centos6 源码安装 unzip
  • 原文地址:https://www.cnblogs.com/llx--20190411/p/15338540.html
Copyright © 2020-2023  润新知