Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

I'm using python and OpenCV to get a picture from the webcam, and I need to realize how to draw a hover over my picture, simply a straightforward green hover with straightforward fill

code:

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()

1 Answer

0 votes
by (26.4k points)

Try the following code:

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\

Come and Join this python certification course to gain more knowledge

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...