python - 在图像opencv上画一个圆圈

标签 python opencv drawing

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

enter image description here

我的代码:

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

仅对边框使用“厚度”参数。

关于python - 在图像opencv上画一个圆圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16484796/

相关文章:

java - 在两个节点(圆)之间绘制边(线)

python - 全屏 matplotlib 数字

python - 使用 pip3 : module "importlib._bootstrap" has no attribute "SourceFileLoader"

python - Pylons Paster 不重新加载代码

qt - Ubuntu 14.04 上带有 QT 的 OpenCV 意外完成

C++如何使用setpixel函数绘制色调曲线( Gamma )以绘制图形

iphone - 在iPhone上绘制自定义图形: CALayer vs. CGContext

python - 从 Pandas 数据框内的字典中提取值(Python)

python - OpenCV 中的数据类型

java - 使用 SWIG 引用外部库中的特定类