{"id":13423858,"url":"https://github.com/ruby-opencv/ruby-opencv","last_synced_at":"2025-03-15T17:32:27.681Z","repository":{"id":1267310,"uuid":"1206366","full_name":"ruby-opencv/ruby-opencv","owner":"ruby-opencv","description":"Versioned fork of the OpenCV gem for Ruby","archived":false,"fork":true,"pushed_at":"2021-04-12T13:49:35.000Z","size":54411,"stargazers_count":813,"open_issues_count":27,"forks_count":128,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-03-07T07:36:29.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rubyforge.org/projects/opencv/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jeffrafter/ruby-opencv","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby-opencv.png","metadata":{"files":{"readme":"README.md","changelog":"History.txt","contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-29T17:41:43.000Z","updated_at":"2025-02-24T11:48:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ruby-opencv/ruby-opencv","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-opencv%2Fruby-opencv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-opencv%2Fruby-opencv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-opencv%2Fruby-opencv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby-opencv%2Fruby-opencv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby-opencv","download_url":"https://codeload.github.com/ruby-opencv/ruby-opencv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243767363,"owners_count":20344912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-07-31T00:00:43.880Z","updated_at":"2025-03-15T17:32:27.675Z","avatar_url":"https://github.com/ruby-opencv.png","language":"C++","funding_links":[],"categories":["C++","Scientific"],"sub_categories":[],"readme":"![Build Status with Travis CI](https://travis-ci.org/ruby-opencv/ruby-opencv.svg?branch=master)\n\n# ruby-opencv\n\nAn OpenCV wrapper for Ruby.\n\n* Web site: \u003chttps://github.com/ruby-opencv/ruby-opencv\u003e\n* Ruby 2.x and OpenCV 2.4.13 are supported.\n* [Documentation](http://www.rubydoc.info/gems/ruby-opencv/frames)\n\n## Requirement\n\n* OpenCV \u003chttp://opencv.org/\u003e\n  * [Download](http://sourceforge.net/projects/opencvlibrary/)\n  * [Install guide](http://docs.opencv.org/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html#table-of-content-introduction)\n\n## Install\n### Linux/Mac\n1. Install [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/)\n2. Install ruby-opencv\n\n```\n$ gem install ruby-opencv -- --with-opencv-dir=/path/to/opencvdir\n```\n\nNote: **/path/to/opencvdir** is the directory where you installed OpenCV.\n\n\n### Windows (RubyInstaller)\n\nSee [install-ruby-opencv-with-rubyinstaller-on-windows.md](install-ruby-opencv-with-rubyinstaller-on-windows.md).\n\n## Sample code\n### Load and Display an Image\n\nA sample to load and display an image. An equivalent code of [this tutorial](http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html#display-image).\n\n```ruby\nrequire 'opencv'\ninclude OpenCV\n\nif ARGV.size == 0\n  puts \"Usage: ruby #{__FILE__} ImageToLoadAndDisplay\"\n  exit\nend\n\nimage = nil\nbegin\n  image = CvMat.load(ARGV[0], CV_LOAD_IMAGE_COLOR) # Read the file.\nrescue\n  puts 'Could not open or find the image.'\n  exit\nend\n\nwindow = GUI::Window.new('Display window') # Create a window for display.\nwindow.show(image) # Show our image inside it.\nGUI::wait_key # Wait for a keystroke in the window.\n```\n\n### Face Detection\n\nA sample to detect faces from an image.\n\n```ruby\nrequire 'opencv'\ninclude OpenCV\n\nif ARGV.length \u003c 2\n  puts \"Usage: ruby #{__FILE__} source dest\"\n  exit\nend\n\ndata = './data/haarcascades/haarcascade_frontalface_alt.xml'\ndetector = CvHaarClassifierCascade::load(data)\nimage = CvMat.load(ARGV[0])\ndetector.detect_objects(image).each do |region|\n  color = CvColor::Blue\n  image.rectangle! region.top_left, region.bottom_right, :color =\u003e color\nend\n\nimage.save_image(ARGV[1])\nwindow = GUI::Window.new('Face detection')\nwindow.show(image)\nGUI::wait_key\n```\n\nFor more samples, see examples/*.rb\n\n## LICENSE:\n\nThe BSD Liscense\n\nsee LICENSE.txt\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby-opencv%2Fruby-opencv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby-opencv%2Fruby-opencv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby-opencv%2Fruby-opencv/lists"}