

{"id":115296,"date":"2024-01-29T18:00:58","date_gmt":"2024-01-29T12:30:58","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=115296"},"modified":"2026-06-01T12:18:39","modified_gmt":"2026-06-01T06:48:39","slug":"opencv-project-snake-game","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/","title":{"rendered":"OpenCV Project &#8211; Snake Game"},"content":{"rendered":"<p>Snake game is a popular classic video game where you control a snake to eat food without hitting the walls or your own body. OpenCV is a computer vision library that can be used to create visually appealing games with smooth animations. By combining these, we can use computer vision techniques like object detection to make the game more challenging.<\/p>\n<p>We will build the game from scratch using OpenCV and add features like high scores and difficulty levels to make it fun and engaging.<\/p>\n<h2>Background<\/h2>\n<p>Snake game is a fun and classic arcade game where you control a snake to eat food and avoid obstacles and its own tail. As the snake grows longer, it becomes more challenging to maneuver.<\/p>\n<p>OpenCV is a computer vision library that can be used to create this game. You can use it to render the game&#8217;s graphics and track the snake&#8217;s movement. The game can be controlled using \u2018a\u2019, \u2018w\u2019, \u2018s\u2019, \u2018d\u2019 keys, and collision detection is implemented to detect when the snake hits the walls or its own body.<\/p>\n<p>You can also add sound effects, scorekeeping, power-ups, and multiple levels to make the game more interesting. Creating a Snake game using OpenCV can be a fun way to learn about computer vision and game development.<\/p>\n<h3>Controlling<\/h3>\n<table style=\"height: 148px\" width=\"608\">\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">Key<\/span><\/td>\n<td><span style=\"font-weight: 400\">Action<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">a<\/span><\/td>\n<td><span style=\"font-weight: 400\">Left<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">d<\/span><\/td>\n<td><span style=\"font-weight: 400\">Right<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">w<\/span><\/td>\n<td><span style=\"font-weight: 400\">Up<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">s<\/span><\/td>\n<td><span style=\"font-weight: 400\">Down<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Prerequisites for Snake Game Using OpenCV<\/h3>\n<p>It is important to have a solid understanding of the Python programming language and the OpenCV library. Apart from this, you should have the following system requirements.<\/p>\n<p>1. Python 3.7 and above<br \/>\n2. Any Python editor (VS code, Pycharm, etc.)<\/p>\n<h3>Download OpenCV Snake Game Project<\/h3>\n<p>Please download the source code of OpenCV Snake Game Project from the following link: <a href=\"https:\/\/drive.google.com\/file\/d\/16ksy7wbzoxfvs_hNy0TebFAtZ3e-OY8z\/view?usp=drive_link\"><strong>OpenCV Snake Game Project Code.<\/strong><\/a><\/p>\n<h3>Installation<\/h3>\n<p>Open windows cmd as administrator<\/p>\n<p>1. To install the opencv library run the command from the cmd.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install opencv-python\r\n<\/pre>\n<h3>Let\u2019s Implement It<\/h3>\n<p>To implement it follow the below step.<\/p>\n<p>1. First of all we are importing all the necessary libraries that are required during implementation.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\nimport random\r\n<\/pre>\n<p>2. &#8216;screen_width&#8217; and &#8216;screen_height&#8217; are the size of the game window in pixels. &#8216;board_width&#8217; and &#8216;board_height&#8217; determine the number of squares or cells on the game board. The width has 20 cells and the height has 15 cells.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">screen_width = 640\r\nscreen_height = 480\r\nboard_width = 20\r\nboard_height = 15\r\n<\/pre>\n<p>3. &#8216;block_size&#8217; is the size of each block on the game board, &#8216;score&#8217; keeps track of the player&#8217;s score, and &#8216;white&#8217;, &#8216;black&#8217;, &#8216;red&#8217;, and &#8216;green&#8217; are color codes used to set the colors of various elements on the game board.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">block_size = 32\r\nscore = 0\r\nwhite = (255, 255, 255)\r\nblack = (0, 0, 0)\r\nred = (0, 0, 255)\r\ngreen = (0, 255, 0)\r\n<\/pre>\n<p>4. This code initializes a 2D image array called &#8216;screen&#8217; with the dimensions of the game screen and sets its data type to np.uint8.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">screen = np.zeros((screen_height, screen_width, 3), np.uint8)\r\n<\/pre>\n<p>5. These variables set up the starting position, length, and direction of the snake in the game, and also initialize an empty list to store the snake&#8217;s body position.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">x_snake= int(board_width \/ 2)\r\ny_snake= int(board_height \/ 2)\r\nsnake_length = 2\r\nsnake_direction = 1\r\nsnake_body = []\r\n<\/pre>\n<p>6. This code creates a horizontal line of snake body segments with a length of &#8216;snake_length&#8217;, starting from the initial position of the snake. The positions of the segments are stored as tuples in the &#8216;snake_body&#8217; list.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for i in range(snake_length):\r\n    snake_body.append((x_snake- i, snake_y))\r\n<\/pre>\n<p>7. These lines of code randomly generate the x and y coordinates for the food item on the game board within the limits of the board.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">food_x = random.randint(0, board_width - 1)\r\nfood_y = random.randint(0, board_height - 1)\r\n<\/pre>\n<p>8. Define the font that we will use for displaying text.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">font = cv2.FONT_HERSHEY_SIMPLEX\r\n<\/pre>\n<p>9. Start the while loop.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">while True:\r\n<\/pre>\n<p>10. This sets the entire screen to the color black.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">screen[:] = black\r\n<\/pre>\n<p>11. This code draws the snake&#8217;s body using OpenCV by creating a line between the center coordinates of each block of the snake.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for i, block in enumerate(snake_body):\r\n        x, y = block\r\n        if i == 0:\r\n            start_pos = (int((x+0.5)*block_size), int((y+0.5)*block_size))\r\n        else:\r\n            end_pos = (int((x+0.5)*block_size), int((y+0.5)*block_size))\r\n            cv2.line(screen, start_pos, end_pos, white, block_size)\r\n            start_pos = end_pos\r\n<\/pre>\n<p>12. This code displays the food as a yellow circle and the score as text on the game window using OpenCV. The cv2.circle() function is used to draw the food at the center coordinates, and the cv2.putText() function is used to display the score as text at a specific location on the screen.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.circle(screen, (int((food_x+0.5)*block_size), int((food_y+0.5)*block_size)), int(block_size\/2), (0, 255, 255), -1)\r\n\r\n    cv2.putText(screen, f\"Score: {score}\", (10, screen_height - 20), font, 1, white, 2, cv2.LINE_AA)\r\n<\/pre>\n<p>13. This code updates the position of the snake&#8217;s head based on its current direction by either increasing or decreasing the x or y coordinate of the head, depending on which direction the snake is moving.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if snake_direction == 0:\r\n        x_snake-= 1\r\n    elif snake_direction == 1:\r\n        y_snake-= 1\r\n    elif snake_direction == 2:\r\n        x_snake+= 1\r\n    elif snake_direction == 3:\r\n        y_snake+= 1\r\n<\/pre>\n<p>14. This code adds a new block representing the head of the snake to the front of the snake_body list, and then removes the oldest block from the end of the list if its length is greater than the current score, effectively maintaining the snake&#8217;s length based on its score.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">snake_body.insert(0, (snake_x, snake_y))\r\n    if len(snake_body) &gt; snake_length:\r\n        snake_body.pop()\r\n<\/pre>\n<p>15. This code checks if the snake has eaten the food. If it has, then it increases the length of the snake by one block, updates the score by one, and generates a new random location for the food on the game board.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if x_snake== food_x and y_snake== food_y:\r\n        snake_length += 1\r\n        score=score+1\r\n        food_x = random.randint(0, board_width - 1)\r\n        food_y = random.randint(0, board_height - 1)\r\n<\/pre>\n<p>16. This code checks if the snake is outside the game board. If it is, the game is over, and &#8220;Game Over&#8221; is displayed in the center of the screen. The program then waits for a key press, and the game ends.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if x_snake&lt; 0 or x_snake&gt;= board_width or y_snake&lt; 0 or y_snake&gt;= board_height:\r\n        cv2.putText(screen, \"Game Over\", (200, 200), font, 3, white, 3, cv2.LINE_AA)\r\n        cv2.imshow(\"DataFlair\", screen)\r\n        cv2.waitKey(0)\r\n        break\r\n<\/pre>\n<p>17. This code checks if the snake&#8217;s head collides with its body. If there is a collision, the game is over, and the text &#8220;Game Over&#8221; is displayed in the center of the screen. The program then waits for a short time and the loop is broken, ending the game.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if (snake_x, snake_y) in snake_body[1:]:\r\n        cv2.putText(screen, \"Game Over\", (200, 200), font, 3, white, 3, cv2.LINE_AA)\r\n        cv2.imshow(\"DataFlair\", screen)\r\n        cv2.waitKey(100)\r\n        break\r\n<\/pre>\n<p>18. This line of code displays the current game screen in a window with the title &#8220;DataFlair&#8221; using the cv2.imshow() function from the OpenCV library.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.imshow(\"DataFlair\", screen)\r\n<\/pre>\n<p>19. This code listens for keyboard input and updates the direction of a snake character in a game based on the key pressed. The &#8216;q&#8217; key can be used to exit the game loop. The snake moves left, up, right, or down based on the &#8216;a&#8217;, &#8216;w&#8217;, &#8216;d&#8217;, or &#8216;s&#8217; keys pressed respectively.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">key = cv2.waitKey(150)\r\n   if key == ord('q'):\r\n       break\r\n   elif key == ord('a'):\r\n       snake_direction = 0\r\n   elif key == ord('w'):\r\n       snake_direction = 1\r\n   elif key == ord('d'):\r\n       snake_direction = 2\r\n   elif key == ord('s'):\r\n       snake_direction = 3\r\n<\/pre>\n<h3>Opencv Snake Game Output<\/h3>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/Snake-Game-with-OpenCV-Python.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-131987 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/Snake-Game-with-OpenCV-Python.webp\" alt=\"Snake Game with OpenCV Python\" width=\"1920\" height=\"1080\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/Snake-Game-with-OpenCV-Python-output-1.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-131991 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/Snake-Game-with-OpenCV-Python-output-1.webp\" alt=\"Snake Game with OpenCV Python output\" width=\"1920\" height=\"1080\" \/><\/a><\/p>\n<h3>OpenCV Snake Game Video Output<\/h3>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/snake-game-with-opencv-video-output-.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-132685 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/snake-game-with-opencv-video-output-.webp\" alt=\"snake game with opencv video output\" width=\"600\" height=\"338\" \/><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>The snake game using OpenCV is a fun and interactive program where users control a snake character with their keyboard. The code listens for keyboard input and updates the snake&#8217;s direction based on the key pressed. The game can be exited with the &#8216;q&#8217; key. OpenCV can be used to create engaging and interactive games like this one. Additional features like collision detection, score tracking, and different difficulty levels can make the game even more enjoyable.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2523,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/16ksy7wbzoxfvs_hNy0TebFAtZ3e-OY8z\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601064800\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/16ksy7wbzoxfvs_hNy0TebFAtZ3e-OY8z\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-02 06:39:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-10 02:58:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-18 01:01:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-21 02:31:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-25 02:00:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-07 07:13:40&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-07 07:13:40&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Snake game is a popular classic video game where you control a snake to eat food without hitting the walls or your own body. OpenCV is a computer vision library that can be used&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":131986,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27755],"tags":[27732,21719,30129,30134,30133,30118,30136,30135],"class_list":["post-115296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencv-tutorials","tag-opencv-project-ideas","tag-opencv-projects","tag-opencv-projects-for-practice","tag-opencv-snake-game","tag-opencv-snake-game-project","tag-python-opencv-projects","tag-python-opencv-snake-game","tag-snake-game-using-opencv"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>OpenCV Project - Snake Game - DataFlair<\/title>\n<meta name=\"description\" content=\"The snake game using OpenCV is a fun and interactive program where users control a snake character with their keyboard.\" \/>\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\/opencv-project-snake-game\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenCV Project - Snake Game - DataFlair\" \/>\n<meta property=\"og:description\" content=\"The snake game using OpenCV is a fun and interactive program where users control a snake character with their keyboard.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/\" \/>\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-01-29T12:30:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T06:48:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/OpenCV-Snake-Game.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=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpenCV Project - Snake Game - DataFlair","description":"The snake game using OpenCV is a fun and interactive program where users control a snake character with their keyboard.","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\/opencv-project-snake-game\/","og_locale":"en_US","og_type":"article","og_title":"OpenCV Project - Snake Game - DataFlair","og_description":"The snake game using OpenCV is a fun and interactive program where users control a snake character with their keyboard.","og_url":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-01-29T12:30:58+00:00","article_modified_time":"2026-06-01T06:48:39+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/OpenCV-Snake-Game.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"OpenCV Project &#8211; Snake Game","datePublished":"2024-01-29T12:30:58+00:00","dateModified":"2026-06-01T06:48:39+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/"},"wordCount":1020,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/OpenCV-Snake-Game.webp","keywords":["opencv project ideas","opencv projects","opencv projects for practice","opencv snake game","opencv snake game project","python opencv projects","python opencv snake game","snake game using opencv"],"articleSection":["OpenCV Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/","url":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/","name":"OpenCV Project - Snake Game - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/OpenCV-Snake-Game.webp","datePublished":"2024-01-29T12:30:58+00:00","dateModified":"2026-06-01T06:48:39+00:00","description":"The snake game using OpenCV is a fun and interactive program where users control a snake character with their keyboard.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/OpenCV-Snake-Game.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/OpenCV-Snake-Game.webp","width":1200,"height":628,"caption":"OpenCV Snake Game"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/opencv-project-snake-game\/#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":"OpenCV Project &#8211; Snake Game"}]},{"@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\/115296","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=115296"}],"version-history":[{"count":9,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115296\/revisions"}],"predecessor-version":[{"id":148595,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115296\/revisions\/148595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/131986"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=115296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=115296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=115296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}