23

ウェブカメラから画像を取得するために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()

前もって感謝します。

4

4 に答える 4

37
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

ボーダーのみに「厚さ」パラメーターを使用します。

于 2013-05-10T15:14:14.097 に答える
3

試す

cv2.circle(img, center, radius, color[, thickness[, lineType[, shift]]])

詳細については、ドキュメントを参照してください

于 2013-05-10T16:35:38.173 に答える