ruby-opencv 0.0.8.pre-x86-mingw32 → 0.0.8-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/DEVELOPERS_NOTE.md +120 -0
- data/Gemfile +1 -0
- data/Manifest.txt +2 -1
- data/README.md +98 -0
- data/Rakefile +1 -1
- data/ext/opencv/lib/opencv/version.rb +1 -1
- data/lib/opencv/version.rb +1 -1
- data/ruby-opencv.gemspec +43 -43
- metadata +7 -7
- data/README.rdoc +0 -149
data/DEVELOPERS_NOTE.md
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
# DEVELOPER'S NOTE
|
2
|
+
|
3
|
+
## Requirement to develop ruby-opencv
|
4
|
+
|
5
|
+
* OpenCV
|
6
|
+
* Git
|
7
|
+
* Microsoft Visual C++ (for mswin32)
|
8
|
+
* <http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express>
|
9
|
+
* MinGW and MSYS (for mingw32)
|
10
|
+
* gcc, g++ and MSYS are needed.
|
11
|
+
* <http://www.mingw.org>
|
12
|
+
* Some gems (see Gemfile)
|
13
|
+
* [bundler](https://github.com/carlhuda/bundler/)
|
14
|
+
* [hoe](https://github.com/seattlerb/hoe)
|
15
|
+
* [hoe-gemspec](https://github.com/flavorjones/hoe-gemspec)
|
16
|
+
* [rake-compiler](https://github.com/luislavena/rake-compiler)
|
17
|
+
* [gem-compile](https://github.com/frsyuki/gem-compile)
|
18
|
+
|
19
|
+
|
20
|
+
## Create ruby-opencv gem
|
21
|
+
Run the following commands.
|
22
|
+
When you use mingw32, use **MSYS console**, or when you use mswin32,
|
23
|
+
use [**Visual Studio Command Prompt**](http://msdn.microsoft.com/en-us/library/ms229859.aspx)
|
24
|
+
instead of cmd.exe.
|
25
|
+
|
26
|
+
```
|
27
|
+
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
28
|
+
$ cd ruby-opencv
|
29
|
+
$ git checkout master
|
30
|
+
$ bundle install
|
31
|
+
$ git ls-files > Manifest.txt
|
32
|
+
$ rake gem:spec
|
33
|
+
$ rake gem
|
34
|
+
```
|
35
|
+
**ruby-opencv-x.y.z.gem** will be created in pkg/ directory.
|
36
|
+
|
37
|
+
To create pre-build binaries, run the following commands in Windows.
|
38
|
+
|
39
|
+
```
|
40
|
+
$ cd pkg
|
41
|
+
$ gem compile ruby-opencv-*.gem
|
42
|
+
```
|
43
|
+
|
44
|
+
**ruby-opencv-x.y.z-x86-mingw32.gem** will be created when you use mingw32, or
|
45
|
+
**ruby-opencv-x.y.z-x86-mswin32.gem** when you use mswin32.
|
46
|
+
|
47
|
+
|
48
|
+
## Install ruby-opencv manually
|
49
|
+
### Linux/Mac
|
50
|
+
|
51
|
+
```
|
52
|
+
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
53
|
+
$ cd ruby-opencv
|
54
|
+
$ git checkout master
|
55
|
+
$ ruby extconf.rb --with-opencv-dir=/path/to/opencvdir
|
56
|
+
$ make
|
57
|
+
$ make install
|
58
|
+
```
|
59
|
+
|
60
|
+
Note: **/path/to/opencvdir** is the directory where you installed OpenCV.
|
61
|
+
|
62
|
+
|
63
|
+
### Windows (mswin32)
|
64
|
+
|
65
|
+
Run the following commands on [**Visual Studio Command Prompt**](http://msdn.microsoft.com/en-us/library/ms229859.aspx).
|
66
|
+
|
67
|
+
```
|
68
|
+
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
69
|
+
$ cd ruby-opencv
|
70
|
+
$ git checkout master
|
71
|
+
$ ruby extconf.rb --with-opencv-dir=C:\path\to\opencvdir\install # for your own built OpenCV library
|
72
|
+
$ nmake
|
73
|
+
$ nmake install
|
74
|
+
```
|
75
|
+
|
76
|
+
To use pre-built OpenCV libraries, set the following option to extconf.rb.
|
77
|
+
|
78
|
+
```
|
79
|
+
$ ruby extconf.rb --with-opencv-include=C:\path\to\opencvdir\build\include --with-opencv-lib=C:\path\to\opencvdir\build\x86\vc10\lib
|
80
|
+
```
|
81
|
+
|
82
|
+
|
83
|
+
### Windows (mingw32)
|
84
|
+
|
85
|
+
Run the following commands on **MSYS console**.
|
86
|
+
|
87
|
+
```
|
88
|
+
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
89
|
+
$ cd ruby-opencv
|
90
|
+
$ git checkout master
|
91
|
+
$ ruby extconf.rb --with-opencv-dir=/C/path/to/opencvdir/install # for your own built OpenCV library
|
92
|
+
$ make
|
93
|
+
$ make install
|
94
|
+
```
|
95
|
+
|
96
|
+
To use pre-built OpenCV libraries, set the following option to extconf.rb.
|
97
|
+
|
98
|
+
```
|
99
|
+
$ ruby extconf.rb --with-opencv-include=/c/path/to/opencvdir/build/include --with-opencv-lib=/c/path/to/opencvdir/build/x86/mingw/lib
|
100
|
+
```
|
101
|
+
|
102
|
+
|
103
|
+
## Run tests
|
104
|
+
|
105
|
+
To run all tests, run **test/runner.rb**
|
106
|
+
|
107
|
+
```
|
108
|
+
$ cd ruby-opencv/test
|
109
|
+
$ ruby runner.rb
|
110
|
+
```
|
111
|
+
|
112
|
+
To run tests of the specified function, run a specific test with --name option.
|
113
|
+
|
114
|
+
The following sample runs tests for CvMat#initialize
|
115
|
+
|
116
|
+
```
|
117
|
+
$ cd ruby-opencv/test
|
118
|
+
$ ruby test_cvmat.rb --name=test_initialize
|
119
|
+
```
|
120
|
+
|
data/Gemfile
CHANGED
data/Manifest.txt
CHANGED
data/README.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# ruby-opencv
|
2
|
+
|
3
|
+
An OpenCV wrapper for Ruby.
|
4
|
+
|
5
|
+
* Web site: <https://github.com/ruby-opencv/ruby-opencv>
|
6
|
+
* Ruby 1.8.7, 1.9.3 and OpenCV 2.4.3 are supported.
|
7
|
+
|
8
|
+
## Requirement
|
9
|
+
|
10
|
+
* OpenCV <http://opencv.org/>
|
11
|
+
* [Download](http://sourceforge.net/projects/opencvlibrary/)
|
12
|
+
* [Install guide](http://docs.opencv.org/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html#table-of-content-introduction)
|
13
|
+
|
14
|
+
## Install
|
15
|
+
### Linux/Mac
|
16
|
+
1. Install [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/)
|
17
|
+
2. Install ruby-opencv
|
18
|
+
|
19
|
+
```
|
20
|
+
$ gem install ruby-opencv -- --with-opencv-dir=/path/to/opencvdir
|
21
|
+
```
|
22
|
+
|
23
|
+
Note: **/path/to/opencvdir** is the directory where you installed OpenCV.
|
24
|
+
|
25
|
+
|
26
|
+
### Windows
|
27
|
+
You can use pre-build binary for Windows (mswin32, mingw32).
|
28
|
+
|
29
|
+
1. Install [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/)
|
30
|
+
2. Set path to OpenCV libraries. When you installed OpenCV to **C:\opencv**, add **C:\opencv\build\x86\vc10\bin (for mswin32)** or **C:\opencv\build\x86\mingw\bin (for mingw32)** to the systems path.
|
31
|
+
3. Install ruby-opencv
|
32
|
+
|
33
|
+
```
|
34
|
+
$ gem install ruby-opencv
|
35
|
+
```
|
36
|
+
|
37
|
+
## Sample code
|
38
|
+
### Load and Display an Image
|
39
|
+
|
40
|
+
A 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).
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'opencv'
|
44
|
+
include OpenCV
|
45
|
+
|
46
|
+
if ARGV.size == 0
|
47
|
+
puts "Usage: ruby #{__FILE__} ImageToLoadAndDisplay"
|
48
|
+
exit
|
49
|
+
end
|
50
|
+
|
51
|
+
image = nil
|
52
|
+
begin
|
53
|
+
image = CvMat.load(ARGV[0], CV_LOAD_IMAGE_COLOR) # Read the file.
|
54
|
+
rescue
|
55
|
+
puts 'Could not open or find the image.'
|
56
|
+
exit
|
57
|
+
end
|
58
|
+
|
59
|
+
window = GUI::Window.new('Display window') # Create a window for display.
|
60
|
+
window.show(image) # Show our image inside it.
|
61
|
+
GUI::wait_key # Wait for a keystroke in the window.
|
62
|
+
```
|
63
|
+
|
64
|
+
### Face Detection
|
65
|
+
|
66
|
+
A sample to detect faces from an image.
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
require 'opencv'
|
70
|
+
include OpenCV
|
71
|
+
|
72
|
+
if ARGV.length < 2
|
73
|
+
puts "Usage: ruby #{__FILE__} source dest"
|
74
|
+
exit
|
75
|
+
end
|
76
|
+
|
77
|
+
data = './data/haarcascades/haarcascade_frontalface_alt.xml'
|
78
|
+
detector = CvHaarClassifierCascade::load(data)
|
79
|
+
image = CvMat.load(ARGV[0])
|
80
|
+
detector.detect_objects(image).each do |region|
|
81
|
+
color = CvColor::Blue
|
82
|
+
image.rectangle! region.top_left, region.bottom_right, :color => color
|
83
|
+
end
|
84
|
+
|
85
|
+
image.save_image(ARGV[1])
|
86
|
+
window = GUI::Window.new('Face detection')
|
87
|
+
window.show(image)
|
88
|
+
GUI::wait_key
|
89
|
+
```
|
90
|
+
|
91
|
+
For more samples, see examples/*.rb
|
92
|
+
|
93
|
+
## LICENSE:
|
94
|
+
|
95
|
+
The BSD Liscense
|
96
|
+
|
97
|
+
see LICENSE.txt
|
98
|
+
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ hoespec = Hoe.spec 'ruby-opencv' do |s|
|
|
12
12
|
s.developer('ser1zw', 'azariahsawtikes@gmail.com')
|
13
13
|
s.developer('pcting', 'pcting@gmail.com')
|
14
14
|
|
15
|
-
s.readme_file = 'README.
|
15
|
+
s.readme_file = 'README.md'
|
16
16
|
s.history_file = 'History.txt'
|
17
17
|
s.spec_extras = { :extensions => ['extconf.rb'] }
|
18
18
|
s.test_globs = ['test/test_*.rb']
|
data/lib/opencv/version.rb
CHANGED
data/ruby-opencv.gemspec
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = "ruby-opencv"
|
5
|
-
s.version = "0.0.8.
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
8
|
-
s.authors = ["lsxi", "ser1zw", "pcting"]
|
9
|
-
s.date = "2013-01-27"
|
10
|
-
s.description = "
|
11
|
-
s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
|
12
|
-
s.extensions = ["extconf.rb"]
|
13
|
-
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "
|
14
|
-
s.files = [".gitignore", "Gemfile", "History.txt", "License.txt", "Manifest.txt", "README.
|
15
|
-
s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
|
16
|
-
s.rdoc_options = ["--main", "README.
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project = "ruby-opencv"
|
19
|
-
s.rubygems_version = "1.8.
|
20
|
-
s.summary = "OpenCV wrapper for Ruby"
|
21
|
-
s.test_files = ["test/
|
22
|
-
|
23
|
-
if s.respond_to? :specification_version then
|
24
|
-
s.specification_version = 3
|
25
|
-
|
26
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
|
28
|
-
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
29
|
-
s.add_development_dependency(%q<hoe-gemspec>, [">= 0"])
|
30
|
-
s.add_development_dependency(%q<hoe>, ["~> 3.5"])
|
31
|
-
else
|
32
|
-
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
33
|
-
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
34
|
-
s.add_dependency(%q<hoe-gemspec>, [">= 0"])
|
35
|
-
s.add_dependency(%q<hoe>, ["~> 3.5"])
|
36
|
-
end
|
37
|
-
else
|
38
|
-
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
39
|
-
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
40
|
-
s.add_dependency(%q<hoe-gemspec>, [">= 0"])
|
41
|
-
s.add_dependency(%q<hoe>, ["~> 3.5"])
|
42
|
-
end
|
43
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "ruby-opencv"
|
5
|
+
s.version = "0.0.8.20130127124736"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["lsxi", "ser1zw", "pcting"]
|
9
|
+
s.date = "2013-01-27"
|
10
|
+
s.description = ""
|
11
|
+
s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
|
12
|
+
s.extensions = ["extconf.rb"]
|
13
|
+
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "examples/matching_to_many_images/train/trainImages.txt"]
|
14
|
+
s.files = [".gitignore", "DEVELOPERS_NOTE.md", "Gemfile", "History.txt", "License.txt", "Manifest.txt", "README.md", "Rakefile", "examples/alpha_blend.rb", "examples/box.png", "examples/box_in_scene.png", "examples/contours/bitmap-contours-with-labels.png", "examples/contours/bitmap-contours.png", "examples/contours/bounding-box-detect-canny.rb", "examples/contours/contour_retrieval_modes.rb", "examples/contours/rotated-boxes.jpg", "examples/convexhull.rb", "examples/face_detect.rb", "examples/find_obj.rb", "examples/houghcircle.rb", "examples/inpaint.png", "examples/inpaint.rb", "examples/lenna-rotated.jpg", "examples/lenna.jpg", "examples/match_kdtree.rb", "examples/matching_to_many_images.rb", "examples/matching_to_many_images/query.png", "examples/matching_to_many_images/train/1.png", "examples/matching_to_many_images/train/2.png", "examples/matching_to_many_images/train/3.png", "examples/matching_to_many_images/train/trainImages.txt", "examples/paint.rb", "examples/snake.rb", "examples/stuff.jpg", "examples/tiffany.jpg", "ext/opencv/curve.cpp", "ext/opencv/curve.h", "ext/opencv/cvavgcomp.cpp", "ext/opencv/cvavgcomp.h", "ext/opencv/cvbox2d.cpp", "ext/opencv/cvbox2d.h", "ext/opencv/cvcapture.cpp", "ext/opencv/cvcapture.h", "ext/opencv/cvchain.cpp", "ext/opencv/cvchain.h", "ext/opencv/cvcircle32f.cpp", "ext/opencv/cvcircle32f.h", "ext/opencv/cvcondensation.cpp", "ext/opencv/cvcondensation.h", "ext/opencv/cvconnectedcomp.cpp", "ext/opencv/cvconnectedcomp.h", "ext/opencv/cvcontour.cpp", "ext/opencv/cvcontour.h", "ext/opencv/cvcontourtree.cpp", "ext/opencv/cvcontourtree.h", "ext/opencv/cvconvexitydefect.cpp", "ext/opencv/cvconvexitydefect.h", "ext/opencv/cverror.cpp", "ext/opencv/cverror.h", "ext/opencv/cvfeaturetree.cpp", "ext/opencv/cvfeaturetree.h", "ext/opencv/cvfont.cpp", "ext/opencv/cvfont.h", "ext/opencv/cvhaarclassifiercascade.cpp", "ext/opencv/cvhaarclassifiercascade.h", "ext/opencv/cvhistogram.cpp", "ext/opencv/cvhistogram.h", "ext/opencv/cvhumoments.cpp", "ext/opencv/cvhumoments.h", "ext/opencv/cvline.cpp", "ext/opencv/cvline.h", "ext/opencv/cvmat.cpp", "ext/opencv/cvmat.h", "ext/opencv/cvmatnd.cpp", "ext/opencv/cvmatnd.h", "ext/opencv/cvmemstorage.cpp", "ext/opencv/cvmemstorage.h", "ext/opencv/cvmoments.cpp", "ext/opencv/cvmoments.h", "ext/opencv/cvpoint.cpp", "ext/opencv/cvpoint.h", "ext/opencv/cvpoint2d32f.cpp", "ext/opencv/cvpoint2d32f.h", "ext/opencv/cvpoint3d32f.cpp", "ext/opencv/cvpoint3d32f.h", "ext/opencv/cvrect.cpp", "ext/opencv/cvrect.h", "ext/opencv/cvscalar.cpp", "ext/opencv/cvscalar.h", "ext/opencv/cvseq.cpp", "ext/opencv/cvseq.h", "ext/opencv/cvsize.cpp", "ext/opencv/cvsize.h", "ext/opencv/cvsize2d32f.cpp", "ext/opencv/cvsize2d32f.h", "ext/opencv/cvslice.cpp", "ext/opencv/cvslice.h", "ext/opencv/cvsparsemat.cpp", "ext/opencv/cvsparsemat.h", "ext/opencv/cvsurfparams.cpp", "ext/opencv/cvsurfparams.h", "ext/opencv/cvsurfpoint.cpp", "ext/opencv/cvsurfpoint.h", "ext/opencv/cvtermcriteria.cpp", "ext/opencv/cvtermcriteria.h", "ext/opencv/cvtwopoints.cpp", "ext/opencv/cvtwopoints.h", "ext/opencv/cvutils.cpp", "ext/opencv/cvutils.h", "ext/opencv/cvvideowriter.cpp", "ext/opencv/cvvideowriter.h", "ext/opencv/gui.cpp", "ext/opencv/gui.h", "ext/opencv/iplconvkernel.cpp", "ext/opencv/iplconvkernel.h", "ext/opencv/iplimage.cpp", "ext/opencv/iplimage.h", "ext/opencv/lib/opencv.rb", "ext/opencv/lib/opencv/psyched_yaml.rb", "ext/opencv/lib/opencv/version.rb", "ext/opencv/mouseevent.cpp", "ext/opencv/mouseevent.h", "ext/opencv/opencv.cpp", "ext/opencv/opencv.h", "ext/opencv/pointset.cpp", "ext/opencv/pointset.h", "ext/opencv/trackbar.cpp", "ext/opencv/trackbar.h", "ext/opencv/window.cpp", "ext/opencv/window.h", "extconf.rb", "images/CvMat_sobel.png", "images/CvMat_sub_rect.png", "images/CvSeq_relationmap.png", "images/face_detect_from_lena.jpg", "ruby-opencv.gemspec", "test/helper.rb", "test/runner.rb", "test/samples/airplane.jpg", "test/samples/baboon.jpg", "test/samples/baboon200.jpg", "test/samples/baboon200_rotated.jpg", "test/samples/blank0.jpg", "test/samples/blank1.jpg", "test/samples/blank2.jpg", "test/samples/blank3.jpg", "test/samples/blank4.jpg", "test/samples/blank5.jpg", "test/samples/blank6.jpg", "test/samples/blank7.jpg", "test/samples/blank8.jpg", "test/samples/blank9.jpg", "test/samples/cat.jpg", "test/samples/chessboard.jpg", "test/samples/contours.jpg", "test/samples/fruits.jpg", "test/samples/haarcascade_frontalface_alt.xml.gz", "test/samples/inpaint-mask.bmp", "test/samples/lena-256x256.jpg", "test/samples/lena-32x32.jpg", "test/samples/lena-eyes.jpg", "test/samples/lena-inpaint.jpg", "test/samples/lena.jpg", "test/samples/lines.jpg", "test/samples/messy0.jpg", "test/samples/messy1.jpg", "test/samples/movie_sample.avi", "test/samples/one_way_train_0000.jpg", "test/samples/one_way_train_0001.jpg", "test/samples/partially_blank0.jpg", "test/samples/partially_blank1.jpg", "test/samples/smooth0.jpg", "test/samples/smooth1.jpg", "test/samples/smooth2.jpg", "test/samples/smooth3.jpg", "test/samples/smooth4.jpg", "test/samples/smooth5.jpg", "test/samples/smooth6.jpg", "test/samples/str-cv-rotated.jpg", "test/samples/str-cv.jpg", "test/samples/str-ov.jpg", "test/samples/stuff.jpg", "test/test_curve.rb", "test/test_cvavgcomp.rb", "test/test_cvbox2d.rb", "test/test_cvcapture.rb", "test/test_cvchain.rb", "test/test_cvcircle32f.rb", "test/test_cvconnectedcomp.rb", "test/test_cvcontour.rb", "test/test_cvcontourtree.rb", "test/test_cverror.rb", "test/test_cvfeaturetree.rb", "test/test_cvfont.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvhistogram.rb", "test/test_cvhumoments.rb", "test/test_cvline.rb", "test/test_cvmat.rb", "test/test_cvmat_drawing.rb", "test/test_cvmat_dxt.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvmat_matching.rb", "test/test_cvmoments.rb", "test/test_cvpoint.rb", "test/test_cvpoint2d32f.rb", "test/test_cvpoint3d32f.rb", "test/test_cvrect.rb", "test/test_cvscalar.rb", "test/test_cvseq.rb", "test/test_cvsize.rb", "test/test_cvsize2d32f.rb", "test/test_cvslice.rb", "test/test_cvsurfparams.rb", "test/test_cvsurfpoint.rb", "test/test_cvtermcriteria.rb", "test/test_cvtwopoints.rb", "test/test_cvvideowriter.rb", "test/test_iplconvkernel.rb", "test/test_iplimage.rb", "test/test_mouseevent.rb", "test/test_opencv.rb", "test/test_pointset.rb", "test/test_preliminary.rb", "test/test_trackbar.rb", "test/test_window.rb"]
|
15
|
+
s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
|
16
|
+
s.rdoc_options = ["--main", "README.md"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = "ruby-opencv"
|
19
|
+
s.rubygems_version = "1.8.24"
|
20
|
+
s.summary = "OpenCV wrapper for Ruby"
|
21
|
+
s.test_files = ["test/test_cvcontourtree.rb", "test/test_iplconvkernel.rb", "test/test_cvsize2d32f.rb", "test/test_cvconnectedcomp.rb", "test/test_cvcontour.rb", "test/test_cvslice.rb", "test/test_cvmat_matching.rb", "test/test_trackbar.rb", "test/test_cvpoint3d32f.rb", "test/test_cvpoint2d32f.rb", "test/test_cvcapture.rb", "test/test_cvfont.rb", "test/test_cvhumoments.rb", "test/test_cvmat_dxt.rb", "test/test_cvbox2d.rb", "test/test_iplimage.rb", "test/test_preliminary.rb", "test/test_cvmat_drawing.rb", "test/test_cvsurfparams.rb", "test/test_cvcircle32f.rb", "test/test_pointset.rb", "test/test_cvmat.rb", "test/test_cvhistogram.rb", "test/test_cverror.rb", "test/test_cvtermcriteria.rb", "test/test_cvmoments.rb", "test/test_cvchain.rb", "test/test_cvpoint.rb", "test/test_cvavgcomp.rb", "test/test_cvrect.rb", "test/test_cvvideowriter.rb", "test/test_curve.rb", "test/test_window.rb", "test/test_cvline.rb", "test/test_opencv.rb", "test/test_cvfeaturetree.rb", "test/test_cvseq.rb", "test/test_cvsize.rb", "test/test_mouseevent.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvtwopoints.rb", "test/test_cvscalar.rb", "test/test_cvsurfpoint.rb", "test/test_cvhaarclassifiercascade.rb"]
|
22
|
+
|
23
|
+
if s.respond_to? :specification_version then
|
24
|
+
s.specification_version = 3
|
25
|
+
|
26
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
|
28
|
+
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
29
|
+
s.add_development_dependency(%q<hoe-gemspec>, [">= 0"])
|
30
|
+
s.add_development_dependency(%q<hoe>, ["~> 3.5"])
|
31
|
+
else
|
32
|
+
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
33
|
+
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
34
|
+
s.add_dependency(%q<hoe-gemspec>, [">= 0"])
|
35
|
+
s.add_dependency(%q<hoe>, ["~> 3.5"])
|
36
|
+
end
|
37
|
+
else
|
38
|
+
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
39
|
+
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
40
|
+
s.add_dependency(%q<hoe-gemspec>, [">= 0"])
|
41
|
+
s.add_dependency(%q<hoe>, ["~> 3.5"])
|
42
|
+
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-opencv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.8
|
4
|
+
version: 0.0.8
|
5
5
|
segments:
|
6
6
|
hash:
|
7
7
|
platform: x86-mingw32
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
version: '3.5'
|
95
95
|
segments:
|
96
96
|
hash:
|
97
|
-
description:
|
97
|
+
description: ''
|
98
98
|
email:
|
99
99
|
- masakazu.yonekura@gmail.com
|
100
100
|
- azariahsawtikes@gmail.com
|
@@ -105,15 +105,15 @@ extra_rdoc_files:
|
|
105
105
|
- History.txt
|
106
106
|
- License.txt
|
107
107
|
- Manifest.txt
|
108
|
-
- README.rdoc
|
109
108
|
- examples/matching_to_many_images/train/trainImages.txt
|
110
109
|
files:
|
111
110
|
- .gitignore
|
111
|
+
- DEVELOPERS_NOTE.md
|
112
112
|
- Gemfile
|
113
113
|
- History.txt
|
114
114
|
- License.txt
|
115
115
|
- Manifest.txt
|
116
|
-
- README.
|
116
|
+
- README.md
|
117
117
|
- Rakefile
|
118
118
|
- examples/alpha_blend.rb
|
119
119
|
- examples/box.png
|
@@ -342,7 +342,7 @@ licenses: []
|
|
342
342
|
post_install_message:
|
343
343
|
rdoc_options:
|
344
344
|
- --main
|
345
|
-
- README.
|
345
|
+
- README.md
|
346
346
|
require_paths:
|
347
347
|
- lib
|
348
348
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -356,9 +356,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
356
356
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
357
357
|
none: false
|
358
358
|
requirements:
|
359
|
-
- - ! '
|
359
|
+
- - ! '>='
|
360
360
|
- !ruby/object:Gem::Version
|
361
|
-
version:
|
361
|
+
version: '0'
|
362
362
|
segments:
|
363
363
|
hash:
|
364
364
|
requirements: []
|
data/README.rdoc
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
= OpenCV
|
2
|
-
|
3
|
-
The initial Open Computer Vision library was originally developed by Intel
|
4
|
-
Corporation. Recent development has been headed by Willow Garage, Inc.
|
5
|
-
|
6
|
-
* OpenCV project home http://opencv.willowgarage.com/wiki/
|
7
|
-
* Download http://sourceforge.net/projects/opencvlibrary/
|
8
|
-
* Ruby/OpenCV original author's web page http://blueruby.mydns.jp/opencv
|
9
|
-
|
10
|
-
== DESCRIPTION:
|
11
|
-
|
12
|
-
OpenCV wrapper for Ruby
|
13
|
-
|
14
|
-
== FEATURES/PROBLEMS:
|
15
|
-
|
16
|
-
* Some OpenCV functions are wrapped.
|
17
|
-
* Ruby 1.8.7, 1.9.3 and OpenCV 2.4.3 are supported.
|
18
|
-
|
19
|
-
== DEPENDENCIES:
|
20
|
-
|
21
|
-
* OpenCV (required)
|
22
|
-
* Ruby/OpenCV relies on the OpenCV library http://opencv.willowgarage.com/wiki/InstallGuide
|
23
|
-
|
24
|
-
* Microsoft Visual C++ (for mswin32)
|
25
|
-
* http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
|
26
|
-
|
27
|
-
* MinGW and MSYS (for mingw32)
|
28
|
-
* gcc, g++ and MSYS are needed.
|
29
|
-
* http://www.mingw.org
|
30
|
-
|
31
|
-
|
32
|
-
== INSTALLATION:
|
33
|
-
=== Install Ruby/OpenCV manually
|
34
|
-
==== Unix/Linux/Mac
|
35
|
-
|
36
|
-
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
37
|
-
$ cd ruby-opencv
|
38
|
-
$ git checkout master # for OpenCV 2.4 or later. To use OpenCV 2.3, type "git checkout OpenCV_2.3" instead
|
39
|
-
$ ruby extconf.rb --with-opencv-dir=/path/to/opencvdir
|
40
|
-
$ make
|
41
|
-
$ make install
|
42
|
-
|
43
|
-
==== Windows (mswin32)
|
44
|
-
|
45
|
-
Use *nmake* instead of *make*.
|
46
|
-
|
47
|
-
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
48
|
-
$ cd ruby-opencv
|
49
|
-
$ git checkout master # for OpenCV 2.4 or later. To use OpenCV 2.3, type "git checkout OpenCV_2.3" instead
|
50
|
-
$ ruby extconf.rb --with-opencv-dir=C:\path\to\opencvdir\install # for your own built OpenCV library
|
51
|
-
$ nmake
|
52
|
-
$ nmake install
|
53
|
-
|
54
|
-
To use pre-built OpenCV libraries, set the following option to extconf.rb.
|
55
|
-
|
56
|
-
$ ruby extconf.rb --with-opencv-include=C:\path\to\opencvdir\build\include --with-opencv-lib=C:\path\to\opencvdir\build\x86\vc10\lib
|
57
|
-
|
58
|
-
|
59
|
-
==== Windows (mingw32)
|
60
|
-
|
61
|
-
Type the following commands on the *MSYS* *console*.
|
62
|
-
|
63
|
-
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
64
|
-
$ cd ruby-opencv
|
65
|
-
$ git checkout master # for OpenCV 2.4 or later. To use OpenCV 2.3, type "git checkout OpenCV_2.3" instead
|
66
|
-
$ ruby extconf.rb --with-opencv-dir=/C/path/to/opencvdir/install # for your own built OpenCV library
|
67
|
-
$ make
|
68
|
-
$ make install
|
69
|
-
|
70
|
-
To use pre-built OpenCV libraries, set the following option to extconf.rb.
|
71
|
-
|
72
|
-
$ ruby extconf.rb --with-opencv-include=/c/path/to/opencvdir/build/include --with-opencv-lib=/c/path/to/opencvdir/build/x86/mingw/lib
|
73
|
-
|
74
|
-
|
75
|
-
==== NOTE:
|
76
|
-
|
77
|
-
*/path/to/opencvdir* is the path you installs OpenCV library (default: /usr/local).
|
78
|
-
|
79
|
-
For example, if you install OpenCV library to */opt/local/* like:
|
80
|
-
|
81
|
-
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local/ ./OpenCV-2.4.2
|
82
|
-
$ make
|
83
|
-
$ make install
|
84
|
-
|
85
|
-
Install Ruby/OpenCV with the following command:
|
86
|
-
|
87
|
-
$ ruby extconf.rb --with-opencv-dir=/opt/local
|
88
|
-
$ make
|
89
|
-
$ make install
|
90
|
-
|
91
|
-
|
92
|
-
=== Create Ruby/OpenCV Gem
|
93
|
-
You can also install this library creating a gem like:
|
94
|
-
|
95
|
-
$ git clone git://github.com/ruby-opencv/ruby-opencv.git
|
96
|
-
$ cd ruby-opencv
|
97
|
-
$ git checkout master # for OpenCV 2.4 or later. To use OpenCV 2.3, type "git checkout OpenCV_2.3" instead
|
98
|
-
$ bundle install
|
99
|
-
$ rake gem
|
100
|
-
$ gem install pkg/opencv-*.gem -- --with-opencv-dir=/path/to/opencvdir
|
101
|
-
|
102
|
-
To add ruby-opencv in your Gemfile:
|
103
|
-
|
104
|
-
$ echo -e "\n"'gem "opencv", :git => "https://github.com/ruby-opencv/ruby-opencv"' >> Gemfile
|
105
|
-
$ bundle config build.opencv --with-opencv-dir=/path/to/opencvdir
|
106
|
-
$ bundle install # or bundle update
|
107
|
-
|
108
|
-
== SYNOPSIS:
|
109
|
-
=== Show Image using GUI Component
|
110
|
-
|
111
|
-
#!/usr/bin/env ruby
|
112
|
-
require "opencv"
|
113
|
-
|
114
|
-
image = OpenCV::IplImage.load("sample.jpg")
|
115
|
-
window = OpenCV::GUI::Window.new("preview")
|
116
|
-
window.show(image)
|
117
|
-
OpenCV::GUI::wait_key
|
118
|
-
|
119
|
-
=== Face Detection
|
120
|
-
|
121
|
-
Here is a sample face detection program that doesn't rely on the GUI components.
|
122
|
-
In order for this to work you must copy the OpenCV haarcascades data into a
|
123
|
-
subfolder called data.
|
124
|
-
|
125
|
-
#!/usr/bin/env ruby
|
126
|
-
require "opencv"
|
127
|
-
|
128
|
-
if ARGV.length < 2
|
129
|
-
puts "Usage: your_app_name source dest"
|
130
|
-
exit
|
131
|
-
end
|
132
|
-
|
133
|
-
data = "./data/haarcascades/haarcascade_frontalface_alt.xml"
|
134
|
-
detector = OpenCV::CvHaarClassifierCascade::load(data)
|
135
|
-
image = OpenCV::IplImage.load(ARGV[0])
|
136
|
-
detector.detect_objects(image).each do |region|
|
137
|
-
color = OpenCV::CvColor::Blue
|
138
|
-
image.rectangle! region.top_left, region.bottom_right, :color => color
|
139
|
-
end
|
140
|
-
image.save_image(ARGV[1])
|
141
|
-
|
142
|
-
For more samples, see examples/*.rb
|
143
|
-
|
144
|
-
== LICENSE:
|
145
|
-
|
146
|
-
The BSD Liscense
|
147
|
-
|
148
|
-
see LICENSE.txt
|
149
|
-
|