在图像opencv上画一个圆 [英] draw a circle over image opencv

查看:333
本文介绍了在图像opencv上画一个圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用python和opencv从网络摄像头获取图像,我想知道如何在图像上绘制一个圆圈,只是一个带有透明填充的简单绿色圆圈

Im usign python and opencv to get a image from the webcam, and I want to know how to draw a circle over my image, just a simple green circle with transparent fill

我的代码:

import cv2
import numpy
import sys

if __name__ == '__main__':


    #get current frame from webcam
    cam = cv2.VideoCapture(0)
    img = cam.read()

    #how draw a circle????

    cv2.imshow('WebCam', img)

    cv2.waitKey()

提前谢谢.

推荐答案

cv2.circle(img, center, radius, color, thickness=1, lineType=8, shift=0) → None
Draws a circle.

Parameters: 
img (CvArr) – Image where the circle is drawn
center (CvPoint) – Center of the circle
radius (int) – Radius of the circle
color (CvScalar) – Circle color
thickness (int) – Thickness of the circle outline if positive, otherwise this indicates that a filled circle is to be drawn
lineType (int) – Type of the circle boundary, see Line description
shift (int) – Number of fractional bits in the center coordinates and radius value

仅对边框使用厚度"参数.

Use "thickness" parameter for only the border.

这篇关于在图像opencv上画一个圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆