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:
parent
468daf06e6
commit
503209160d
1 changed files with 48 additions and 42 deletions
90
README.rdoc
90
README.rdoc
|
@ -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:
|
|
||||||
|
|
||||||
rake install_gem
|
For example, if you install OpenCV library to */opt/local/* like:
|
||||||
|
|
||||||
Or
|
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local/ ./OpenCV-2.3.1
|
||||||
|
$ make
|
||||||
|
$ make install
|
||||||
|
|
||||||
ruby extconf.rb
|
Install Ruby/OpenCV with the following command:
|
||||||
make
|
|
||||||
make install
|
|
||||||
|
|
||||||
You can also add ruby-opencv in your Gemfile:
|
$ ruby extconf.rb --with-opencv-dir=/opt/local
|
||||||
|
$ make
|
||||||
|
$ make install
|
||||||
|
|
||||||
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
|
=== Create Ruby/OpenCV Gem
|
||||||
|
You can also install this library creating a gem like:
|
||||||
|
|
||||||
sudo port install ffcall
|
$ git clone git://github.com/ser1zw/ruby-opencv.git
|
||||||
sudo port install opencv
|
$ 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
|
||||||
|
|
||||||
Follow INSTALLATION but use this command when compiling the gem:
|
To add ruby-opencv in your Gemfile:
|
||||||
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).
|
$ echo -e "\n"'gem "opencv", :git => "https://github.com/ser1zw/ruby-opencv"' >> Gemfile
|
||||||
That's ok.
|
$ bundle install # or bundle update
|
||||||
|
|
||||||
== 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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue