我使用 python 和 opencv 从网络摄像头获取图像,我想知道如何在我的图像上画一个圆圈,只是一个带有透明填充的简单绿色圆圈
我的代码:
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/