{"id":27177266,"url":"https://github.com/kaifcoder/snake-game-based-on-opencv","last_synced_at":"2026-02-05T22:31:55.359Z","repository":{"id":140802041,"uuid":"526988689","full_name":"kaifcoder/snake-game-based-on-opencv","owner":"kaifcoder","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-20T17:04:46.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T09:50:05.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaifcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-20T17:02:42.000Z","updated_at":"2024-10-02T13:24:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"bfbe3d2e-64a6-4f10-96fa-7363c74c79c4","html_url":"https://github.com/kaifcoder/snake-game-based-on-opencv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaifcoder/snake-game-based-on-opencv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaifcoder%2Fsnake-game-based-on-opencv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaifcoder%2Fsnake-game-based-on-opencv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaifcoder%2Fsnake-game-based-on-opencv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaifcoder%2Fsnake-game-based-on-opencv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaifcoder","download_url":"https://codeload.github.com/kaifcoder/snake-game-based-on-opencv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaifcoder%2Fsnake-game-based-on-opencv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29136769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T21:59:57.939Z","status":"ssl_error","status_checked_at":"2026-02-05T21:59:57.628Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-09T13:43:10.812Z","updated_at":"2026-02-05T22:31:55.330Z","avatar_url":"https://github.com/kaifcoder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bindings to 'OpenCV' Computer Vision Library\n\n\u003e Experimenting with computer vision and machine learning in R. This \n  package exposes some of the available 'OpenCV' \u003chttps://opencv.org/\u003e algorithms,\n  such as edge, body or face detection. These can either be applied to analyze \n  static images, or to filter live video footage from a camera device.\n\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/opencv)](http://cran.r-project.org/package=opencv)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/opencv)](http://cran.r-project.org/web/packages/opencv/index.html)\n\n\n## Installation\n\nOn Windows and MacOS, the package can be installed directoy from CRAN:\n\n```r\ninstall.packages(\"opencv\")\n```\n\n### Install from source\n\nTo install from source on MacOS, you need to install the opencv library from homebrew:\n\n```sh\nbrew install opencv\n```\n\nOn Ubuntu or Fedora you need [`libopencv-dev`](https://packages.debian.org/testing/libopencv-dev) or [`opencv-devel`](https://src.fedoraproject.org/rpms/opencv):\n\n```sh\nsudo apt-get install libopencv-dev\n```\n\nFor Ubuntu 16.04 (Xenial) and Ubuntu 18.04 (Bionic) we provide [a PPA](https://launchpad.net/~cran/+archive/ubuntu/opencv) with more recent versions of OpenCV:\n\n```sh\nsudo add-apt-repository ppa:cran/opencv\nsudo apt-get install libopencv-dev\n```\n\nAnd then install the R bindings:\n\n```r\ninstall.packages(\"opencv\", type = \"source\")\n```\n\n## Basic stuff:\n\nFace recognition:\n\n```r\nunconf \u003c- ocv_read('https://jeroen.github.io/images/unconf18.jpg')\nfaces \u003c- ocv_face(unconf)\nocv_write(faces, 'faces.jpg')\n```\n\nOr get the face location data:\n\n```r\nfacemask \u003c- ocv_facemask(unconf)\nattr(facemask, 'faces')\n```\n\n## Live Webcam Examples\n\nLive face detection:\n\n```r\nlibrary(opencv)\nocv_video(ocv_face)\n```\n\nEdge detection:\n\n```r\nlibrary(opencv)\nocv_video(ocv_edges)\n```\n\n## Combine with Graphics\n\nReplaces the background with a plot:\n\n```r\nlibrary(opencv)\nlibrary(ggplot2)\n\n# get webcam size\ntest \u003c- ocv_picture()\nbitmap \u003c- ocv_bitmap(test)\nwidth \u003c- dim(bitmap)[2]\nheight \u003c- dim(bitmap)[3]\n\npng('bg.png', width = width, height = height)\npar(ask=FALSE)\nprint(ggplot2::qplot(speed, dist, data = cars, geom = c(\"smooth\", \"point\")))\ndev.off()\nbg \u003c- ocv_read('bg.png')\nunlink('pg.png')\nocv_video(function(input){\n  mask \u003c- ocv_mog2(input)\n  return(ocv_copyto(input, bg, mask))\n})\n```\n\nPut your face in the plot:\n\n```r\n# Overlay face filter\nocv_video(function(input){\n  mask \u003c- ocv_facemask(input)\n  ocv_copyto(input, bg, mask)\n})\n```\n\n## Live Face Survey\n\nGo stand on the left if you're a tidier\n\n```r\nlibrary(opencv)\n\n# get webcam size\ntest \u003c- ocv_picture()\nbitmap \u003c- ocv_bitmap(test)\nwidth \u003c- dim(bitmap)[2]\nheight \u003c- dim(bitmap)[3]\n\n# generates the plot\nmakeplot \u003c- function(x){\n  png('bg.png', width = width, height = height, res = 96)\n  on.exit(unlink('bg.png'))\n  groups \u003c- seq(0, width, length.out = 4)\n  left \u003c- rep(\"left\", sum(x \u003c groups[2]))\n  middle \u003c- rep(\"middle\", sum(x \u003e= groups[2] \u0026 x \u003c groups[3]))\n  right \u003c- rep(\"right\", sum(x \u003e= groups[3]))\n  f \u003c- factor(c(left, middle, right), levels = c('left', 'middle', 'right'),\n              labels = c(\"Tidy!\", \"Whatever Works\", \"Base!\"))\n  color = I(c(\"#F1BB7B\", \"#FD6467\", \"#5B1A18\"))\n  plot(f, ylim = c(0, 5),\n       main = \"Are you a tidyer or baser?\", col = color)\n  dev.off()\n  ocv_read('bg.png')\n}\n\n# overlays faces on the plot\nocv_video(function(input){\n  mask \u003c- ocv_facemask(input)\n  faces \u003c- attr(mask, 'faces')\n  bg \u003c- makeplot(faces$x)\n  return(ocv_copyto(input, bg, mask))\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaifcoder%2Fsnake-game-based-on-opencv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaifcoder%2Fsnake-game-based-on-opencv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaifcoder%2Fsnake-game-based-on-opencv/lists"}