1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00
Versioned fork of the OpenCV gem for Ruby
Find a file
2011-08-12 02:26:54 +09:00
examples removed some unnecessary CvMat methods 2011-07-08 20:48:24 +09:00
ext/opencv uniformed code format 2011-08-12 02:26:54 +09:00
images Unflip binary files 2008-08-19 11:08:07 -04:00
setup Initial commit, with some minor changes from orig (date, exec bit, line endings, /usr/bin/env) 2008-08-19 11:01:28 -04:00
test fixed PointSet 2011-08-07 17:39:20 +09:00
.gitignore fixed an installation problem when using bundler 2011-07-26 21:53:33 +09:00
extconf.rb modified extconf.rb for environments that OpenCV is installed in non-default directory 2011-07-11 00:32:39 +09:00
Gemfile modified to be able to install both "rake package && gem install opencv-x.y.z.gem" and "ruby extconf.rb && make && make install" ways 2011-05-03 17:12:47 +09:00
Gemfile.lock updated Gemfile.lock 2011-07-28 23:02:07 +09:00
History.txt Initial commit, with some minor changes from orig (date, exec bit, line endings, /usr/bin/env) 2008-08-19 11:01:28 -04:00
License.txt Initial commit, with some minor changes from orig (date, exec bit, line endings, /usr/bin/env) 2008-08-19 11:01:28 -04:00
Manifest.txt removed Point3DSet 2011-08-12 01:31:11 +09:00
opencv.gemspec removed Point3DSet 2011-08-12 01:31:11 +09:00
Rakefile moved version.rb to ext/opencv/lib/opencv/ 2011-05-04 02:14:33 +09:00
README.rdoc changed face detection sample of README.rdoc 2011-08-12 00:27:20 +09:00

= OpenCV

The initial Open Computer Vision library was originally developed by Intel 
Corporation. Recent development has been headed by Willow Garage, Inc.

OpenCV Sourceforge Project
http://opencv.willowgarage.com/wiki/

Sourceforge
http://sourceforge.net/projects/opencvlibrary/

Ruby/OpenCV Author's Web Page
http://blueruby.mydns.jp/opencv

== DESCRIPTION:

OpenCV Ruby Wrapper

== FEATURES/PROBLEMS:

* First release rubygems, Some OpenCV functions wrapped.
* Ruby 1.8.7, 1.9.2 and OpenCV 2.3 are supported.

== DEPENDENCIES:

This library relies on the OpenCV project. The following page shows how to install it:

http://opencv.willowgarage.com/wiki/InstallGuide

== INSTALLATION:

You can install by cloning this repository:

  git clone git://github.com/ser1zw/ruby-opencv.git
  
Then inside the ruby-opencv folder run:

  rake install_gem

Or

  ruby extconf.rb
  make
  make install

You can also add ruby-opencv in your Gemfile:

  echo -e "\n"'gem "opencv", :git => "https://github.com/ser1zw/ruby-opencv"' >> Gemfile
  bundle install # or bundle update

=== Installing ruby-opencv with all dependencies on Mac OS X using macports

  sudo port install ffcall
  sudo port install opencv

Follow INSTALLATION but use this command when compiling the gem:
  ruby extconf.rb --with-opencv-lib=/opt/local/lib --with-opencv-include=/opt/local/include/opencv2
  make
  make install

Installing ffcall might not work (that's because ffcall at the moment can't be compiled on 64bit systems).
That's ok.

== SYNOPSIS:

  require "opencv"

  image = OpenCV::IplImage.load("sample.jpg")
  window = OpenCV::GUI::Window.new("preview")
  window.show(image)
  OpenCV::GUI::wait_key

For more samples, see examples/*.rb

== FACE DETECTION:

Here is a sample face detection program that doesn't rely on the GUI components.
In order for this to work you must copy the OpenCV haarcascades data into a 
subfolder called data.

  #!/usr/bin/env ruby
  require "opencv"

  if ARGV.length < 2
    puts "Usage: your_app_name source dest"
    exit
  end
 
  data = "./data/haarcascades/haarcascade_frontalface_alt.xml"
  detector = OpenCV::CvHaarClassifierCascade::load(data)
  image = OpenCV::IplImage.load(ARGV[0])
  detector.detect_objects(image).each do |region|
    color = OpenCV::CvColor::Blue
    image.rectangle! region.top_left, region.bottom_right, :color => color
  end
  image.save_image(ARGV[1])

== REQUIREMENTS:

* OpenCV 2.3 or later
  http://opencv.willowgarage.com/wiki/
* ffcall (optional)
  http://www.haible.de/bruno/packages-ffcall.html

== LICENSE:

The BSD Liscense

see LICENSE.txt