ruby-opencv 0.0.8.pre → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +25 -0
- data/DEVELOPERS_NOTE.md +120 -0
- data/Gemfile +1 -0
- data/Manifest.txt +3 -6
- data/README.md +98 -0
- data/Rakefile +1 -1
- data/ext/opencv/lib/opencv/version.rb +1 -1
- data/ruby-opencv.gemspec +6 -6
- metadata +10 -14
- data/README.rdoc +0 -149
- data/examples/contours/rotated-boxes-with-detected-bounding-rectangles.jpg +0 -0
- data/ext/opencv/GPATH +0 -0
- data/ext/opencv/GSYMS +0 -0
- data/test/log.txt +0 -55
- data/test/videowriter_result.avi +0 -0
data/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
.DS_Store
|
2
|
+
.project
|
3
|
+
examples/data
|
4
|
+
*.o
|
5
|
+
*.so
|
6
|
+
*.obj
|
7
|
+
*.pdb
|
8
|
+
Makefile
|
9
|
+
mkmf.log
|
10
|
+
opencv.bundle
|
11
|
+
GPATH
|
12
|
+
GRTAGS
|
13
|
+
GSYMS
|
14
|
+
GTAGS
|
15
|
+
OpenCV-*
|
16
|
+
ruby-*.*.*
|
17
|
+
ext/opencv/test.txt
|
18
|
+
pkg/
|
19
|
+
doc/
|
20
|
+
log.txt
|
21
|
+
videowriter_result.avi
|
22
|
+
examples/contours/rotated-boxes-with-detected-bounding-rectangles.jpg
|
23
|
+
Gemfile.lock
|
24
|
+
.RUBYLIBDIR.*
|
25
|
+
|
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
@@ -1,8 +1,10 @@
|
|
1
|
+
.gitignore
|
2
|
+
DEVELOPERS_NOTE.md
|
1
3
|
Gemfile
|
2
4
|
History.txt
|
3
5
|
License.txt
|
4
6
|
Manifest.txt
|
5
|
-
README.
|
7
|
+
README.md
|
6
8
|
Rakefile
|
7
9
|
examples/alpha_blend.rb
|
8
10
|
examples/box.png
|
@@ -11,7 +13,6 @@ examples/contours/bitmap-contours-with-labels.png
|
|
11
13
|
examples/contours/bitmap-contours.png
|
12
14
|
examples/contours/bounding-box-detect-canny.rb
|
13
15
|
examples/contours/contour_retrieval_modes.rb
|
14
|
-
examples/contours/rotated-boxes-with-detected-bounding-rectangles.jpg
|
15
16
|
examples/contours/rotated-boxes.jpg
|
16
17
|
examples/convexhull.rb
|
17
18
|
examples/face_detect.rb
|
@@ -32,8 +33,6 @@ examples/paint.rb
|
|
32
33
|
examples/snake.rb
|
33
34
|
examples/stuff.jpg
|
34
35
|
examples/tiffany.jpg
|
35
|
-
ext/opencv/GPATH
|
36
|
-
ext/opencv/GSYMS
|
37
36
|
ext/opencv/curve.cpp
|
38
37
|
ext/opencv/curve.h
|
39
38
|
ext/opencv/cvavgcomp.cpp
|
@@ -136,7 +135,6 @@ images/CvSeq_relationmap.png
|
|
136
135
|
images/face_detect_from_lena.jpg
|
137
136
|
ruby-opencv.gemspec
|
138
137
|
test/helper.rb
|
139
|
-
test/log.txt
|
140
138
|
test/runner.rb
|
141
139
|
test/samples/airplane.jpg
|
142
140
|
test/samples/baboon.jpg
|
@@ -226,4 +224,3 @@ test/test_pointset.rb
|
|
226
224
|
test/test_preliminary.rb
|
227
225
|
test/test_trackbar.rb
|
228
226
|
test/test_window.rb
|
229
|
-
test/videowriter_result.avi
|
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/ruby-opencv.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "ruby-opencv"
|
5
|
-
s.version = "0.0.8.
|
5
|
+
s.version = "0.0.8.20130127124736"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["lsxi", "ser1zw", "pcting"]
|
9
|
-
s.date = "2013-01-
|
10
|
-
s.description = "
|
9
|
+
s.date = "2013-01-27"
|
10
|
+
s.description = ""
|
11
11
|
s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
|
12
12
|
s.extensions = ["extconf.rb"]
|
13
|
-
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "
|
14
|
-
s.files = ["Gemfile", "History.txt", "License.txt", "Manifest.txt", "README.
|
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
15
|
s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
|
16
|
-
s.rdoc_options = ["--main", "README.
|
16
|
+
s.rdoc_options = ["--main", "README.md"]
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
s.rubyforge_project = "ruby-opencv"
|
19
19
|
s.rubygems_version = "1.8.24"
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-opencv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.8
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.8
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- lsxi
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-01-
|
14
|
+
date: 2013-01-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rdoc
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '3.5'
|
80
|
-
description:
|
80
|
+
description: ''
|
81
81
|
email:
|
82
82
|
- masakazu.yonekura@gmail.com
|
83
83
|
- azariahsawtikes@gmail.com
|
@@ -89,14 +89,15 @@ extra_rdoc_files:
|
|
89
89
|
- History.txt
|
90
90
|
- License.txt
|
91
91
|
- Manifest.txt
|
92
|
-
- README.rdoc
|
93
92
|
- examples/matching_to_many_images/train/trainImages.txt
|
94
93
|
files:
|
94
|
+
- .gitignore
|
95
|
+
- DEVELOPERS_NOTE.md
|
95
96
|
- Gemfile
|
96
97
|
- History.txt
|
97
98
|
- License.txt
|
98
99
|
- Manifest.txt
|
99
|
-
- README.
|
100
|
+
- README.md
|
100
101
|
- Rakefile
|
101
102
|
- examples/alpha_blend.rb
|
102
103
|
- examples/box.png
|
@@ -105,7 +106,6 @@ files:
|
|
105
106
|
- examples/contours/bitmap-contours.png
|
106
107
|
- examples/contours/bounding-box-detect-canny.rb
|
107
108
|
- examples/contours/contour_retrieval_modes.rb
|
108
|
-
- examples/contours/rotated-boxes-with-detected-bounding-rectangles.jpg
|
109
109
|
- examples/contours/rotated-boxes.jpg
|
110
110
|
- examples/convexhull.rb
|
111
111
|
- examples/face_detect.rb
|
@@ -126,8 +126,6 @@ files:
|
|
126
126
|
- examples/snake.rb
|
127
127
|
- examples/stuff.jpg
|
128
128
|
- examples/tiffany.jpg
|
129
|
-
- ext/opencv/GPATH
|
130
|
-
- ext/opencv/GSYMS
|
131
129
|
- ext/opencv/curve.cpp
|
132
130
|
- ext/opencv/curve.h
|
133
131
|
- ext/opencv/cvavgcomp.cpp
|
@@ -230,7 +228,6 @@ files:
|
|
230
228
|
- images/face_detect_from_lena.jpg
|
231
229
|
- ruby-opencv.gemspec
|
232
230
|
- test/helper.rb
|
233
|
-
- test/log.txt
|
234
231
|
- test/runner.rb
|
235
232
|
- test/samples/airplane.jpg
|
236
233
|
- test/samples/baboon.jpg
|
@@ -320,13 +317,12 @@ files:
|
|
320
317
|
- test/test_preliminary.rb
|
321
318
|
- test/test_trackbar.rb
|
322
319
|
- test/test_window.rb
|
323
|
-
- test/videowriter_result.avi
|
324
320
|
homepage: https://github.com/ruby-opencv/ruby-opencv/
|
325
321
|
licenses: []
|
326
322
|
post_install_message:
|
327
323
|
rdoc_options:
|
328
324
|
- --main
|
329
|
-
- README.
|
325
|
+
- README.md
|
330
326
|
require_paths:
|
331
327
|
- lib
|
332
328
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -338,9 +334,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
338
334
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
335
|
none: false
|
340
336
|
requirements:
|
341
|
-
- - ! '
|
337
|
+
- - ! '>='
|
342
338
|
- !ruby/object:Gem::Version
|
343
|
-
version:
|
339
|
+
version: '0'
|
344
340
|
requirements: []
|
345
341
|
rubyforge_project: ruby-opencv
|
346
342
|
rubygems_version: 1.8.24
|
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
|
-
|
Binary file
|
data/ext/opencv/GPATH
DELETED
Binary file
|
data/ext/opencv/GSYMS
DELETED
Binary file
|
data/test/log.txt
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
Run options:
|
2
|
-
|
3
|
-
# Running tests:
|
4
|
-
|
5
|
-
.............................................................................................................................................................F...........................................F..F.F..................F..............F..F................................................................................................................F........F.....FF....................
|
6
|
-
|
7
|
-
Finished tests in 36.260783s, 10.8382 tests/s, 761.0150 assertions/s.
|
8
|
-
|
9
|
-
1) Failure:
|
10
|
-
test_normalize(TestCvMat) [/home/seri/Projects/ruby-opencv/test/test_cvmat.rb:2062]:
|
11
|
-
Expected 0.0 - 72130682956280530000000.0 (72130682956280530000000.0) to be < 0.001.
|
12
|
-
|
13
|
-
2) Failure:
|
14
|
-
test_cam_shift(TestCvMat_imageprocessing) [/home/seri/Projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:1725]:
|
15
|
-
FIXME: CvMat#cam_shift is not tested yet.
|
16
|
-
|
17
|
-
3) Failure:
|
18
|
-
test_corner_eigenvv(TestCvMat_imageprocessing) [/home/seri/Projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:143]:
|
19
|
-
FIXME: CvMat#corner_eigenvv is not tested yet.
|
20
|
-
|
21
|
-
4) Failure:
|
22
|
-
test_corner_min_eigen_val(TestCvMat_imageprocessing) [/home/seri/Projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:158]:
|
23
|
-
FIXME: CvMat#corner_min_eigen_val is not tested yet.
|
24
|
-
|
25
|
-
5) Failure:
|
26
|
-
test_mean_shift(TestCvMat_imageprocessing) [/home/seri/Projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:1721]:
|
27
|
-
FIXME: CvMat#mean_shift is not tested yet.
|
28
|
-
|
29
|
-
6) Failure:
|
30
|
-
test_smooth(TestCvMat_imageprocessing) [/home/seri/Projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:871]:
|
31
|
-
FIXME: Cases of CvMat#smooth(CV_BILATERAL) are not tested yet.
|
32
|
-
|
33
|
-
7) Failure:
|
34
|
-
test_threshold(TestCvMat_imageprocessing) [/home/seri/Projects/ruby-opencv/test/test_cvmat_imageprocessing.rb:1017]:
|
35
|
-
<0> expected but was
|
36
|
-
<7.0>.
|
37
|
-
|
38
|
-
8) Failure:
|
39
|
-
test_decode(TestIplImage) [/home/seri/Projects/ruby-opencv/test/test_iplimage.rb:90]:
|
40
|
-
<"022d2afec35e400d88c532005f243314"> expected but was
|
41
|
-
<"f661ae39bb8ba3f5e559648391c7aceb">.
|
42
|
-
|
43
|
-
9) Failure:
|
44
|
-
test_cvt_color_funcs(TestOpenCV) [/home/seri/Projects/ruby-opencv/test/test_opencv.rb:314]:
|
45
|
-
FIXME: Most cvtColor functions are not tested yet.
|
46
|
-
|
47
|
-
10) Failure:
|
48
|
-
test_fit_ellipse2(TestPointSet) [/home/seri/Projects/ruby-opencv/test/test_pointset.rb:41]:
|
49
|
-
Expected 63.116 - 63.1306037902832 (0.014603790283203466) to be < 0.001.
|
50
|
-
|
51
|
-
11) Failure:
|
52
|
-
test_min_area_rect2(TestPointSet) [/home/seri/Projects/ruby-opencv/test/test_pointset.rb:105]:
|
53
|
-
Expected -8.13 - -81.8698959350586 (73.7398959350586) to be < 0.001.
|
54
|
-
|
55
|
-
393 tests, 27595 assertions, 11 failures, 0 errors, 0 skips
|
data/test/videowriter_result.avi
DELETED
Binary file
|