ruby-opencv 0.0.8-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. data/.gitignore +25 -0
  2. data/DEVELOPERS_NOTE.md +120 -0
  3. data/Gemfile +9 -0
  4. data/History.txt +5 -0
  5. data/License.txt +30 -0
  6. data/Manifest.txt +226 -0
  7. data/README.md +98 -0
  8. data/Rakefile +32 -0
  9. data/examples/alpha_blend.rb +21 -0
  10. data/examples/box.png +0 -0
  11. data/examples/box_in_scene.png +0 -0
  12. data/examples/contours/bitmap-contours-with-labels.png +0 -0
  13. data/examples/contours/bitmap-contours.png +0 -0
  14. data/examples/contours/bounding-box-detect-canny.rb +62 -0
  15. data/examples/contours/contour_retrieval_modes.rb +139 -0
  16. data/examples/contours/rotated-boxes.jpg +0 -0
  17. data/examples/convexhull.rb +47 -0
  18. data/examples/face_detect.rb +20 -0
  19. data/examples/find_obj.rb +169 -0
  20. data/examples/houghcircle.rb +22 -0
  21. data/examples/inpaint.png +0 -0
  22. data/examples/inpaint.rb +57 -0
  23. data/examples/lenna-rotated.jpg +0 -0
  24. data/examples/lenna.jpg +0 -0
  25. data/examples/match_kdtree.rb +88 -0
  26. data/examples/matching_to_many_images.rb +16 -0
  27. data/examples/matching_to_many_images/query.png +0 -0
  28. data/examples/matching_to_many_images/train/1.png +0 -0
  29. data/examples/matching_to_many_images/train/2.png +0 -0
  30. data/examples/matching_to_many_images/train/3.png +0 -0
  31. data/examples/matching_to_many_images/train/trainImages.txt +3 -0
  32. data/examples/paint.rb +70 -0
  33. data/examples/snake.rb +43 -0
  34. data/examples/stuff.jpg +0 -0
  35. data/examples/tiffany.jpg +0 -0
  36. data/ext/opencv/curve.cpp +112 -0
  37. data/ext/opencv/curve.h +34 -0
  38. data/ext/opencv/cvavgcomp.cpp +67 -0
  39. data/ext/opencv/cvavgcomp.h +39 -0
  40. data/ext/opencv/cvbox2d.cpp +197 -0
  41. data/ext/opencv/cvbox2d.h +61 -0
  42. data/ext/opencv/cvcapture.cpp +499 -0
  43. data/ext/opencv/cvcapture.h +72 -0
  44. data/ext/opencv/cvchain.cpp +233 -0
  45. data/ext/opencv/cvchain.h +46 -0
  46. data/ext/opencv/cvcircle32f.cpp +116 -0
  47. data/ext/opencv/cvcircle32f.h +52 -0
  48. data/ext/opencv/cvcondensation.cpp +282 -0
  49. data/ext/opencv/cvcondensation.h +49 -0
  50. data/ext/opencv/cvconnectedcomp.cpp +143 -0
  51. data/ext/opencv/cvconnectedcomp.h +49 -0
  52. data/ext/opencv/cvcontour.cpp +296 -0
  53. data/ext/opencv/cvcontour.h +48 -0
  54. data/ext/opencv/cvcontourtree.cpp +91 -0
  55. data/ext/opencv/cvcontourtree.h +41 -0
  56. data/ext/opencv/cvconvexitydefect.cpp +103 -0
  57. data/ext/opencv/cvconvexitydefect.h +42 -0
  58. data/ext/opencv/cverror.cpp +159 -0
  59. data/ext/opencv/cverror.h +28 -0
  60. data/ext/opencv/cvfeaturetree.cpp +125 -0
  61. data/ext/opencv/cvfeaturetree.h +55 -0
  62. data/ext/opencv/cvfont.cpp +208 -0
  63. data/ext/opencv/cvfont.h +64 -0
  64. data/ext/opencv/cvhaarclassifiercascade.cpp +168 -0
  65. data/ext/opencv/cvhaarclassifiercascade.h +39 -0
  66. data/ext/opencv/cvhistogram.cpp +546 -0
  67. data/ext/opencv/cvhistogram.h +73 -0
  68. data/ext/opencv/cvhumoments.cpp +139 -0
  69. data/ext/opencv/cvhumoments.h +51 -0
  70. data/ext/opencv/cvline.cpp +154 -0
  71. data/ext/opencv/cvline.h +54 -0
  72. data/ext/opencv/cvmat.cpp +5848 -0
  73. data/ext/opencv/cvmat.h +284 -0
  74. data/ext/opencv/cvmatnd.cpp +44 -0
  75. data/ext/opencv/cvmatnd.h +28 -0
  76. data/ext/opencv/cvmemstorage.cpp +68 -0
  77. data/ext/opencv/cvmemstorage.h +53 -0
  78. data/ext/opencv/cvmoments.cpp +287 -0
  79. data/ext/opencv/cvmoments.h +75 -0
  80. data/ext/opencv/cvpoint.cpp +228 -0
  81. data/ext/opencv/cvpoint.h +64 -0
  82. data/ext/opencv/cvpoint2d32f.cpp +211 -0
  83. data/ext/opencv/cvpoint2d32f.h +63 -0
  84. data/ext/opencv/cvpoint3d32f.cpp +245 -0
  85. data/ext/opencv/cvpoint3d32f.h +66 -0
  86. data/ext/opencv/cvrect.cpp +333 -0
  87. data/ext/opencv/cvrect.h +79 -0
  88. data/ext/opencv/cvscalar.cpp +236 -0
  89. data/ext/opencv/cvscalar.h +71 -0
  90. data/ext/opencv/cvseq.cpp +599 -0
  91. data/ext/opencv/cvseq.h +74 -0
  92. data/ext/opencv/cvsize.cpp +221 -0
  93. data/ext/opencv/cvsize.h +65 -0
  94. data/ext/opencv/cvsize2d32f.cpp +209 -0
  95. data/ext/opencv/cvsize2d32f.h +64 -0
  96. data/ext/opencv/cvslice.cpp +120 -0
  97. data/ext/opencv/cvslice.h +61 -0
  98. data/ext/opencv/cvsparsemat.cpp +44 -0
  99. data/ext/opencv/cvsparsemat.h +28 -0
  100. data/ext/opencv/cvsurfparams.cpp +199 -0
  101. data/ext/opencv/cvsurfparams.h +58 -0
  102. data/ext/opencv/cvsurfpoint.cpp +223 -0
  103. data/ext/opencv/cvsurfpoint.h +52 -0
  104. data/ext/opencv/cvtermcriteria.cpp +192 -0
  105. data/ext/opencv/cvtermcriteria.h +71 -0
  106. data/ext/opencv/cvtwopoints.cpp +116 -0
  107. data/ext/opencv/cvtwopoints.h +51 -0
  108. data/ext/opencv/cvutils.cpp +194 -0
  109. data/ext/opencv/cvutils.h +29 -0
  110. data/ext/opencv/cvvideowriter.cpp +137 -0
  111. data/ext/opencv/cvvideowriter.h +43 -0
  112. data/ext/opencv/gui.cpp +68 -0
  113. data/ext/opencv/gui.h +30 -0
  114. data/ext/opencv/iplconvkernel.cpp +192 -0
  115. data/ext/opencv/iplconvkernel.h +71 -0
  116. data/ext/opencv/iplimage.cpp +644 -0
  117. data/ext/opencv/iplimage.h +73 -0
  118. data/ext/opencv/lib/opencv.rb +3 -0
  119. data/ext/opencv/lib/opencv/psyched_yaml.rb +22 -0
  120. data/ext/opencv/lib/opencv/version.rb +3 -0
  121. data/ext/opencv/mouseevent.cpp +181 -0
  122. data/ext/opencv/mouseevent.h +56 -0
  123. data/ext/opencv/opencv.cpp +722 -0
  124. data/ext/opencv/opencv.h +400 -0
  125. data/ext/opencv/pointset.cpp +274 -0
  126. data/ext/opencv/pointset.h +68 -0
  127. data/ext/opencv/trackbar.cpp +121 -0
  128. data/ext/opencv/trackbar.h +69 -0
  129. data/ext/opencv/window.cpp +357 -0
  130. data/ext/opencv/window.h +66 -0
  131. data/extconf.rb +75 -0
  132. data/images/CvMat_sobel.png +0 -0
  133. data/images/CvMat_sub_rect.png +0 -0
  134. data/images/CvSeq_relationmap.png +0 -0
  135. data/images/face_detect_from_lena.jpg +0 -0
  136. data/lib/opencv.rb +3 -0
  137. data/lib/opencv/psyched_yaml.rb +22 -0
  138. data/lib/opencv/version.rb +3 -0
  139. data/ruby-opencv.gemspec +43 -0
  140. data/test/helper.rb +166 -0
  141. data/test/runner.rb +30 -0
  142. data/test/samples/airplane.jpg +0 -0
  143. data/test/samples/baboon.jpg +0 -0
  144. data/test/samples/baboon200.jpg +0 -0
  145. data/test/samples/baboon200_rotated.jpg +0 -0
  146. data/test/samples/blank0.jpg +0 -0
  147. data/test/samples/blank1.jpg +0 -0
  148. data/test/samples/blank2.jpg +0 -0
  149. data/test/samples/blank3.jpg +0 -0
  150. data/test/samples/blank4.jpg +0 -0
  151. data/test/samples/blank5.jpg +0 -0
  152. data/test/samples/blank6.jpg +0 -0
  153. data/test/samples/blank7.jpg +0 -0
  154. data/test/samples/blank8.jpg +0 -0
  155. data/test/samples/blank9.jpg +0 -0
  156. data/test/samples/cat.jpg +0 -0
  157. data/test/samples/chessboard.jpg +0 -0
  158. data/test/samples/contours.jpg +0 -0
  159. data/test/samples/fruits.jpg +0 -0
  160. data/test/samples/haarcascade_frontalface_alt.xml.gz +0 -0
  161. data/test/samples/inpaint-mask.bmp +0 -0
  162. data/test/samples/lena-256x256.jpg +0 -0
  163. data/test/samples/lena-32x32.jpg +0 -0
  164. data/test/samples/lena-eyes.jpg +0 -0
  165. data/test/samples/lena-inpaint.jpg +0 -0
  166. data/test/samples/lena.jpg +0 -0
  167. data/test/samples/lines.jpg +0 -0
  168. data/test/samples/messy0.jpg +0 -0
  169. data/test/samples/messy1.jpg +0 -0
  170. data/test/samples/movie_sample.avi +0 -0
  171. data/test/samples/one_way_train_0000.jpg +0 -0
  172. data/test/samples/one_way_train_0001.jpg +0 -0
  173. data/test/samples/partially_blank0.jpg +0 -0
  174. data/test/samples/partially_blank1.jpg +0 -0
  175. data/test/samples/smooth0.jpg +0 -0
  176. data/test/samples/smooth1.jpg +0 -0
  177. data/test/samples/smooth2.jpg +0 -0
  178. data/test/samples/smooth3.jpg +0 -0
  179. data/test/samples/smooth4.jpg +0 -0
  180. data/test/samples/smooth5.jpg +0 -0
  181. data/test/samples/smooth6.jpg +0 -0
  182. data/test/samples/str-cv-rotated.jpg +0 -0
  183. data/test/samples/str-cv.jpg +0 -0
  184. data/test/samples/str-ov.jpg +0 -0
  185. data/test/samples/stuff.jpg +0 -0
  186. data/test/test_curve.rb +43 -0
  187. data/test/test_cvavgcomp.rb +24 -0
  188. data/test/test_cvbox2d.rb +76 -0
  189. data/test/test_cvcapture.rb +183 -0
  190. data/test/test_cvchain.rb +108 -0
  191. data/test/test_cvcircle32f.rb +41 -0
  192. data/test/test_cvconnectedcomp.rb +61 -0
  193. data/test/test_cvcontour.rb +150 -0
  194. data/test/test_cvcontourtree.rb +43 -0
  195. data/test/test_cverror.rb +50 -0
  196. data/test/test_cvfeaturetree.rb +65 -0
  197. data/test/test_cvfont.rb +58 -0
  198. data/test/test_cvhaarclassifiercascade.rb +63 -0
  199. data/test/test_cvhistogram.rb +271 -0
  200. data/test/test_cvhumoments.rb +83 -0
  201. data/test/test_cvline.rb +50 -0
  202. data/test/test_cvmat.rb +2947 -0
  203. data/test/test_cvmat_drawing.rb +349 -0
  204. data/test/test_cvmat_dxt.rb +150 -0
  205. data/test/test_cvmat_imageprocessing.rb +2025 -0
  206. data/test/test_cvmat_matching.rb +57 -0
  207. data/test/test_cvmoments.rb +180 -0
  208. data/test/test_cvpoint.rb +75 -0
  209. data/test/test_cvpoint2d32f.rb +75 -0
  210. data/test/test_cvpoint3d32f.rb +93 -0
  211. data/test/test_cvrect.rb +144 -0
  212. data/test/test_cvscalar.rb +113 -0
  213. data/test/test_cvseq.rb +295 -0
  214. data/test/test_cvsize.rb +75 -0
  215. data/test/test_cvsize2d32f.rb +75 -0
  216. data/test/test_cvslice.rb +31 -0
  217. data/test/test_cvsurfparams.rb +57 -0
  218. data/test/test_cvsurfpoint.rb +66 -0
  219. data/test/test_cvtermcriteria.rb +56 -0
  220. data/test/test_cvtwopoints.rb +40 -0
  221. data/test/test_cvvideowriter.rb +58 -0
  222. data/test/test_iplconvkernel.rb +54 -0
  223. data/test/test_iplimage.rb +236 -0
  224. data/test/test_mouseevent.rb +17 -0
  225. data/test/test_opencv.rb +324 -0
  226. data/test/test_pointset.rb +126 -0
  227. data/test/test_preliminary.rb +130 -0
  228. data/test/test_trackbar.rb +47 -0
  229. data/test/test_window.rb +115 -0
  230. 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
+
@@ -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
@@ -0,0 +1,9 @@
1
+ source :gemcutter
2
+
3
+ group :development do
4
+ gem "hoe"
5
+ gem "hoe-gemspec"
6
+ gem "rake-compiler"
7
+ gem "gem-compile"
8
+ end
9
+
data/History.txt ADDED
@@ -0,0 +1,5 @@
1
+ === 0.0.6 / 2008-06-27
2
+
3
+ * First gem release.
4
+
5
+ * Some OpenCV function wrapped.
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
+