adamb-ruby-opencv 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/CHANGELOG +2 -0
  2. data/License.txt +30 -0
  3. data/README.rdoc +47 -0
  4. data/Rakefile +15 -0
  5. data/examples/convexhull.rb +41 -0
  6. data/examples/face_detect.rb +25 -0
  7. data/examples/houghcircle.rb +23 -0
  8. data/examples/inpaint.png +0 -0
  9. data/examples/inpaint.rb +43 -0
  10. data/examples/paint.rb +72 -0
  11. data/examples/snake.rb +43 -0
  12. data/examples/stuff.jpg +0 -0
  13. data/ext/curve.cpp +103 -0
  14. data/ext/curve.h +34 -0
  15. data/ext/cvavgcomp.cpp +67 -0
  16. data/ext/cvavgcomp.h +39 -0
  17. data/ext/cvbox2d.cpp +114 -0
  18. data/ext/cvbox2d.h +53 -0
  19. data/ext/cvcapture.cpp +276 -0
  20. data/ext/cvcapture.h +54 -0
  21. data/ext/cvchain.cpp +184 -0
  22. data/ext/cvchain.h +43 -0
  23. data/ext/cvchaincode.cpp +49 -0
  24. data/ext/cvchaincode.h +43 -0
  25. data/ext/cvcircle32f.cpp +90 -0
  26. data/ext/cvcircle32f.h +53 -0
  27. data/ext/cvcondensation.cpp +230 -0
  28. data/ext/cvcondensation.h +49 -0
  29. data/ext/cvconnectedcomp.cpp +115 -0
  30. data/ext/cvconnectedcomp.h +46 -0
  31. data/ext/cvcontour.cpp +219 -0
  32. data/ext/cvcontour.h +47 -0
  33. data/ext/cvcontourtree.cpp +86 -0
  34. data/ext/cvcontourtree.h +41 -0
  35. data/ext/cvconvexitydefect.cpp +103 -0
  36. data/ext/cvconvexitydefect.h +42 -0
  37. data/ext/cverror.cpp +140 -0
  38. data/ext/cverror.h +79 -0
  39. data/ext/cvfont.cpp +173 -0
  40. data/ext/cvfont.h +56 -0
  41. data/ext/cvhaarclassifiercascade.cpp +159 -0
  42. data/ext/cvhaarclassifiercascade.h +41 -0
  43. data/ext/cvhistogram.cpp +200 -0
  44. data/ext/cvhistogram.h +51 -0
  45. data/ext/cvindex.cpp +73 -0
  46. data/ext/cvindex.h +40 -0
  47. data/ext/cvline.cpp +106 -0
  48. data/ext/cvline.h +52 -0
  49. data/ext/cvmat.cpp +4809 -0
  50. data/ext/cvmat.h +286 -0
  51. data/ext/cvmatnd.cpp +44 -0
  52. data/ext/cvmatnd.h +28 -0
  53. data/ext/cvmemstorage.cpp +64 -0
  54. data/ext/cvmemstorage.h +53 -0
  55. data/ext/cvmoments.cpp +204 -0
  56. data/ext/cvmoments.h +48 -0
  57. data/ext/cvpoint.cpp +229 -0
  58. data/ext/cvpoint.h +59 -0
  59. data/ext/cvpoint2d32f.cpp +213 -0
  60. data/ext/cvpoint2d32f.h +61 -0
  61. data/ext/cvpoint3d32f.cpp +245 -0
  62. data/ext/cvpoint3d32f.h +64 -0
  63. data/ext/cvrect.cpp +340 -0
  64. data/ext/cvrect.h +79 -0
  65. data/ext/cvscalar.cpp +227 -0
  66. data/ext/cvscalar.h +63 -0
  67. data/ext/cvseq.cpp +583 -0
  68. data/ext/cvseq.h +71 -0
  69. data/ext/cvset.cpp +63 -0
  70. data/ext/cvset.h +39 -0
  71. data/ext/cvsize.cpp +223 -0
  72. data/ext/cvsize.h +63 -0
  73. data/ext/cvsize2d32f.cpp +180 -0
  74. data/ext/cvsize2d32f.h +59 -0
  75. data/ext/cvslice.cpp +82 -0
  76. data/ext/cvslice.h +53 -0
  77. data/ext/cvsparsemat.cpp +44 -0
  78. data/ext/cvsparsemat.h +28 -0
  79. data/ext/cvtermcriteria.cpp +183 -0
  80. data/ext/cvtermcriteria.h +71 -0
  81. data/ext/cvtwopoints.cpp +98 -0
  82. data/ext/cvtwopoints.h +50 -0
  83. data/ext/cvvector.cpp +206 -0
  84. data/ext/cvvector.h +54 -0
  85. data/ext/cvvideowriter.cpp +116 -0
  86. data/ext/cvvideowriter.h +41 -0
  87. data/ext/extconf.rb +66 -0
  88. data/ext/gui.cpp +65 -0
  89. data/ext/gui.h +33 -0
  90. data/ext/iplconvkernel.cpp +177 -0
  91. data/ext/iplconvkernel.h +52 -0
  92. data/ext/iplimage.cpp +238 -0
  93. data/ext/iplimage.h +54 -0
  94. data/ext/mouseevent.cpp +184 -0
  95. data/ext/mouseevent.h +59 -0
  96. data/ext/opencv.cpp +481 -0
  97. data/ext/opencv.h +356 -0
  98. data/ext/point3dset.cpp +41 -0
  99. data/ext/point3dset.h +31 -0
  100. data/ext/pointset.cpp +238 -0
  101. data/ext/pointset.h +69 -0
  102. data/ext/trackbar.cpp +122 -0
  103. data/ext/trackbar.h +65 -0
  104. data/ext/window.cpp +368 -0
  105. data/ext/window.h +56 -0
  106. data/images/CvMat_sobel.png +0 -0
  107. data/images/CvMat_sub_rect.png +0 -0
  108. data/images/CvSeq_relationmap.png +0 -0
  109. data/images/face_detect_from_lena.jpg +0 -0
  110. data/lib/opencv.rb +3 -0
  111. data/lib/version.rb +3 -0
  112. data/metadata +191 -0
  113. data/ruby-opencv.gemspec +33 -0
  114. data/setup/setup.cygwin.rb +120 -0
  115. data/setup/setup.mingw.rb +99 -0
  116. data/setup/setup.mswin32.rb +103 -0
  117. data/test/test_opencv.rb +6 -0
  118. metadata +272 -0
@@ -0,0 +1,103 @@
1
+ #!C:/Ruby/bin/ruby.exe
2
+ # Create OpenCV library for VisualC++.
3
+ raise 'Should use Ruby-mswin32.' unless RUBY_PLATFORM =~ /mswin32/
4
+ require 'pathname'
5
+ opencv_installed_dir = "C:/Program\ Files/OpenCV"
6
+ install_libdir = "lib"
7
+ install_includedir = "include"
8
+
9
+ STDOUT.sync = true
10
+ puts ">> Please tell me CPU archtecture."
11
+ archs = ["x86", "amd64", "ia64"]
12
+ archs.each_with_index{|v, i|
13
+ puts "[#{i}].#{v}"
14
+ }
15
+ print "CPU archtecture : "
16
+ input = gets.chomp!.to_i
17
+ arch = archs[input]
18
+ puts "you choose #{arch}"
19
+
20
+ puts ">> Please tell me path installed OpenCV."
21
+ puts ">> note: default is #{opencv_installed_dir}"
22
+ print "opencv installed directory : "
23
+ input = gets.chomp!
24
+ opencv_installed_dir = input unless input.empty?
25
+
26
+ puts "[step.1]"
27
+ puts ">> Checking directory..."
28
+ basedir = Pathname(opencv_installed_dir)
29
+ print ">> basedir #{basedir}"
30
+ raise "error: directory #{basedir} does not exist." unless File.directory?(basedir)
31
+ bindir = basedir + 'bin'
32
+ puts "...ok"
33
+ print ">> bindir #{bindir}"
34
+ raise "error: directory #{bindir} does not exist." unless File.directory?(bindir)
35
+ puts "...ok"
36
+ libdir = basedir + 'lib'
37
+ print ">> libdir #{libdir}"
38
+ raise "error: directory #{libdir} does not exist." unless File.directory?(libdir)
39
+ puts "...ok"
40
+
41
+ puts "[step.2]"
42
+ puts ">> Searching OpenCV Windows DLLs..."
43
+ Dir.foreach(bindir){|filename|
44
+ next unless filename =~ /\d\d\d\.dll\Z/
45
+ dllname = filename.scan(/(\D+)\d+\.dll/)
46
+ open("#{dllname}.def", "w"){|def_file|
47
+ def_file.puts "LIBRARY #{filename}"
48
+ def_file.puts "EXPORTS"
49
+ `dumpbin.exe /exports "#{bindir + filename}"`.split("\n").each{|line|
50
+ f = line.scan(/\A\s+\d+\s+[0-9A-F]+\s+[0-9A-F]+\s+(.*)/).first
51
+ def_file.puts f if f
52
+ }
53
+ }
54
+ `lib.exe /def:#{dllname}.def /machine:#{arch}`
55
+ File.unlink("#{dllname}.def")
56
+ puts ">> Create #{dllname}.lib success."
57
+ }
58
+
59
+ puts "[step.3]"
60
+ puts ">> Move libs to target directory"
61
+ puts ">> note: default is #{install_libdir}"
62
+ print "target directory : "
63
+ input = gets.chomp!
64
+ install_libdir = input unless input.empty?
65
+ if File.exist?(install_libdir)
66
+ raise "#{install_libdir} is exist. but it is not directory." unless File.directory?(install_libdir)
67
+ else
68
+ print "Directory #{install_libdir} does not exist. Create it? [y/n]:"
69
+ raise "Please create directory #{install_libdir}" unless gets.chomp! == 'y'
70
+ `md #{install_libdir}`
71
+ end
72
+ puts "move"
73
+ `move *.lib #{install_libdir}`
74
+
75
+ puts "[step.4]"
76
+ puts ">> Copy OpenCV header files(*.h / *.hpp) to target directory"
77
+ puts ">> note: default is #{install_includedir}"
78
+ print "target directory : "
79
+ input = gets.chomp!
80
+ install_includedir = input unless input.empty?
81
+ if File.exist?(install_includedir)
82
+ raise "#{install_includedir} is exist. but it is not directory." unless File.directory?(install_libdir)
83
+ else
84
+ print "Directory #{install_includedir} does not exist. Create it? [y/n]:"
85
+ raise "Please create directory #{install_includedir}" unless gets.chomp! == 'y'
86
+ `md #{install_includedir}`
87
+ end
88
+ puts ">> Copying header files..."
89
+ [
90
+ "cxcore/include",
91
+ "cv/include",
92
+ "cvaux/include",
93
+ "ml/include",
94
+ "otherlibs/cvcam/include",
95
+ "otherlibs/highgui"
96
+ ].each{|i|
97
+ if File.directory?(basedir + i)
98
+ Dir.foreach(basedir + i){|filename|
99
+ next unless (File.extname(filename) == ".h" || File.extname(filename) == ".hpp")
100
+ `copy \"#{(basedir + i + filename).to_s.gsub("/", "\\")}\" #{install_includedir}`
101
+ }
102
+ end
103
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
4
+
5
+ require 'opencv'
6
+
metadata ADDED
@@ -0,0 +1,272 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adamb-ruby-opencv
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
+ platform: ruby
6
+ authors:
7
+ - Masakazu Yonekura
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-09 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: OpenCV wrapper for Ruby.
17
+ email: masakazu.yonekura@gmail.com
18
+ executables: []
19
+
20
+ extensions:
21
+ - ext/extconf.rb
22
+ extra_rdoc_files:
23
+ - CHANGELOG
24
+ - ext/curve.cpp
25
+ - ext/curve.h
26
+ - ext/cvavgcomp.cpp
27
+ - ext/cvavgcomp.h
28
+ - ext/cvbox2d.cpp
29
+ - ext/cvbox2d.h
30
+ - ext/cvcapture.cpp
31
+ - ext/cvcapture.h
32
+ - ext/cvchain.cpp
33
+ - ext/cvchain.h
34
+ - ext/cvchaincode.cpp
35
+ - ext/cvchaincode.h
36
+ - ext/cvcircle32f.cpp
37
+ - ext/cvcircle32f.h
38
+ - ext/cvcondensation.cpp
39
+ - ext/cvcondensation.h
40
+ - ext/cvconnectedcomp.cpp
41
+ - ext/cvconnectedcomp.h
42
+ - ext/cvcontour.cpp
43
+ - ext/cvcontour.h
44
+ - ext/cvcontourtree.cpp
45
+ - ext/cvcontourtree.h
46
+ - ext/cvconvexitydefect.cpp
47
+ - ext/cvconvexitydefect.h
48
+ - ext/cverror.cpp
49
+ - ext/cverror.h
50
+ - ext/cvfont.cpp
51
+ - ext/cvfont.h
52
+ - ext/cvhaarclassifiercascade.cpp
53
+ - ext/cvhaarclassifiercascade.h
54
+ - ext/cvhistogram.cpp
55
+ - ext/cvhistogram.h
56
+ - ext/cvindex.cpp
57
+ - ext/cvindex.h
58
+ - ext/cvline.cpp
59
+ - ext/cvline.h
60
+ - ext/cvmat.cpp
61
+ - ext/cvmat.h
62
+ - ext/cvmatnd.cpp
63
+ - ext/cvmatnd.h
64
+ - ext/cvmemstorage.cpp
65
+ - ext/cvmemstorage.h
66
+ - ext/cvmoments.cpp
67
+ - ext/cvmoments.h
68
+ - ext/cvpoint.cpp
69
+ - ext/cvpoint.h
70
+ - ext/cvpoint2d32f.cpp
71
+ - ext/cvpoint2d32f.h
72
+ - ext/cvpoint3d32f.cpp
73
+ - ext/cvpoint3d32f.h
74
+ - ext/cvrect.cpp
75
+ - ext/cvrect.h
76
+ - ext/cvscalar.cpp
77
+ - ext/cvscalar.h
78
+ - ext/cvseq.cpp
79
+ - ext/cvseq.h
80
+ - ext/cvset.cpp
81
+ - ext/cvset.h
82
+ - ext/cvsize.cpp
83
+ - ext/cvsize.h
84
+ - ext/cvsize2d32f.cpp
85
+ - ext/cvsize2d32f.h
86
+ - ext/cvslice.cpp
87
+ - ext/cvslice.h
88
+ - ext/cvsparsemat.cpp
89
+ - ext/cvsparsemat.h
90
+ - ext/cvtermcriteria.cpp
91
+ - ext/cvtermcriteria.h
92
+ - ext/cvtwopoints.cpp
93
+ - ext/cvtwopoints.h
94
+ - ext/cvvector.cpp
95
+ - ext/cvvector.h
96
+ - ext/cvvideowriter.cpp
97
+ - ext/cvvideowriter.h
98
+ - ext/extconf.rb
99
+ - ext/gui.cpp
100
+ - ext/gui.h
101
+ - ext/iplconvkernel.cpp
102
+ - ext/iplconvkernel.h
103
+ - ext/iplimage.cpp
104
+ - ext/iplimage.h
105
+ - ext/mouseevent.cpp
106
+ - ext/mouseevent.h
107
+ - ext/opencv.cpp
108
+ - ext/opencv.h
109
+ - ext/point3dset.cpp
110
+ - ext/point3dset.h
111
+ - ext/pointset.cpp
112
+ - ext/pointset.h
113
+ - ext/trackbar.cpp
114
+ - ext/trackbar.h
115
+ - ext/window.cpp
116
+ - ext/window.h
117
+ - lib/opencv.rb
118
+ - lib/version.rb
119
+ - README.rdoc
120
+ files:
121
+ - CHANGELOG
122
+ - examples/convexhull.rb
123
+ - examples/face_detect.rb
124
+ - examples/houghcircle.rb
125
+ - examples/inpaint.png
126
+ - examples/inpaint.rb
127
+ - examples/paint.rb
128
+ - examples/snake.rb
129
+ - examples/stuff.jpg
130
+ - ext/curve.cpp
131
+ - ext/curve.h
132
+ - ext/cvavgcomp.cpp
133
+ - ext/cvavgcomp.h
134
+ - ext/cvbox2d.cpp
135
+ - ext/cvbox2d.h
136
+ - ext/cvcapture.cpp
137
+ - ext/cvcapture.h
138
+ - ext/cvchain.cpp
139
+ - ext/cvchain.h
140
+ - ext/cvchaincode.cpp
141
+ - ext/cvchaincode.h
142
+ - ext/cvcircle32f.cpp
143
+ - ext/cvcircle32f.h
144
+ - ext/cvcondensation.cpp
145
+ - ext/cvcondensation.h
146
+ - ext/cvconnectedcomp.cpp
147
+ - ext/cvconnectedcomp.h
148
+ - ext/cvcontour.cpp
149
+ - ext/cvcontour.h
150
+ - ext/cvcontourtree.cpp
151
+ - ext/cvcontourtree.h
152
+ - ext/cvconvexitydefect.cpp
153
+ - ext/cvconvexitydefect.h
154
+ - ext/cverror.cpp
155
+ - ext/cverror.h
156
+ - ext/cvfont.cpp
157
+ - ext/cvfont.h
158
+ - ext/cvhaarclassifiercascade.cpp
159
+ - ext/cvhaarclassifiercascade.h
160
+ - ext/cvhistogram.cpp
161
+ - ext/cvhistogram.h
162
+ - ext/cvindex.cpp
163
+ - ext/cvindex.h
164
+ - ext/cvline.cpp
165
+ - ext/cvline.h
166
+ - ext/cvmat.cpp
167
+ - ext/cvmat.h
168
+ - ext/cvmatnd.cpp
169
+ - ext/cvmatnd.h
170
+ - ext/cvmemstorage.cpp
171
+ - ext/cvmemstorage.h
172
+ - ext/cvmoments.cpp
173
+ - ext/cvmoments.h
174
+ - ext/cvpoint.cpp
175
+ - ext/cvpoint.h
176
+ - ext/cvpoint2d32f.cpp
177
+ - ext/cvpoint2d32f.h
178
+ - ext/cvpoint3d32f.cpp
179
+ - ext/cvpoint3d32f.h
180
+ - ext/cvrect.cpp
181
+ - ext/cvrect.h
182
+ - ext/cvscalar.cpp
183
+ - ext/cvscalar.h
184
+ - ext/cvseq.cpp
185
+ - ext/cvseq.h
186
+ - ext/cvset.cpp
187
+ - ext/cvset.h
188
+ - ext/cvsize.cpp
189
+ - ext/cvsize.h
190
+ - ext/cvsize2d32f.cpp
191
+ - ext/cvsize2d32f.h
192
+ - ext/cvslice.cpp
193
+ - ext/cvslice.h
194
+ - ext/cvsparsemat.cpp
195
+ - ext/cvsparsemat.h
196
+ - ext/cvtermcriteria.cpp
197
+ - ext/cvtermcriteria.h
198
+ - ext/cvtwopoints.cpp
199
+ - ext/cvtwopoints.h
200
+ - ext/cvvector.cpp
201
+ - ext/cvvector.h
202
+ - ext/cvvideowriter.cpp
203
+ - ext/cvvideowriter.h
204
+ - ext/extconf.rb
205
+ - ext/gui.cpp
206
+ - ext/gui.h
207
+ - ext/iplconvkernel.cpp
208
+ - ext/iplconvkernel.h
209
+ - ext/iplimage.cpp
210
+ - ext/iplimage.h
211
+ - ext/mouseevent.cpp
212
+ - ext/mouseevent.h
213
+ - ext/opencv.cpp
214
+ - ext/opencv.h
215
+ - ext/point3dset.cpp
216
+ - ext/point3dset.h
217
+ - ext/pointset.cpp
218
+ - ext/pointset.h
219
+ - ext/trackbar.cpp
220
+ - ext/trackbar.h
221
+ - ext/window.cpp
222
+ - ext/window.h
223
+ - images/CvMat_sobel.png
224
+ - images/CvMat_sub_rect.png
225
+ - images/CvSeq_relationmap.png
226
+ - images/face_detect_from_lena.jpg
227
+ - lib/opencv.rb
228
+ - lib/version.rb
229
+ - License.txt
230
+ - Manifest
231
+ - metadata
232
+ - Rakefile
233
+ - README.rdoc
234
+ - setup/setup.cygwin.rb
235
+ - setup/setup.mingw.rb
236
+ - setup/setup.mswin32.rb
237
+ - test/test_opencv.rb
238
+ - ruby-opencv.gemspec
239
+ has_rdoc: true
240
+ homepage: http://github.com/adamb/ruby-opencv
241
+ post_install_message:
242
+ rdoc_options:
243
+ - --line-numbers
244
+ - --inline-source
245
+ - --title
246
+ - Ruby-opencv
247
+ - --main
248
+ - README.rdoc
249
+ require_paths:
250
+ - lib
251
+ - ext
252
+ required_ruby_version: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ">="
255
+ - !ruby/object:Gem::Version
256
+ version: "0"
257
+ version:
258
+ required_rubygems_version: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: "1.2"
263
+ version:
264
+ requirements: []
265
+
266
+ rubyforge_project: ruby-opencv
267
+ rubygems_version: 1.2.0
268
+ signing_key:
269
+ specification_version: 2
270
+ summary: OpenCV wrapper for Ruby.
271
+ test_files:
272
+ - test/test_opencv.rb