ropencv 0.0.7 → 0.0.8
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 +12 -4
- data/.yardopts +5 -2
- data/README.md +8 -16
- data/examples/find_keypoints.rb +1 -1
- data/ext/helper.rb +106 -0
- data/ext/opencv.txt +26 -131
- data/ext/opencv.yml +20100 -0
- data/ext/rbind.rb +48 -75
- data/ext/src/CMakeLists.txt +6 -7
- data/ext/src/cmake/FindGem.cmake +2 -2
- data/lib/{ruby/ropencv.rb → ropencv.rb} +0 -0
- data/lib/{ruby/ropencv → ropencv}/ropencv_ruby.rb +109 -57
- data/ropencv.gemspec +6 -7
- data/test/suite.rb +5 -0
- data/test/test_mat.rb +67 -0
- data/test/test_scalar.rb +34 -0
- data/test/test_triangulate_points.rb +34 -0
- data/test/test_vec.rb +150 -0
- data/test/test_vector.rb +68 -0
- metadata +16 -11
- data/examples/affine3d.rb +0 -17
- data/examples/scalar.rb +0 -10
- data/ext/specializing.rb +0 -50
data/examples/affine3d.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'ropencv'
|
2
|
-
require 'pp'
|
3
|
-
|
4
|
-
include OpenCV
|
5
|
-
|
6
|
-
first = Vector::Point3f.new
|
7
|
-
second = Vector::Point3f.new
|
8
|
-
aff = cv::Mat.new
|
9
|
-
mask = cv::Mat.new
|
10
|
-
|
11
|
-
0.upto(5) do |i|
|
12
|
-
first.push_back(cv::Point3f.new(10*i,10*(i%3),10))
|
13
|
-
second.push_back(cv::Point3f.new(i,i%3,1))
|
14
|
-
end
|
15
|
-
|
16
|
-
cv::estimate_affine3d(first, second, aff,mask)
|
17
|
-
pp aff
|
data/examples/scalar.rb
DELETED
data/ext/specializing.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
|
2
|
-
# specialize some types
|
3
|
-
module Rbind
|
4
|
-
class RPtr < RStruct
|
5
|
-
def initialize(name,root,type)
|
6
|
-
super(name)
|
7
|
-
add_operation ROperation.new(self.name,nil,RParameter.new("other",self))
|
8
|
-
add_operation ROperation.new("addref",root.type("void"))
|
9
|
-
add_operation ROperation.new("release",root.type("void"))
|
10
|
-
add_operation ROperation.new("delete_obj",root.type("void"))
|
11
|
-
add_operation ROperation.new("empty",root.type("bool"))
|
12
|
-
add_attribute RAttribute.new("obj",type.to_ptr)
|
13
|
-
end
|
14
|
-
def specialize_ruby
|
15
|
-
" def method_missing(m,*args)\n"\
|
16
|
-
" raise \"Ptr #{self} is empty. Cannot call \#{m} on it!\" if empty\n"\
|
17
|
-
" obj.method(m).call(*args)\n"\
|
18
|
-
" end\n"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class RVector < RStruct
|
23
|
-
def specialize_ruby
|
24
|
-
%Q$ include Enumerable
|
25
|
-
def each(&block)
|
26
|
-
if block
|
27
|
-
s = size
|
28
|
-
0.upto(s-1) do |i|
|
29
|
-
yield self[i]
|
30
|
-
end
|
31
|
-
else
|
32
|
-
Enumerator.new(self)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
def <<(val)
|
36
|
-
push_back(val)
|
37
|
-
end
|
38
|
-
Kernel.eval %Q{module ::OpenCV
|
39
|
-
module Vector
|
40
|
-
class #{GeneratorRuby.normalize_type_name(@vector_type.name)}
|
41
|
-
def self.new
|
42
|
-
::#{GeneratorRuby.normalize_type_name(self.name)}.new
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end}$
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|