ruby-opencv 0.0.8.pre-mswin32 → 0.0.9.pre2-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/DEVELOPERS_NOTE.md +137 -0
- data/Gemfile +1 -1
- data/License.txt +30 -30
- data/Manifest.txt +7 -5
- data/README.md +98 -0
- data/Rakefile +63 -5
- data/config.yml +7 -0
- data/examples/alpha_blend.rb +21 -21
- data/examples/find_obj.rb +169 -169
- data/examples/match_kdtree.rb +88 -88
- data/ext/opencv/cvcapture.cpp +19 -12
- data/ext/opencv/cvutils.cpp +192 -194
- data/ext/opencv/cvutils.h +30 -29
- data/{extconf.rb → ext/opencv/extconf.rb} +12 -4
- data/lib/opencv.rb +12 -3
- data/lib/opencv/psyched_yaml.rb +22 -22
- data/lib/opencv/version.rb +1 -1
- data/ruby-opencv.gemspec +44 -43
- data/test/helper.rb +1 -1
- data/test/runner.rb +30 -30
- data/test/test_curve.rb +1 -1
- data/test/test_cvavgcomp.rb +24 -24
- data/test/test_cvbox2d.rb +76 -76
- data/test/test_cvcapture.rb +183 -183
- data/test/test_cvchain.rb +108 -108
- data/test/test_cvcircle32f.rb +41 -41
- data/test/test_cvconnectedcomp.rb +61 -61
- data/test/test_cvcontour.rb +150 -150
- data/test/test_cvcontourtree.rb +43 -43
- data/test/test_cverror.rb +1 -1
- data/test/test_cvfeaturetree.rb +65 -65
- data/test/test_cvfont.rb +58 -58
- data/test/test_cvhaarclassifiercascade.rb +63 -63
- data/test/test_cvhistogram.rb +1 -1
- data/test/test_cvhumoments.rb +83 -83
- data/test/test_cvline.rb +50 -50
- data/test/test_cvmat.rb +1 -1
- data/test/test_cvmat_drawing.rb +1 -1
- data/test/test_cvmat_dxt.rb +1 -1
- data/test/test_cvmat_imageprocessing.rb +1 -1
- data/test/test_cvmat_matching.rb +1 -1
- data/test/test_cvmoments.rb +180 -180
- data/test/test_cvpoint.rb +75 -75
- data/test/test_cvpoint2d32f.rb +75 -75
- data/test/test_cvpoint3d32f.rb +93 -93
- data/test/test_cvrect.rb +144 -144
- data/test/test_cvscalar.rb +113 -113
- data/test/test_cvseq.rb +295 -295
- data/test/test_cvsize.rb +75 -75
- data/test/test_cvsize2d32f.rb +75 -75
- data/test/test_cvslice.rb +31 -31
- data/test/test_cvsurfparams.rb +57 -57
- data/test/test_cvsurfpoint.rb +66 -66
- data/test/test_cvtermcriteria.rb +56 -56
- data/test/test_cvtwopoints.rb +40 -40
- data/test/test_cvvideowriter.rb +58 -58
- data/test/test_iplconvkernel.rb +54 -54
- data/test/test_iplimage.rb +1 -1
- data/test/test_mouseevent.rb +17 -17
- data/test/test_opencv.rb +1 -1
- data/test/test_pointset.rb +1 -1
- data/test/test_preliminary.rb +130 -130
- data/test/test_trackbar.rb +47 -47
- data/test/test_window.rb +115 -115
- metadata +28 -56
- data/README.rdoc +0 -149
- data/ext/opencv/lib/opencv.rb +0 -3
- data/ext/opencv/lib/opencv/psyched_yaml.rb +0 -22
- data/ext/opencv/lib/opencv/version.rb +0 -3
metadata
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-opencv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
segments:
|
6
|
-
hash:
|
4
|
+
version: 0.0.9.pre2
|
7
5
|
platform: mswin32
|
8
6
|
authors:
|
9
7
|
- lsxi
|
@@ -12,89 +10,66 @@ authors:
|
|
12
10
|
autorequire:
|
13
11
|
bindir: bin
|
14
12
|
cert_chain: []
|
15
|
-
date: 2013-
|
13
|
+
date: 2013-05-04 00:00:00.000000000 Z
|
16
14
|
dependencies:
|
17
15
|
- !ruby/object:Gem::Dependency
|
18
16
|
name: rdoc
|
19
17
|
requirement: !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
18
|
requirements:
|
22
19
|
- - ~>
|
23
20
|
- !ruby/object:Gem::Version
|
24
|
-
version: '
|
25
|
-
segments:
|
26
|
-
hash:
|
21
|
+
version: '4.0'
|
27
22
|
type: :development
|
28
23
|
prerelease: false
|
29
24
|
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
25
|
requirements:
|
32
26
|
- - ~>
|
33
27
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
35
|
-
segments:
|
36
|
-
hash:
|
28
|
+
version: '4.0'
|
37
29
|
- !ruby/object:Gem::Dependency
|
38
30
|
name: rake-compiler
|
39
31
|
requirement: !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
32
|
requirements:
|
42
|
-
- -
|
33
|
+
- - '>='
|
43
34
|
- !ruby/object:Gem::Version
|
44
35
|
version: '0'
|
45
|
-
segments:
|
46
|
-
hash:
|
47
36
|
type: :development
|
48
37
|
prerelease: false
|
49
38
|
version_requirements: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
39
|
requirements:
|
52
|
-
- -
|
40
|
+
- - '>='
|
53
41
|
- !ruby/object:Gem::Version
|
54
42
|
version: '0'
|
55
|
-
segments:
|
56
|
-
hash:
|
57
43
|
- !ruby/object:Gem::Dependency
|
58
44
|
name: hoe-gemspec
|
59
45
|
requirement: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
46
|
requirements:
|
62
|
-
- -
|
47
|
+
- - '>='
|
63
48
|
- !ruby/object:Gem::Version
|
64
49
|
version: '0'
|
65
|
-
segments:
|
66
|
-
hash:
|
67
50
|
type: :development
|
68
51
|
prerelease: false
|
69
52
|
version_requirements: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
53
|
requirements:
|
72
|
-
- -
|
54
|
+
- - '>='
|
73
55
|
- !ruby/object:Gem::Version
|
74
56
|
version: '0'
|
75
|
-
segments:
|
76
|
-
hash:
|
77
57
|
- !ruby/object:Gem::Dependency
|
78
58
|
name: hoe
|
79
59
|
requirement: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
60
|
requirements:
|
82
61
|
- - ~>
|
83
62
|
- !ruby/object:Gem::Version
|
84
|
-
version: '3.
|
85
|
-
segments:
|
86
|
-
hash:
|
63
|
+
version: '3.6'
|
87
64
|
type: :development
|
88
65
|
prerelease: false
|
89
66
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
67
|
requirements:
|
92
68
|
- - ~>
|
93
69
|
- !ruby/object:Gem::Version
|
94
|
-
version: '3.
|
95
|
-
|
96
|
-
|
97
|
-
description: OpenCV wrapper for Ruby
|
70
|
+
version: '3.6'
|
71
|
+
description: ruby-opencv is a wrapper of OpenCV for Ruby. It helps you to write computer
|
72
|
+
vision programs (e.g. detecting faces from pictures) with Ruby.
|
98
73
|
email:
|
99
74
|
- masakazu.yonekura@gmail.com
|
100
75
|
- azariahsawtikes@gmail.com
|
@@ -102,19 +77,22 @@ email:
|
|
102
77
|
executables: []
|
103
78
|
extensions: []
|
104
79
|
extra_rdoc_files:
|
80
|
+
- DEVELOPERS_NOTE.md
|
105
81
|
- History.txt
|
106
82
|
- License.txt
|
107
83
|
- Manifest.txt
|
108
|
-
- README.
|
84
|
+
- README.md
|
109
85
|
- examples/matching_to_many_images/train/trainImages.txt
|
110
86
|
files:
|
111
87
|
- .gitignore
|
88
|
+
- DEVELOPERS_NOTE.md
|
112
89
|
- Gemfile
|
113
90
|
- History.txt
|
114
91
|
- License.txt
|
115
92
|
- Manifest.txt
|
116
|
-
- README.
|
93
|
+
- README.md
|
117
94
|
- Rakefile
|
95
|
+
- config.yml
|
118
96
|
- examples/alpha_blend.rb
|
119
97
|
- examples/box.png
|
120
98
|
- examples/box_in_scene.png
|
@@ -218,15 +196,13 @@ files:
|
|
218
196
|
- ext/opencv/cvutils.h
|
219
197
|
- ext/opencv/cvvideowriter.cpp
|
220
198
|
- ext/opencv/cvvideowriter.h
|
199
|
+
- ext/opencv/extconf.rb
|
221
200
|
- ext/opencv/gui.cpp
|
222
201
|
- ext/opencv/gui.h
|
223
202
|
- ext/opencv/iplconvkernel.cpp
|
224
203
|
- ext/opencv/iplconvkernel.h
|
225
204
|
- ext/opencv/iplimage.cpp
|
226
205
|
- ext/opencv/iplimage.h
|
227
|
-
- ext/opencv/lib/opencv.rb
|
228
|
-
- ext/opencv/lib/opencv/psyched_yaml.rb
|
229
|
-
- ext/opencv/lib/opencv/version.rb
|
230
206
|
- ext/opencv/mouseevent.cpp
|
231
207
|
- ext/opencv/mouseevent.h
|
232
208
|
- ext/opencv/opencv.cpp
|
@@ -237,13 +213,11 @@ files:
|
|
237
213
|
- ext/opencv/trackbar.h
|
238
214
|
- ext/opencv/window.cpp
|
239
215
|
- ext/opencv/window.h
|
240
|
-
- extconf.rb
|
241
216
|
- images/CvMat_sobel.png
|
242
217
|
- images/CvMat_sub_rect.png
|
243
218
|
- images/CvSeq_relationmap.png
|
244
219
|
- images/face_detect_from_lena.jpg
|
245
220
|
- lib/opencv.rb
|
246
|
-
- lib/opencv.so
|
247
221
|
- lib/opencv/psyched_yaml.rb
|
248
222
|
- lib/opencv/version.rb
|
249
223
|
- ruby-opencv.gemspec
|
@@ -337,35 +311,33 @@ files:
|
|
337
311
|
- test/test_preliminary.rb
|
338
312
|
- test/test_trackbar.rb
|
339
313
|
- test/test_window.rb
|
314
|
+
- lib/1.9/opencv.so
|
315
|
+
- lib/2.0/opencv.so
|
340
316
|
homepage: https://github.com/ruby-opencv/ruby-opencv/
|
341
|
-
licenses:
|
317
|
+
licenses:
|
318
|
+
- The BSD License
|
319
|
+
metadata: {}
|
342
320
|
post_install_message:
|
343
321
|
rdoc_options:
|
344
322
|
- --main
|
345
|
-
- README.
|
323
|
+
- README.md
|
346
324
|
require_paths:
|
347
325
|
- lib
|
348
326
|
required_ruby_version: !ruby/object:Gem::Requirement
|
349
|
-
none: false
|
350
327
|
requirements:
|
351
|
-
- -
|
328
|
+
- - '>='
|
352
329
|
- !ruby/object:Gem::Version
|
353
330
|
version: '0'
|
354
|
-
segments:
|
355
|
-
hash:
|
356
331
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
357
|
-
none: false
|
358
332
|
requirements:
|
359
|
-
- -
|
333
|
+
- - '>'
|
360
334
|
- !ruby/object:Gem::Version
|
361
335
|
version: 1.3.1
|
362
|
-
segments:
|
363
|
-
hash:
|
364
336
|
requirements: []
|
365
337
|
rubyforge_project: ruby-opencv
|
366
|
-
rubygems_version:
|
338
|
+
rubygems_version: 2.0.3
|
367
339
|
signing_key:
|
368
|
-
specification_version:
|
340
|
+
specification_version: 4
|
369
341
|
summary: OpenCV wrapper for Ruby
|
370
342
|
test_files:
|
371
343
|
- test/test_curve.rb
|
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
|
-
|
data/ext/opencv/lib/opencv.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# -*- mode: ruby; coding: utf-8-unix -*-
|
2
|
-
# Psych loader for avoiding loading problem
|
3
|
-
# (borrowed from Bundler 1.1.rc.7 https://github.com/carlhuda/bundler/blob/v1.1.rc.7/lib/bundler/psyched_yaml.rb )
|
4
|
-
#
|
5
|
-
# See: https://github.com/ruby-opencv/ruby-opencv/pull/6
|
6
|
-
|
7
|
-
# Psych could be a gem
|
8
|
-
begin
|
9
|
-
gem 'psych'
|
10
|
-
rescue Gem::LoadError
|
11
|
-
end if defined?(Gem)
|
12
|
-
|
13
|
-
# Psych could be a stdlib
|
14
|
-
begin
|
15
|
-
# it's too late if Syck is already loaded
|
16
|
-
require 'psych' unless defined?(Syck)
|
17
|
-
rescue LoadError
|
18
|
-
end
|
19
|
-
|
20
|
-
# Psych might NOT EXIST AT ALL
|
21
|
-
require 'yaml'
|
22
|
-
|