ruby-opencv 0.0.8-mswin32
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/.gitignore +25 -0
- data/DEVELOPERS_NOTE.md +120 -0
- data/Gemfile +9 -0
- data/History.txt +5 -0
- data/License.txt +30 -0
- data/Manifest.txt +226 -0
- data/README.md +98 -0
- data/Rakefile +32 -0
- data/examples/alpha_blend.rb +21 -0
- data/examples/box.png +0 -0
- data/examples/box_in_scene.png +0 -0
- data/examples/contours/bitmap-contours-with-labels.png +0 -0
- data/examples/contours/bitmap-contours.png +0 -0
- data/examples/contours/bounding-box-detect-canny.rb +62 -0
- data/examples/contours/contour_retrieval_modes.rb +139 -0
- data/examples/contours/rotated-boxes.jpg +0 -0
- data/examples/convexhull.rb +47 -0
- data/examples/face_detect.rb +20 -0
- data/examples/find_obj.rb +169 -0
- data/examples/houghcircle.rb +22 -0
- data/examples/inpaint.png +0 -0
- data/examples/inpaint.rb +57 -0
- data/examples/lenna-rotated.jpg +0 -0
- data/examples/lenna.jpg +0 -0
- data/examples/match_kdtree.rb +88 -0
- data/examples/matching_to_many_images.rb +16 -0
- data/examples/matching_to_many_images/query.png +0 -0
- data/examples/matching_to_many_images/train/1.png +0 -0
- data/examples/matching_to_many_images/train/2.png +0 -0
- data/examples/matching_to_many_images/train/3.png +0 -0
- data/examples/matching_to_many_images/train/trainImages.txt +3 -0
- data/examples/paint.rb +70 -0
- data/examples/snake.rb +43 -0
- data/examples/stuff.jpg +0 -0
- data/examples/tiffany.jpg +0 -0
- data/ext/opencv/curve.cpp +112 -0
- data/ext/opencv/curve.h +34 -0
- data/ext/opencv/cvavgcomp.cpp +67 -0
- data/ext/opencv/cvavgcomp.h +39 -0
- data/ext/opencv/cvbox2d.cpp +197 -0
- data/ext/opencv/cvbox2d.h +61 -0
- data/ext/opencv/cvcapture.cpp +499 -0
- data/ext/opencv/cvcapture.h +72 -0
- data/ext/opencv/cvchain.cpp +233 -0
- data/ext/opencv/cvchain.h +46 -0
- data/ext/opencv/cvcircle32f.cpp +116 -0
- data/ext/opencv/cvcircle32f.h +52 -0
- data/ext/opencv/cvcondensation.cpp +282 -0
- data/ext/opencv/cvcondensation.h +49 -0
- data/ext/opencv/cvconnectedcomp.cpp +143 -0
- data/ext/opencv/cvconnectedcomp.h +49 -0
- data/ext/opencv/cvcontour.cpp +296 -0
- data/ext/opencv/cvcontour.h +48 -0
- data/ext/opencv/cvcontourtree.cpp +91 -0
- data/ext/opencv/cvcontourtree.h +41 -0
- data/ext/opencv/cvconvexitydefect.cpp +103 -0
- data/ext/opencv/cvconvexitydefect.h +42 -0
- data/ext/opencv/cverror.cpp +159 -0
- data/ext/opencv/cverror.h +28 -0
- data/ext/opencv/cvfeaturetree.cpp +125 -0
- data/ext/opencv/cvfeaturetree.h +55 -0
- data/ext/opencv/cvfont.cpp +208 -0
- data/ext/opencv/cvfont.h +64 -0
- data/ext/opencv/cvhaarclassifiercascade.cpp +168 -0
- data/ext/opencv/cvhaarclassifiercascade.h +39 -0
- data/ext/opencv/cvhistogram.cpp +546 -0
- data/ext/opencv/cvhistogram.h +73 -0
- data/ext/opencv/cvhumoments.cpp +139 -0
- data/ext/opencv/cvhumoments.h +51 -0
- data/ext/opencv/cvline.cpp +154 -0
- data/ext/opencv/cvline.h +54 -0
- data/ext/opencv/cvmat.cpp +5848 -0
- data/ext/opencv/cvmat.h +284 -0
- data/ext/opencv/cvmatnd.cpp +44 -0
- data/ext/opencv/cvmatnd.h +28 -0
- data/ext/opencv/cvmemstorage.cpp +68 -0
- data/ext/opencv/cvmemstorage.h +53 -0
- data/ext/opencv/cvmoments.cpp +287 -0
- data/ext/opencv/cvmoments.h +75 -0
- data/ext/opencv/cvpoint.cpp +228 -0
- data/ext/opencv/cvpoint.h +64 -0
- data/ext/opencv/cvpoint2d32f.cpp +211 -0
- data/ext/opencv/cvpoint2d32f.h +63 -0
- data/ext/opencv/cvpoint3d32f.cpp +245 -0
- data/ext/opencv/cvpoint3d32f.h +66 -0
- data/ext/opencv/cvrect.cpp +333 -0
- data/ext/opencv/cvrect.h +79 -0
- data/ext/opencv/cvscalar.cpp +236 -0
- data/ext/opencv/cvscalar.h +71 -0
- data/ext/opencv/cvseq.cpp +599 -0
- data/ext/opencv/cvseq.h +74 -0
- data/ext/opencv/cvsize.cpp +221 -0
- data/ext/opencv/cvsize.h +65 -0
- data/ext/opencv/cvsize2d32f.cpp +209 -0
- data/ext/opencv/cvsize2d32f.h +64 -0
- data/ext/opencv/cvslice.cpp +120 -0
- data/ext/opencv/cvslice.h +61 -0
- data/ext/opencv/cvsparsemat.cpp +44 -0
- data/ext/opencv/cvsparsemat.h +28 -0
- data/ext/opencv/cvsurfparams.cpp +199 -0
- data/ext/opencv/cvsurfparams.h +58 -0
- data/ext/opencv/cvsurfpoint.cpp +223 -0
- data/ext/opencv/cvsurfpoint.h +52 -0
- data/ext/opencv/cvtermcriteria.cpp +192 -0
- data/ext/opencv/cvtermcriteria.h +71 -0
- data/ext/opencv/cvtwopoints.cpp +116 -0
- data/ext/opencv/cvtwopoints.h +51 -0
- data/ext/opencv/cvutils.cpp +194 -0
- data/ext/opencv/cvutils.h +29 -0
- data/ext/opencv/cvvideowriter.cpp +137 -0
- data/ext/opencv/cvvideowriter.h +43 -0
- data/ext/opencv/gui.cpp +68 -0
- data/ext/opencv/gui.h +30 -0
- data/ext/opencv/iplconvkernel.cpp +192 -0
- data/ext/opencv/iplconvkernel.h +71 -0
- data/ext/opencv/iplimage.cpp +644 -0
- data/ext/opencv/iplimage.h +73 -0
- data/ext/opencv/lib/opencv.rb +3 -0
- data/ext/opencv/lib/opencv/psyched_yaml.rb +22 -0
- data/ext/opencv/lib/opencv/version.rb +3 -0
- data/ext/opencv/mouseevent.cpp +181 -0
- data/ext/opencv/mouseevent.h +56 -0
- data/ext/opencv/opencv.cpp +722 -0
- data/ext/opencv/opencv.h +400 -0
- data/ext/opencv/pointset.cpp +274 -0
- data/ext/opencv/pointset.h +68 -0
- data/ext/opencv/trackbar.cpp +121 -0
- data/ext/opencv/trackbar.h +69 -0
- data/ext/opencv/window.cpp +357 -0
- data/ext/opencv/window.h +66 -0
- data/extconf.rb +75 -0
- data/images/CvMat_sobel.png +0 -0
- data/images/CvMat_sub_rect.png +0 -0
- data/images/CvSeq_relationmap.png +0 -0
- data/images/face_detect_from_lena.jpg +0 -0
- data/lib/opencv.rb +3 -0
- data/lib/opencv/psyched_yaml.rb +22 -0
- data/lib/opencv/version.rb +3 -0
- data/ruby-opencv.gemspec +43 -0
- data/test/helper.rb +166 -0
- data/test/runner.rb +30 -0
- data/test/samples/airplane.jpg +0 -0
- data/test/samples/baboon.jpg +0 -0
- data/test/samples/baboon200.jpg +0 -0
- data/test/samples/baboon200_rotated.jpg +0 -0
- data/test/samples/blank0.jpg +0 -0
- data/test/samples/blank1.jpg +0 -0
- data/test/samples/blank2.jpg +0 -0
- data/test/samples/blank3.jpg +0 -0
- data/test/samples/blank4.jpg +0 -0
- data/test/samples/blank5.jpg +0 -0
- data/test/samples/blank6.jpg +0 -0
- data/test/samples/blank7.jpg +0 -0
- data/test/samples/blank8.jpg +0 -0
- data/test/samples/blank9.jpg +0 -0
- data/test/samples/cat.jpg +0 -0
- data/test/samples/chessboard.jpg +0 -0
- data/test/samples/contours.jpg +0 -0
- data/test/samples/fruits.jpg +0 -0
- data/test/samples/haarcascade_frontalface_alt.xml.gz +0 -0
- data/test/samples/inpaint-mask.bmp +0 -0
- data/test/samples/lena-256x256.jpg +0 -0
- data/test/samples/lena-32x32.jpg +0 -0
- data/test/samples/lena-eyes.jpg +0 -0
- data/test/samples/lena-inpaint.jpg +0 -0
- data/test/samples/lena.jpg +0 -0
- data/test/samples/lines.jpg +0 -0
- data/test/samples/messy0.jpg +0 -0
- data/test/samples/messy1.jpg +0 -0
- data/test/samples/movie_sample.avi +0 -0
- data/test/samples/one_way_train_0000.jpg +0 -0
- data/test/samples/one_way_train_0001.jpg +0 -0
- data/test/samples/partially_blank0.jpg +0 -0
- data/test/samples/partially_blank1.jpg +0 -0
- data/test/samples/smooth0.jpg +0 -0
- data/test/samples/smooth1.jpg +0 -0
- data/test/samples/smooth2.jpg +0 -0
- data/test/samples/smooth3.jpg +0 -0
- data/test/samples/smooth4.jpg +0 -0
- data/test/samples/smooth5.jpg +0 -0
- data/test/samples/smooth6.jpg +0 -0
- data/test/samples/str-cv-rotated.jpg +0 -0
- data/test/samples/str-cv.jpg +0 -0
- data/test/samples/str-ov.jpg +0 -0
- data/test/samples/stuff.jpg +0 -0
- data/test/test_curve.rb +43 -0
- data/test/test_cvavgcomp.rb +24 -0
- data/test/test_cvbox2d.rb +76 -0
- data/test/test_cvcapture.rb +183 -0
- data/test/test_cvchain.rb +108 -0
- data/test/test_cvcircle32f.rb +41 -0
- data/test/test_cvconnectedcomp.rb +61 -0
- data/test/test_cvcontour.rb +150 -0
- data/test/test_cvcontourtree.rb +43 -0
- data/test/test_cverror.rb +50 -0
- data/test/test_cvfeaturetree.rb +65 -0
- data/test/test_cvfont.rb +58 -0
- data/test/test_cvhaarclassifiercascade.rb +63 -0
- data/test/test_cvhistogram.rb +271 -0
- data/test/test_cvhumoments.rb +83 -0
- data/test/test_cvline.rb +50 -0
- data/test/test_cvmat.rb +2947 -0
- data/test/test_cvmat_drawing.rb +349 -0
- data/test/test_cvmat_dxt.rb +150 -0
- data/test/test_cvmat_imageprocessing.rb +2025 -0
- data/test/test_cvmat_matching.rb +57 -0
- data/test/test_cvmoments.rb +180 -0
- data/test/test_cvpoint.rb +75 -0
- data/test/test_cvpoint2d32f.rb +75 -0
- data/test/test_cvpoint3d32f.rb +93 -0
- data/test/test_cvrect.rb +144 -0
- data/test/test_cvscalar.rb +113 -0
- data/test/test_cvseq.rb +295 -0
- data/test/test_cvsize.rb +75 -0
- data/test/test_cvsize2d32f.rb +75 -0
- data/test/test_cvslice.rb +31 -0
- data/test/test_cvsurfparams.rb +57 -0
- data/test/test_cvsurfpoint.rb +66 -0
- data/test/test_cvtermcriteria.rb +56 -0
- data/test/test_cvtwopoints.rb +40 -0
- data/test/test_cvvideowriter.rb +58 -0
- data/test/test_iplconvkernel.rb +54 -0
- data/test/test_iplimage.rb +236 -0
- data/test/test_mouseevent.rb +17 -0
- data/test/test_opencv.rb +324 -0
- data/test/test_pointset.rb +126 -0
- data/test/test_preliminary.rb +130 -0
- data/test/test_trackbar.rb +47 -0
- data/test/test_window.rb +115 -0
- metadata +414 -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
ADDED
data/History.txt
ADDED
data/License.txt
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
The BSD Liscense
|
2
|
+
|
3
|
+
Copyright (c) 2008, Masakazu Yonekura
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use of this software in source and binary forms, with or without modification, are
|
7
|
+
permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above
|
10
|
+
copyright notice, this list of conditions and the
|
11
|
+
following disclaimer.
|
12
|
+
|
13
|
+
* Redistributions in binary form must reproduce the above
|
14
|
+
copyright notice, this list of conditions and the
|
15
|
+
following disclaimer in the documentation and/or other
|
16
|
+
materials provided with the distribution.
|
17
|
+
|
18
|
+
* Neither the name of Masakazu Yonekura. nor the names of its
|
19
|
+
contributors may be used to endorse or promote products
|
20
|
+
derived from this software without specific prior
|
21
|
+
written permission of Masakazu Yonekura.
|
22
|
+
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
24
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
25
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
26
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
27
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
29
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
30
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,226 @@
|
|
1
|
+
.gitignore
|
2
|
+
DEVELOPERS_NOTE.md
|
3
|
+
Gemfile
|
4
|
+
History.txt
|
5
|
+
License.txt
|
6
|
+
Manifest.txt
|
7
|
+
README.md
|
8
|
+
Rakefile
|
9
|
+
examples/alpha_blend.rb
|
10
|
+
examples/box.png
|
11
|
+
examples/box_in_scene.png
|
12
|
+
examples/contours/bitmap-contours-with-labels.png
|
13
|
+
examples/contours/bitmap-contours.png
|
14
|
+
examples/contours/bounding-box-detect-canny.rb
|
15
|
+
examples/contours/contour_retrieval_modes.rb
|
16
|
+
examples/contours/rotated-boxes.jpg
|
17
|
+
examples/convexhull.rb
|
18
|
+
examples/face_detect.rb
|
19
|
+
examples/find_obj.rb
|
20
|
+
examples/houghcircle.rb
|
21
|
+
examples/inpaint.png
|
22
|
+
examples/inpaint.rb
|
23
|
+
examples/lenna-rotated.jpg
|
24
|
+
examples/lenna.jpg
|
25
|
+
examples/match_kdtree.rb
|
26
|
+
examples/matching_to_many_images.rb
|
27
|
+
examples/matching_to_many_images/query.png
|
28
|
+
examples/matching_to_many_images/train/1.png
|
29
|
+
examples/matching_to_many_images/train/2.png
|
30
|
+
examples/matching_to_many_images/train/3.png
|
31
|
+
examples/matching_to_many_images/train/trainImages.txt
|
32
|
+
examples/paint.rb
|
33
|
+
examples/snake.rb
|
34
|
+
examples/stuff.jpg
|
35
|
+
examples/tiffany.jpg
|
36
|
+
ext/opencv/curve.cpp
|
37
|
+
ext/opencv/curve.h
|
38
|
+
ext/opencv/cvavgcomp.cpp
|
39
|
+
ext/opencv/cvavgcomp.h
|
40
|
+
ext/opencv/cvbox2d.cpp
|
41
|
+
ext/opencv/cvbox2d.h
|
42
|
+
ext/opencv/cvcapture.cpp
|
43
|
+
ext/opencv/cvcapture.h
|
44
|
+
ext/opencv/cvchain.cpp
|
45
|
+
ext/opencv/cvchain.h
|
46
|
+
ext/opencv/cvcircle32f.cpp
|
47
|
+
ext/opencv/cvcircle32f.h
|
48
|
+
ext/opencv/cvcondensation.cpp
|
49
|
+
ext/opencv/cvcondensation.h
|
50
|
+
ext/opencv/cvconnectedcomp.cpp
|
51
|
+
ext/opencv/cvconnectedcomp.h
|
52
|
+
ext/opencv/cvcontour.cpp
|
53
|
+
ext/opencv/cvcontour.h
|
54
|
+
ext/opencv/cvcontourtree.cpp
|
55
|
+
ext/opencv/cvcontourtree.h
|
56
|
+
ext/opencv/cvconvexitydefect.cpp
|
57
|
+
ext/opencv/cvconvexitydefect.h
|
58
|
+
ext/opencv/cverror.cpp
|
59
|
+
ext/opencv/cverror.h
|
60
|
+
ext/opencv/cvfeaturetree.cpp
|
61
|
+
ext/opencv/cvfeaturetree.h
|
62
|
+
ext/opencv/cvfont.cpp
|
63
|
+
ext/opencv/cvfont.h
|
64
|
+
ext/opencv/cvhaarclassifiercascade.cpp
|
65
|
+
ext/opencv/cvhaarclassifiercascade.h
|
66
|
+
ext/opencv/cvhistogram.cpp
|
67
|
+
ext/opencv/cvhistogram.h
|
68
|
+
ext/opencv/cvhumoments.cpp
|
69
|
+
ext/opencv/cvhumoments.h
|
70
|
+
ext/opencv/cvline.cpp
|
71
|
+
ext/opencv/cvline.h
|
72
|
+
ext/opencv/cvmat.cpp
|
73
|
+
ext/opencv/cvmat.h
|
74
|
+
ext/opencv/cvmatnd.cpp
|
75
|
+
ext/opencv/cvmatnd.h
|
76
|
+
ext/opencv/cvmemstorage.cpp
|
77
|
+
ext/opencv/cvmemstorage.h
|
78
|
+
ext/opencv/cvmoments.cpp
|
79
|
+
ext/opencv/cvmoments.h
|
80
|
+
ext/opencv/cvpoint.cpp
|
81
|
+
ext/opencv/cvpoint.h
|
82
|
+
ext/opencv/cvpoint2d32f.cpp
|
83
|
+
ext/opencv/cvpoint2d32f.h
|
84
|
+
ext/opencv/cvpoint3d32f.cpp
|
85
|
+
ext/opencv/cvpoint3d32f.h
|
86
|
+
ext/opencv/cvrect.cpp
|
87
|
+
ext/opencv/cvrect.h
|
88
|
+
ext/opencv/cvscalar.cpp
|
89
|
+
ext/opencv/cvscalar.h
|
90
|
+
ext/opencv/cvseq.cpp
|
91
|
+
ext/opencv/cvseq.h
|
92
|
+
ext/opencv/cvsize.cpp
|
93
|
+
ext/opencv/cvsize.h
|
94
|
+
ext/opencv/cvsize2d32f.cpp
|
95
|
+
ext/opencv/cvsize2d32f.h
|
96
|
+
ext/opencv/cvslice.cpp
|
97
|
+
ext/opencv/cvslice.h
|
98
|
+
ext/opencv/cvsparsemat.cpp
|
99
|
+
ext/opencv/cvsparsemat.h
|
100
|
+
ext/opencv/cvsurfparams.cpp
|
101
|
+
ext/opencv/cvsurfparams.h
|
102
|
+
ext/opencv/cvsurfpoint.cpp
|
103
|
+
ext/opencv/cvsurfpoint.h
|
104
|
+
ext/opencv/cvtermcriteria.cpp
|
105
|
+
ext/opencv/cvtermcriteria.h
|
106
|
+
ext/opencv/cvtwopoints.cpp
|
107
|
+
ext/opencv/cvtwopoints.h
|
108
|
+
ext/opencv/cvutils.cpp
|
109
|
+
ext/opencv/cvutils.h
|
110
|
+
ext/opencv/cvvideowriter.cpp
|
111
|
+
ext/opencv/cvvideowriter.h
|
112
|
+
ext/opencv/gui.cpp
|
113
|
+
ext/opencv/gui.h
|
114
|
+
ext/opencv/iplconvkernel.cpp
|
115
|
+
ext/opencv/iplconvkernel.h
|
116
|
+
ext/opencv/iplimage.cpp
|
117
|
+
ext/opencv/iplimage.h
|
118
|
+
ext/opencv/lib/opencv.rb
|
119
|
+
ext/opencv/lib/opencv/psyched_yaml.rb
|
120
|
+
ext/opencv/lib/opencv/version.rb
|
121
|
+
ext/opencv/mouseevent.cpp
|
122
|
+
ext/opencv/mouseevent.h
|
123
|
+
ext/opencv/opencv.cpp
|
124
|
+
ext/opencv/opencv.h
|
125
|
+
ext/opencv/pointset.cpp
|
126
|
+
ext/opencv/pointset.h
|
127
|
+
ext/opencv/trackbar.cpp
|
128
|
+
ext/opencv/trackbar.h
|
129
|
+
ext/opencv/window.cpp
|
130
|
+
ext/opencv/window.h
|
131
|
+
extconf.rb
|
132
|
+
images/CvMat_sobel.png
|
133
|
+
images/CvMat_sub_rect.png
|
134
|
+
images/CvSeq_relationmap.png
|
135
|
+
images/face_detect_from_lena.jpg
|
136
|
+
ruby-opencv.gemspec
|
137
|
+
test/helper.rb
|
138
|
+
test/runner.rb
|
139
|
+
test/samples/airplane.jpg
|
140
|
+
test/samples/baboon.jpg
|
141
|
+
test/samples/baboon200.jpg
|
142
|
+
test/samples/baboon200_rotated.jpg
|
143
|
+
test/samples/blank0.jpg
|
144
|
+
test/samples/blank1.jpg
|
145
|
+
test/samples/blank2.jpg
|
146
|
+
test/samples/blank3.jpg
|
147
|
+
test/samples/blank4.jpg
|
148
|
+
test/samples/blank5.jpg
|
149
|
+
test/samples/blank6.jpg
|
150
|
+
test/samples/blank7.jpg
|
151
|
+
test/samples/blank8.jpg
|
152
|
+
test/samples/blank9.jpg
|
153
|
+
test/samples/cat.jpg
|
154
|
+
test/samples/chessboard.jpg
|
155
|
+
test/samples/contours.jpg
|
156
|
+
test/samples/fruits.jpg
|
157
|
+
test/samples/haarcascade_frontalface_alt.xml.gz
|
158
|
+
test/samples/inpaint-mask.bmp
|
159
|
+
test/samples/lena-256x256.jpg
|
160
|
+
test/samples/lena-32x32.jpg
|
161
|
+
test/samples/lena-eyes.jpg
|
162
|
+
test/samples/lena-inpaint.jpg
|
163
|
+
test/samples/lena.jpg
|
164
|
+
test/samples/lines.jpg
|
165
|
+
test/samples/messy0.jpg
|
166
|
+
test/samples/messy1.jpg
|
167
|
+
test/samples/movie_sample.avi
|
168
|
+
test/samples/one_way_train_0000.jpg
|
169
|
+
test/samples/one_way_train_0001.jpg
|
170
|
+
test/samples/partially_blank0.jpg
|
171
|
+
test/samples/partially_blank1.jpg
|
172
|
+
test/samples/smooth0.jpg
|
173
|
+
test/samples/smooth1.jpg
|
174
|
+
test/samples/smooth2.jpg
|
175
|
+
test/samples/smooth3.jpg
|
176
|
+
test/samples/smooth4.jpg
|
177
|
+
test/samples/smooth5.jpg
|
178
|
+
test/samples/smooth6.jpg
|
179
|
+
test/samples/str-cv-rotated.jpg
|
180
|
+
test/samples/str-cv.jpg
|
181
|
+
test/samples/str-ov.jpg
|
182
|
+
test/samples/stuff.jpg
|
183
|
+
test/test_curve.rb
|
184
|
+
test/test_cvavgcomp.rb
|
185
|
+
test/test_cvbox2d.rb
|
186
|
+
test/test_cvcapture.rb
|
187
|
+
test/test_cvchain.rb
|
188
|
+
test/test_cvcircle32f.rb
|
189
|
+
test/test_cvconnectedcomp.rb
|
190
|
+
test/test_cvcontour.rb
|
191
|
+
test/test_cvcontourtree.rb
|
192
|
+
test/test_cverror.rb
|
193
|
+
test/test_cvfeaturetree.rb
|
194
|
+
test/test_cvfont.rb
|
195
|
+
test/test_cvhaarclassifiercascade.rb
|
196
|
+
test/test_cvhistogram.rb
|
197
|
+
test/test_cvhumoments.rb
|
198
|
+
test/test_cvline.rb
|
199
|
+
test/test_cvmat.rb
|
200
|
+
test/test_cvmat_drawing.rb
|
201
|
+
test/test_cvmat_dxt.rb
|
202
|
+
test/test_cvmat_imageprocessing.rb
|
203
|
+
test/test_cvmat_matching.rb
|
204
|
+
test/test_cvmoments.rb
|
205
|
+
test/test_cvpoint.rb
|
206
|
+
test/test_cvpoint2d32f.rb
|
207
|
+
test/test_cvpoint3d32f.rb
|
208
|
+
test/test_cvrect.rb
|
209
|
+
test/test_cvscalar.rb
|
210
|
+
test/test_cvseq.rb
|
211
|
+
test/test_cvsize.rb
|
212
|
+
test/test_cvsize2d32f.rb
|
213
|
+
test/test_cvslice.rb
|
214
|
+
test/test_cvsurfparams.rb
|
215
|
+
test/test_cvsurfpoint.rb
|
216
|
+
test/test_cvtermcriteria.rb
|
217
|
+
test/test_cvtwopoints.rb
|
218
|
+
test/test_cvvideowriter.rb
|
219
|
+
test/test_iplconvkernel.rb
|
220
|
+
test/test_iplimage.rb
|
221
|
+
test/test_mouseevent.rb
|
222
|
+
test/test_opencv.rb
|
223
|
+
test/test_pointset.rb
|
224
|
+
test/test_preliminary.rb
|
225
|
+
test/test_trackbar.rb
|
226
|
+
test/test_window.rb
|
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
|
+
|