1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

updated README.rdoc (mostly changed installation document)

This commit is contained in:
ser1zw 2011-09-23 17:33:39 +09:00
parent 468daf06e6
commit 503209160d

View file

@ -3,66 +3,78 @@
The initial Open Computer Vision library was originally developed by Intel The initial Open Computer Vision library was originally developed by Intel
Corporation. Recent development has been headed by Willow Garage, Inc. Corporation. Recent development has been headed by Willow Garage, Inc.
OpenCV Sourceforge Project * OpenCV project home http://opencv.willowgarage.com/wiki/
http://opencv.willowgarage.com/wiki/ * Download http://sourceforge.net/projects/opencvlibrary/
* Ruby/OpenCV original author's web page http://blueruby.mydns.jp/opencv
Sourceforge
http://sourceforge.net/projects/opencvlibrary/
Ruby/OpenCV Author's Web Page
http://blueruby.mydns.jp/opencv
== DESCRIPTION: == DESCRIPTION:
OpenCV Ruby Wrapper OpenCV wrapper for Ruby
== FEATURES/PROBLEMS: == FEATURES/PROBLEMS:
* First release rubygems, Some OpenCV functions wrapped. * Some OpenCV functions are wrapped.
* Ruby 1.8.7, 1.9.2 and OpenCV 2.3 are supported. * Ruby 1.8.7, 1.9.2 and OpenCV 2.3 are supported.
== DEPENDENCIES: == DEPENDENCIES:
This library relies on the OpenCV project. The following page shows how to install it: * OpenCV (required)
Ruby/OpenCV relies on the OpenCV library.
See http://opencv.willowgarage.com/wiki/InstallGuide
* ffcall (optional)
ffcall is needed to use GUI trackbar component.
Other GUI components work without ffcall.
See http://www.haible.de/bruno/packages-ffcall.html
http://opencv.willowgarage.com/wiki/InstallGuide
== INSTALLATION: == INSTALLATION:
=== Install Ruby/OpenCV manually
You can install by cloning this repository: $ git clone git://github.com/ser1zw/ruby-opencv.git
$ cd ruby-opencv
$ git checkout master # for OpenCV 2.3 or later. To use OpenCV 2.2, type "git checkout OpenCV_2.2" instead
$ ruby extconf.rb --with-opencv-dir=/path/to/opencvdir
$ make
$ make install
git clone git://github.com/ser1zw/ruby-opencv.git */path/to/opencvdir* is the path you installs OpenCV library (default: /usr/local).
Then inside the ruby-opencv folder run: For example, if you install OpenCV library to */opt/local/* like:
rake install_gem $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local/ ./OpenCV-2.3.1
$ make
$ make install
Or Install Ruby/OpenCV with the following command:
ruby extconf.rb $ ruby extconf.rb --with-opencv-dir=/opt/local
make $ make
make install $ make install
You can also add ruby-opencv in your Gemfile:
echo -e "\n"'gem "opencv", :git => "https://github.com/ser1zw/ruby-opencv"' >> Gemfile === Create Ruby/OpenCV Gem
bundle install # or bundle update You can also install this library creating a gem like:
=== Installing ruby-opencv with all dependencies on Mac OS X using macports $ git clone git://github.com/ser1zw/ruby-opencv.git
$ cd ruby-opencv
$ git checkout master # for OpenCV 2.3 or later. To use OpenCV 2.2, type "git checkout OpenCV_2.2" instead
$ bundle install
$ rake gem
$ gem install pkg/opencv-*.gem -- --with-opencv-dir=/path/to/opencvdir
sudo port install ffcall To add ruby-opencv in your Gemfile:
sudo port install opencv
Follow INSTALLATION but use this command when compiling the gem: $ echo -e "\n"'gem "opencv", :git => "https://github.com/ser1zw/ruby-opencv"' >> Gemfile
ruby extconf.rb --with-opencv-lib=/opt/local/lib --with-opencv-include=/opt/local/include/opencv2 $ bundle install # or bundle update
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: == SYNOPSIS:
=== Show Image using GUI Component
#!/usr/bin/env ruby
require "opencv" require "opencv"
image = OpenCV::IplImage.load("sample.jpg") image = OpenCV::IplImage.load("sample.jpg")
@ -70,9 +82,7 @@ That's ok.
window.show(image) window.show(image)
OpenCV::GUI::wait_key OpenCV::GUI::wait_key
For more samples, see examples/*.rb === Face Detection
== FACE DETECTION:
Here is a sample face detection program that doesn't rely on the GUI components. 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 In order for this to work you must copy the OpenCV haarcascades data into a
@ -95,15 +105,11 @@ subfolder called data.
end end
image.save_image(ARGV[1]) image.save_image(ARGV[1])
== REQUIREMENTS: For more samples, see examples/*.rb
* OpenCV 2.3 or later
http://opencv.willowgarage.com/wiki/
* ffcall (optional)
http://www.haible.de/bruno/packages-ffcall.html
== LICENSE: == LICENSE:
The BSD Liscense The BSD Liscense
see LICENSE.txt see LICENSE.txt