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
my code:
JavaScript
x
17
17
1
import cv2
2
import numpy
3
import sys
4
5
if __name__ == '__main__':
6
7
8
#get current frame from webcam
9
cam = cv2.VideoCapture(0)
10
img = cam.read()
11
12
#how draw a circle????
13
14
cv2.imshow('WebCam', img)
15
16
cv2.waitKey()
17
Thanks in advance.
Advertisement
Answer
JavaScript
1
12
12
1
cv2.circle(img, center, radius, color, thickness=1, lineType=8, shift=0) → None
2
Draws a circle.
3
4
Parameters:
5
img (CvArr) – Image where the circle is drawn
6
center (CvPoint) – Center of the circle
7
radius (int) – Radius of the circle
8
color (CvScalar) – Circle color
9
thickness (int) – Thickness of the circle outline if positive, otherwise this indicates that a filled circle is to be drawn
10
lineType (int) – Type of the circle boundary, see Line description
11
shift (int) – Number of fractional bits in the center coordinates and radius value
12
Use “thickness” parameter for only the border.