- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Draw a circle using OpenCV function circle()
In this article, we will draw a circle on an image using the OpenCV function circle().
Original Image
Algorithm
Step 1: Import OpenCV. Step 2: Define the radius of circle. Step 3: Define the center coordinates of the circle. Step 4: Define the color of the circle. Step 5: Define the thickness. Step 6: Pass the above arguments into cv2.circle() along with the image. Step 7: Display the output.
Example Code
import cv2 image = cv2.imread('testimage.jpg') radius = 100 center = (350, 175) color = (255,255,0) thickness = 15 image = cv2.circle(image, center, radius, color, thickness) cv2.imshow('Circle', image)
Output
- Related Articles
- How to draw a circle in OpenCV using Java?
- How to draw a circle in OpenCV using C++?
- How to draw a filled circle in OpenCV using Java?
- Draw a circle in using Tkinter Python
- Draw a filled polygon using the OpenCV function fillPoly()
- How to draw a circle in R?
- How to draw a circle in JavaScript?
- Java implementation of OpenCV Hough Circle Transform.
- How to draw a hollow circle in SVG?
- Draw a circle of radius ( 3.2 mathrm{~cm} ).
- How to draw circle in HTML page?
- How to draw a circle with arc() in HTML5?
- Draw a line segment AB of length 8 cm. Taking A as centre, draw a circle of radius 4 cm and taking B as centre, draw another circle of radius 3 cm. Construct tangents to each circle from the centre of the other circle.
- Draw a circle with the help of a bangle. Take a point outside the circle. Construct the pair of tangents from this point to the circle.
- Draw a circle of radius $4 cm$. Draw two tangents to the circle inclined at an angle of $60^{o}$ to each other.

Advertisements