

{"id":120216,"date":"2024-03-04T18:00:21","date_gmt":"2024-03-04T12:30:21","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120216"},"modified":"2024-03-04T18:38:30","modified_gmt":"2024-03-04T13:08:30","slug":"drawing-circle-line-rectangle-using-opencv","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/","title":{"rendered":"Drawing Circle, Line, Rectangle using OpenCV"},"content":{"rendered":"<p>Step into the fascinating world of computer vision and unleash your creativity with OpenCV! In this visual journey, we&#8217;ll explore the magical realm of drawing circles, lines, and rectangles on digital canvases. Whether you&#8217;re a seasoned artist or a curious tech enthusiast, prepare to be captivated as we bring static images to life with the stroke of Python code.<\/p>\n<p>Let&#8217;s embark on an exciting adventure of shapes, colours, and boundless possibilities &#8211; all powered by the remarkable capabilities of OpenCV.<\/p>\n<h2>Creating lines with OpenCV&#8217;s cv2.line():<\/h2>\n<p>OpenCV&#8217;s cv2.line() function is a powerful tool that opens up a world of visual expression, allowing you to draw lines on images and create compelling graphics effortlessly. Whether you&#8217;re enhancing images, building computer vision applications, or exploring the realm of digital artistry, cv2.line() is an essential function in your creative toolkit.<\/p>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.line(img, pt1, pt2, color, thickness)<\/pre>\n<p><strong>Parameters:<\/strong><\/p>\n<ul>\n<li><strong>Img:<\/strong> The input image or canvas on which you want to draw the line.<\/li>\n<li><strong>Pt1:<\/strong> The starting point of the line, specified as a tuple (x1, y1) representing the coordinates of the first endpoint.<\/li>\n<li><strong>pt2:<\/strong> The ending point of the line, specified as a tuple (x2, y2) representing the coordinates of the second endpoint.<\/li>\n<li><strong>Color:<\/strong> The color of the line in BGR format (Blue, Green, Red). For example, to draw a green line, use (0, 255, 0).<\/li>\n<li><strong>Thickness:<\/strong> The thickness of the line. A positive integer value determines the line thickness. If you specify a negative value or use cv2.FILLED, the shape will be filled.<\/li>\n<\/ul>\n<p><strong>Code with Explanation:<\/strong><\/p>\n<p><strong>Let&#8217;s walk through a simple example to illustrate how cv2.line() works:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Create a blank canvas (black image) of size 800x600\r\ncanvas = np.zeros((600, 800, 3), dtype=np.uint8)\r\n# Define the start and end points of the line\r\nstart_point = (100, 200)\r\nend_point = (600, 400)\r\n\r\n# Define the color of the line in BGR format (Green color)\r\ncolor = (0, 255, 0)\r\n# Set the thickness of the line\r\nthickness = 2\r\n\r\n# Draw the line on the canvas\r\ncv2.line(canvas, start_point, end_point, color, thickness)\r\n# Display the canvas with the drawn line\r\ncv2.imshow('Canvas with Line', canvas)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Creating-lines-with-OpenCV.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125856 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Creating-lines-with-OpenCV.webp\" alt=\"Creating lines with OpenCV\" width=\"996\" height=\"785\" \/><\/a><\/p>\n<ul>\n<li>In this example, we begin by importing the necessary libraries, including OpenCV and NumPy.<\/li>\n<li>We then create a blank canvas using NumPy &#8211; a 600&#215;800 pixel black image.<\/li>\n<li>Next, we define the start and end points of the line we want to draw. The line starts at coordinates (100, 200) and ends at coordinates (600, 400).<\/li>\n<li>We also choose the color of the line as green (BGR value of (0, 255, 0)) and set the line thickness to 2 pixels.<\/li>\n<li>By calling `cv2.line()`, we draw the line on the canvas with the specified parameters.<\/li>\n<li>In this case, the result will be a green line starting from (100, 200) and ending at (600, 400).<\/li>\n<li>Finally, we display the canvas with the drawn line using `cv2.imshow()`.<\/li>\n<li>With cv2.line() at your command, you can effortlessly add lines to your images, unlocking endless possibilities for visual expression, artistic creation, and innovative computer vision applications.<\/li>\n<li>Embrace the beauty of lines and paint your vision on the canvas of imagination with OpenCV&#8217;s cv2.line().<\/li>\n<\/ul>\n<h3>Creating Rectangle in OpenCV with cv2.rectangle() :<\/h3>\n<p>OpenCV&#8217;s cv2.rectangle() function empowers you to breathe life into your images by effortlessly adding rectangles to your canvas. The ability to draw rectangles is a fundamental yet crucial skill for various applications, including object detection, image annotation, and creative artwork.<\/p>\n<p>In this section, we&#8217;ll delve into the syntax, parameters, and a practical code example to master the art of geometric design with cv2.rectangle().<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.rectangle(img, pt1, pt2, color, thickness)<\/pre>\n<p><strong>Parameters:<\/strong><\/p>\n<ul>\n<li><strong>Img:<\/strong> The input image or canvas on which you want to draw the rectangle.<\/li>\n<li><strong>Pt1:<\/strong> The coordinates of the top-left corner of the rectangle, specified as a tuple (x1, y1).<\/li>\n<li><strong>Pt2:<\/strong> The coordinates of the bottom-right corner of the rectangle, specified as a tuple (x2, y2).<\/li>\n<li><strong>color:<\/strong> The colour of the rectangle in BGR format (Blue, Green, Red). For example, to draw a blue rectangle, use (255, 0, 0).<\/li>\n<li><strong>Thickness:<\/strong> The thickness of the rectangle border. A positive integer value determines the line thickness. If you specify a negative value or use cv2.FILLED, the shape will be filled.<\/li>\n<\/ul>\n<p><strong>Code with Explanation :<\/strong><\/p>\n<p><strong>Let&#8217;s explore a practical example to understand how cv2.rectangle() works :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Create a blank canvas (black image) of size 800x600\r\ncanvas = np.zeros((600, 800, 3), dtype=np.uint8)\r\n\r\n# Define the top-left and bottom-right points of the rectangle\r\ntop_left = (100, 200)\r\nbottom_right = (600, 400)\r\n\r\n# Define the color of the rectangle in BGR format (Blue color)\r\ncolor = (255, 0, 0)\r\n\r\n# Set the thickness of the rectangle border\r\nthickness = 2\r\n\r\n# Draw the rectangle on the canvas\r\ncv2.rectangle(canvas, top_left, bottom_right, color, thickness)\r\n\r\n# Display the canvas with the drawn rectangle\r\ncv2.imshow('Canvas with Rectangle', canvas)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rectangle-in-OpenCV.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125857 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rectangle-in-OpenCV.webp\" alt=\"Rectangle in OpenCV\" width=\"990\" height=\"787\" \/><\/a><\/p>\n<ul>\n<li>In this example, we start by importing the necessary libraries &#8211; OpenCV and NumPy.<\/li>\n<li>Next, we create a blank canvas using NumPy, which is a black image with dimensions 600&#215;800 pixels.<\/li>\n<li>Then, we define the top-left and bottom-right points of the rectangle. The top-left corner is located at coordinates (100, 200), and the bottom-right corner is positioned at coordinates (600, 400).<\/li>\n<li>We chose the color of the rectangle as blue, indicated in BGR format with the tuple (255, 0, 0). The thickness of the rectangle border is set to 2 pixels.<\/li>\n<li>By calling `cv2.rectangle()`, we draw the rectangle on the canvas with the specified parameters.<\/li>\n<li>In this case, a blue rectangle is formed with the top-left corner at (100, 200) and the bottom-right corner at (600, 400).<\/li>\n<li>Finally, we showcase the canvas with the drawn rectangle using `cv2.imshow()`.<\/li>\n<li>With cv2.rectangle() at your disposal, you can unlock a world of possibilities in geometric design and visual expression.<\/li>\n<li>Whether you&#8217;re enhancing images, building computer vision applications, or delving into the realms of creative artwork, mastering the art of rectangles with OpenCV will undoubtedly be a valuable asset in your journey.<\/li>\n<\/ul>\n<h3>Creating Circle in OpenCV with cv2.circle():<\/h3>\n<p>OpenCV&#8217;s cv2.circle() function introduces you to the enchanting world of circles, where curves speak volumes and elegance knows no bounds. Drawing circles on images can breathe life into your visual creations, be it for object detection, image annotations, or artistic expression.<\/p>\n<p>In this section, we&#8217;ll unravel the syntax, parameters, and a practical code example to help you embrace the beauty of curves with cv2.circle().<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.circle(img, center, radius, color, thickness)<\/pre>\n<p><strong>Parameters:<\/strong><\/p>\n<ul>\n<li><strong>img:<\/strong> The input image or canvas on which you want to draw the circle.<\/li>\n<li><strong>Center:<\/strong> The center coordinates of the circle, specified as a tuple (center_x, center_y).<\/li>\n<li>The circle&#8217;s radius is measured in pixels and expressed as a positive integer.<\/li>\n<li><strong>Color:<\/strong> The color of the circle in BGR format (Blue, Green, Red). For example, to draw a green circle, use `(0, 255, 0)`.<\/li>\n<li><strong>Thickness:<\/strong> The thickness of the circle&#8217;s outline. Use a positive integer for the outline thickness or a negative value for a filled circle.<\/li>\n<\/ul>\n<p><strong>Code with Explanation :<\/strong><\/p>\n<p><strong>Let&#8217;s immerse ourselves in a practical example to understand how cv2.circle() works:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Create a blank canvas (black image) of size 800x600\r\ncanvas = np.zeros((600, 800, 3), dtype=np.uint8)\r\n\r\n# Define the center coordinates of the circle\r\ncenter = (400, 300)\r\n\r\n# Define the radius of the circle in pixels\r\nradius = 100\r\n\r\n# Define the color of the circle in BGR format (Green color)\r\ncolor = (0, 255, 0)\r\n\r\n# Set the thickness of the circle's outline\r\nthickness = 2\r\n\r\n# Draw the circle on the canvas\r\ncv2.circle(canvas, center, radius, color, thickness)\r\n\r\n# Display the canvas with the drawn circle\r\ncv2.imshow('Canvas with Circle', canvas)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Circle-in-OpenCV.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125859 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Circle-in-OpenCV.webp\" alt=\"Circle in OpenCV\" width=\"992\" height=\"777\" \/><\/a><\/p>\n<ul>\n<li>In this example, we begin by importing the required libraries, namely OpenCV and NumPy.<\/li>\n<li>We then create a blank canvas using NumPy, representing a black image with dimensions 600&#215;800 pixels.<\/li>\n<li>Next, we define the center coordinates of the circle using the tuple (400, 300). The circle will be centered at the point (400, 300) on the canvas.<\/li>\n<li>We also specify the radius of the circle as 100 pixels and the color of the circle as green, indicated in BGR format with the tuple (0, 255, 0). The thickness of the circle&#8217;s outline is set to 2 pixels.<\/li>\n<li>By calling `cv2.circle()`, we draw the circle on the canvas with the specified parameters. In this instance, a green circle with a radius of 100 pixels is created, centered at (400, 300).<\/li>\n<li>Finally, we showcase the canvas with the drawn circle using `cv2.imshow()`.<\/li>\n<li>With cv2.circle() in your repertoire, you can gracefully adorn your images with captivating curves and discover the infinite allure of circles in the world of visual artistry and computer vision. Embrace the beauty of curves, and let your creativity flow boundlessly with OpenCV&#8217;s cv2.circle().<\/li>\n<\/ul>\n<h3>Creating Ellipses in OpenCV: Crafting Curves of Elegance<\/h3>\n<p>In the realm of computer vision, shapes are the building blocks of understanding the visual world. Among these, ellipses stand as elegant symbols of symmetry and grace. OpenCV, with its versatile toolkit, provides us with the means to not only detect but also to create these graceful curves.<\/p>\n<p>In this exploration, we delve into the art of Creating Ellipses in OpenCV, where we&#8217;ll unravel the syntax, parameters, and code that enable us to craft curves that transcend pixels and echo the language of beauty.<\/p>\n<p><strong>cv2.ellipse() &#8211; Syntax and Parameters :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.ellipse(image, center, axes, angle, startAngle, endAngle, color, thickness)<\/pre>\n<ul>\n<li><strong>image:<\/strong> The image on which to draw the ellipse.<\/li>\n<li><strong>center:<\/strong> The coordinates of the center of the ellipse.<\/li>\n<li><strong>axes:<\/strong> The lengths of the major and minor axes.<\/li>\n<li><strong>angle:<\/strong> The rotation angle of the ellipse in degrees.<\/li>\n<li><strong>startAngle:<\/strong> The starting angle of the ellipse arc in degrees.<\/li>\n<li><strong>endAngle:<\/strong> The ending angle of the ellipse arc in degrees.<\/li>\n<li><strong>color:<\/strong> The color of the ellipse.<\/li>\n<li><strong>thickness:<\/strong> The thickness of the ellipse boundary line.<\/li>\n<\/ul>\n<p><strong>Code Example &#8211; Creating Ellipses :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Create a black image\r\nimage = np.zeros((400, 400, 3), dtype=np.uint8)\r\n\r\n# Define ellipse parameters\r\ncenter = (200, 200)\r\naxes = (100, 50)\r\nangle = 30\r\nstartAngle = 0\r\nendAngle = 360\r\ncolor = (0, 255, 0)\r\nthickness = 2\r\n\r\n# Draw the ellipse on the image\r\ncv2.ellipse(image, center, axes, angle, startAngle, endAngle, color, thickness)\r\n\r\n# Display the image\r\ncv2.imshow('Ellipse', image)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Ellipses-in-OpenCV.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125860 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Ellipses-in-OpenCV.webp\" alt=\"Ellipses in OpenCV\" width=\"604\" height=\"634\" \/><\/a><\/p>\n<p>In this code example, we start by creating a black image using NumPy &#8211; a canvas for our ellipse. We then define the parameters of the ellipse, including the center coordinates, lengths of major and minor axes, rotation angle, and arc angles.<\/p>\n<p>Using cv2.ellipse(), we draw the ellipse on the image with the specified parameters. The ellipse will be green (color (0, 255, 0)) and have a boundary line thickness of 2.<\/p>\n<p>Finally, we display the image using cv2.imshow(), and the ellipses&#8217; graceful curves come to life.<\/p>\n<p>Creating ellipses in OpenCV isn&#8217;t merely about drawing shapes; it&#8217;s about crafting curves that encapsulate symmetry and elegance. Through the cv2.ellipse() function, we mold pixels into forms that mirror the beauty found in the natural world. As we master the art of creating ellipses, we unlock the potential to enhance our understanding of shapes and patterns, enriching our connection with the visual tapestry that surrounds us.<\/p>\n<h3>Summary<\/h3>\n<p>In this enlightening journey, we have delved into the fascinating world of computer vision and the boundless artistic potential of OpenCV. Through the use of three fundamental functions &#8211; cv2.circle(), cv2.line(), and cv2.rectangle() &#8211; we&#8217;ve harnessed the power to draw captivating circles, lines, and rectangles on digital canvases.<\/p>\n<p>OpenCV has unveiled a realm of creative expression, offering a seamless blend of technology and artistry. So, wield the brush of code, let your creativity flow, and paint your imagination with the art of geometric design. OpenCV has ignited the spark, and the canvas of possibilities awaits your next stroke of brilliance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step into the fascinating world of computer vision and unleash your creativity with OpenCV! In this visual journey, we&#8217;ll explore the magical realm of drawing circles, lines, and rectangles on digital canvases. Whether you&#8217;re&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":120218,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27755],"tags":[30010,30011,31028,9267,30009,29991],"class_list":["post-120216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencv-tutorials","tag-draw-circle-line-rectangle-using-opencv","tag-drawing-functions-in-opencv","tag-learn-opencv","tag-opencv","tag-opencv-drawing-functions","tag-opencv-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Drawing Circle, Line, Rectangle using OpenCV - DataFlair<\/title>\n<meta name=\"description\" content=\"Use of three fundamental functions - cv2.circle(), cv2.line(), and cv2.rectangle() - we&#039;ve the power to draw captivating circles, lines, and rectangles.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Drawing Circle, Line, Rectangle using OpenCV - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Use of three fundamental functions - cv2.circle(), cv2.line(), and cv2.rectangle() - we&#039;ve the power to draw captivating circles, lines, and rectangles.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-04T12:30:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-04T13:08:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/drawing-circle-line-rectrangle-using-opencv.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Drawing Circle, Line, Rectangle using OpenCV - DataFlair","description":"Use of three fundamental functions - cv2.circle(), cv2.line(), and cv2.rectangle() - we've the power to draw captivating circles, lines, and rectangles.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/","og_locale":"en_US","og_type":"article","og_title":"Drawing Circle, Line, Rectangle using OpenCV - DataFlair","og_description":"Use of three fundamental functions - cv2.circle(), cv2.line(), and cv2.rectangle() - we've the power to draw captivating circles, lines, and rectangles.","og_url":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-03-04T12:30:21+00:00","article_modified_time":"2024-03-04T13:08:30+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/drawing-circle-line-rectrangle-using-opencv.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Drawing Circle, Line, Rectangle using OpenCV","datePublished":"2024-03-04T12:30:21+00:00","dateModified":"2024-03-04T13:08:30+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/"},"wordCount":1591,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/drawing-circle-line-rectrangle-using-opencv.webp","keywords":["draw circle line rectangle using opencv","drawing functions in opencv","learn opencv","opencv","opencv drawing functions","opencv tutorials"],"articleSection":["OpenCV Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/","url":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/","name":"Drawing Circle, Line, Rectangle using OpenCV - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/drawing-circle-line-rectrangle-using-opencv.webp","datePublished":"2024-03-04T12:30:21+00:00","dateModified":"2024-03-04T13:08:30+00:00","description":"Use of three fundamental functions - cv2.circle(), cv2.line(), and cv2.rectangle() - we've the power to draw captivating circles, lines, and rectangles.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/drawing-circle-line-rectrangle-using-opencv.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/09\/drawing-circle-line-rectrangle-using-opencv.webp","width":1200,"height":628,"caption":"drawing circle line rectrangle using opencv"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/drawing-circle-line-rectangle-using-opencv\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"OpenCV Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/opencv-tutorials\/"},{"@type":"ListItem","position":3,"name":"Drawing Circle, Line, Rectangle using OpenCV"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49","name":"TechVidvan Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","caption":"TechVidvan Team"},"description":"TechVidvan Team provides high-quality content &amp; courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.","url":"https:\/\/data-flair.training\/blogs\/author\/test001\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/86671"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=120216"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120216\/revisions"}],"predecessor-version":[{"id":134461,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120216\/revisions\/134461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/120218"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}