ropencv 0.0.15 → 0.0.16
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.
- checksums.yaml +7 -0
- data/examples/polyfit.rb +23 -0
- data/ext/helper.rb +3 -1
- data/ext/post_opencv244.txt +5 -0
- data/ext/post_opencv249.txt +10 -18
- data/ext/post_opencv300.txt +19 -0
- data/ext/rbind.rb +8 -2
- data/lib/ropencv/ropencv_ruby.rb +13 -2
- data/manifest.xml +1 -1
- data/ropencv.gemspec +3 -3
- metadata +13 -17
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 39055e33e22c2615099251a767b83f5b97e948ff
|
4
|
+
data.tar.gz: 392dcbf781cfa6323b5029274e411ebd3f4a9d45
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 375174256aeba9a7a90819635759a0a83a82340d05926c22b89d921a7f8044565f20a0e2d5b7a18975a2a1e1b04620962acca7e7dc9f0735b4b99d119b1d30b1
|
7
|
+
data.tar.gz: 782e554b59894e2af9f706710b84952a705a5308c4dd554bab1176a80cc5bbc903871b6b71e69c58d7790b81c2ec73d622a5bf92b3338c296bf4776f1f85ff1f
|
data/examples/polyfit.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'ropencv'
|
2
|
+
require 'pp'
|
3
|
+
|
4
|
+
include OpenCV
|
5
|
+
|
6
|
+
# values do not have to be ordered
|
7
|
+
# y = 3x^2-2x+1
|
8
|
+
x = [2.0,4.0,0.0,1.0,10]
|
9
|
+
y = x.map do |val|
|
10
|
+
3.0*val*val-2.0*val+1
|
11
|
+
end
|
12
|
+
|
13
|
+
# only CV_32F is supported by opencv for now
|
14
|
+
x = cv::Mat.new(x)
|
15
|
+
x.convert_to(x,cv::CV_32F)
|
16
|
+
y = cv::Mat.new(y)
|
17
|
+
y.convert_to(y,cv::CV_32F)
|
18
|
+
|
19
|
+
# out has to be created by the user as well
|
20
|
+
out = cv::Mat.new(3,1,cv::CV_32FC1)
|
21
|
+
|
22
|
+
cv::polyfit(x,y,out,2)
|
23
|
+
pp out
|
data/ext/helper.rb
CHANGED
@@ -100,6 +100,7 @@ def find_opencv
|
|
100
100
|
"opencv2/imgproc/imgproc_c.h", "opencv2/imgproc/types_c.h",
|
101
101
|
"opencv2/imgproc/imgproc.hpp", "opencv2/photo/photo_c.h",
|
102
102
|
"opencv2/photo/photo.hpp", "opencv2/video/video.hpp","opencv2/video/tracking.hpp",
|
103
|
+
"opencv2/video/background_segm.hpp",
|
103
104
|
"opencv2/features2d/features2d.hpp", "opencv2/objdetect/objdetect.hpp",
|
104
105
|
"opencv2/calib3d/calib3d.hpp", "opencv2/ml/ml.hpp",
|
105
106
|
"opencv2/highgui/highgui_c.h", "opencv2/highgui/highgui.hpp",
|
@@ -107,7 +108,7 @@ def find_opencv
|
|
107
108
|
"opencv2/nonfree/features2d.hpp"]
|
108
109
|
elsif opencv_version >= "2.4.9"
|
109
110
|
["opencv2/core.hpp", "opencv2/core/types.hpp","opencv2/core/persistence.hpp",
|
110
|
-
"opencv2/core/utility.hpp", "opencv2/core/base.hpp",
|
111
|
+
"opencv2/core/utility.hpp", "opencv2/core/base.hpp","opencv2/core/core.hpp",
|
111
112
|
"opencv2/contrib.hpp", "opencv2/calib3d.hpp",
|
112
113
|
"opencv2/features2d.hpp", "opencv2/flann.hpp",
|
113
114
|
"opencv2/highgui.hpp", "opencv2/imgproc.hpp",
|
@@ -116,6 +117,7 @@ def find_opencv
|
|
116
117
|
"opencv2/photo.hpp", "opencv2/softcascade.hpp",
|
117
118
|
"opencv2/stitching.hpp", "opencv2/superres.hpp",
|
118
119
|
"opencv2/video.hpp", "opencv2/legacy.hpp","opencv2/video/tracking.hpp",
|
120
|
+
"opencv2/video/background_segm.hpp",
|
119
121
|
"opencv2/videostab.hpp"]
|
120
122
|
else
|
121
123
|
raise "OpenCV version #{opencv_version} is not supported"
|
data/ext/post_opencv244.txt
CHANGED
data/ext/post_opencv249.txt
CHANGED
@@ -1,19 +1,11 @@
|
|
1
|
-
cv.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
Mat E
|
12
|
-
Mat points1
|
13
|
-
Mat points2
|
14
|
-
Mat R /O; /O
|
15
|
-
Mat t /O; /O
|
16
|
-
double focal 1.0
|
17
|
-
Point2d pp Point2d(0, 0)
|
18
|
-
Mat mask Mat()/IO; /IO
|
1
|
+
cv.KeyPoint.convert void /S
|
2
|
+
vector<KeyPoint> keypoints
|
3
|
+
vector<Point2f> points2f /O
|
4
|
+
cv.KeyPoint.convert void /S
|
5
|
+
vector<Point2f> points2f
|
6
|
+
vector<KeyPoint> keypoints /O
|
7
|
+
float size 1
|
8
|
+
float response
|
9
|
+
int octave 0
|
10
|
+
int class_id -1
|
19
11
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
cv.findEssentialMat Mat
|
2
|
+
Mat points1
|
3
|
+
Mat points2
|
4
|
+
double focal 1.0
|
5
|
+
Point2d pp Point2d(0, 0)
|
6
|
+
int method RANSAC
|
7
|
+
double prob 0.999
|
8
|
+
double threshold 1.0
|
9
|
+
Mat mask Mat()/O; /O
|
10
|
+
cv.recoverPose int
|
11
|
+
Mat E
|
12
|
+
Mat points1
|
13
|
+
Mat points2
|
14
|
+
Mat R /O; /O
|
15
|
+
Mat t /O; /O
|
16
|
+
double focal 1.0
|
17
|
+
Point2d pp Point2d(0, 0)
|
18
|
+
Mat mask Mat()/IO; /IO
|
19
|
+
|
data/ext/rbind.rb
CHANGED
@@ -11,7 +11,7 @@ rbind.includes = opencv_headers
|
|
11
11
|
|
12
12
|
# add some templates and alias
|
13
13
|
rbind.parser.type_alias["const_c_string"] = rbind.c_string.to_const
|
14
|
-
if opencv_version >= "
|
14
|
+
if opencv_version >= "3.0.0"
|
15
15
|
rbind.add_std_types
|
16
16
|
rbind.parser.add_type OpenCVPtr2.new
|
17
17
|
else
|
@@ -39,9 +39,9 @@ rbind.parse File.join(File.dirname(__FILE__),"post_opencv244.txt")
|
|
39
39
|
# post parsing + patching wrong signatures
|
40
40
|
if opencv_version >= "2.4.9" && opencv_version < "3.0.0"
|
41
41
|
rbind.parse File.join(File.dirname(__FILE__),"post_opencv249.txt")
|
42
|
-
rbind.cv.randShuffle.parameter(2).remove_const!
|
43
42
|
elsif opencv_version >= "3.0.0"
|
44
43
|
rbind.parse File.join(File.dirname(__FILE__),"post_opencv249.txt")
|
44
|
+
rbind.parse File.join(File.dirname(__FILE__),"post_opencv300.txt")
|
45
45
|
rbind.cv.randShuffle.parameter(2).remove_const!
|
46
46
|
rbind.cv.AlignExposures.process.parameter(1).remove_const!
|
47
47
|
rbind.cv.AlignMTB.process[0].parameter(1).remove_const!
|
@@ -70,9 +70,15 @@ rbind.cv.chamerMatching.parameter(1).remove_const!
|
|
70
70
|
rbind.cv.chamerMatching.parameter(2).remove_const!
|
71
71
|
|
72
72
|
# add some more vector types
|
73
|
+
rbind.parser.type("std::vector<Point2d>")
|
73
74
|
rbind.parser.type("std::vector<Point3f>")
|
74
75
|
rbind.parser.type("std::vector<Point3d>")
|
75
76
|
rbind.parser.type("std::vector<Vec4i>")
|
77
|
+
rbind.parser.type("std::vector<uint32_t>")
|
78
|
+
rbind.parser.type("std::vector<uint64_t>")
|
79
|
+
rbind.parser.type("std::vector<int8_t>")
|
80
|
+
rbind.parser.type("std::vector<int64_t>")
|
81
|
+
rbind.parser.type("std::vector<std::vector<Point2d> >")
|
76
82
|
|
77
83
|
# add some extra documentation
|
78
84
|
rbind.parser.doc = "ROpenCV API Documentation for OpenCV #{opencv_version}"
|
data/lib/ropencv/ropencv_ruby.rb
CHANGED
@@ -28,6 +28,12 @@ module OpenCV
|
|
28
28
|
t << Cv::Mat.new(e.size,2,Cv::CV_32FC1,e.data,Cv::Mat::AUTO_STEP)
|
29
29
|
end
|
30
30
|
t.__obj_ptr__
|
31
|
+
elsif obj.is_a?(Vector::Std_Vector_Cv_Point2d)
|
32
|
+
t = Vector::Cv_Mat.new
|
33
|
+
obj.each do |e|
|
34
|
+
t << Cv::Mat.new(e.size,2,Cv::CV_64FC1,e.data,Cv::Mat::AUTO_STEP)
|
35
|
+
end
|
36
|
+
t.__obj_ptr__
|
31
37
|
elsif obj.is_a?(Vector::Std_Vector_Cv_Point)
|
32
38
|
t = Vector::Cv_Mat.new
|
33
39
|
obj.each do |e|
|
@@ -39,6 +45,7 @@ module OpenCV
|
|
39
45
|
end
|
40
46
|
end
|
41
47
|
end
|
48
|
+
Fixnum = Int
|
42
49
|
end
|
43
50
|
end
|
44
51
|
include Std
|
@@ -331,9 +338,13 @@ module OpenCV
|
|
331
338
|
Cv::Mat.new(obj.size,1,Cv::CV_32SC2,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
332
339
|
elsif obj.is_a?(Std::Vector::Cv_Point2f)
|
333
340
|
Cv::Mat.new(obj.size,1,Cv::CV_32FC2,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
341
|
+
elsif obj.is_a?(Std::Vector::Cv_Point2d)
|
342
|
+
Cv::Mat.new(obj.size,1,Cv::CV_64FC2,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
334
343
|
elsif obj.is_a?(Std::Vector::Cv_Point3f)
|
335
344
|
Cv::Mat.new(obj.size,1,Cv::CV_32FC3,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
336
|
-
elsif obj.is_a?(Std::Vector::
|
345
|
+
elsif obj.is_a?(Std::Vector::Cv_Point3d)
|
346
|
+
Cv::Mat.new(obj.size,1,Cv::CV_64FC3,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
347
|
+
elsif obj.is_a?(Std::Vector::Int)
|
337
348
|
Cv::Mat.new(obj.size,1,Cv::CV_32SC1,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
338
349
|
elsif obj.is_a?(Std::Vector::Float)
|
339
350
|
Cv::Mat.new(obj.size,1,Cv::CV_32FC1,obj.data,Cv::Mat::AUTO_STEP).__obj_ptr__
|
@@ -364,7 +375,7 @@ module OpenCV
|
|
364
375
|
ptr = mat.data
|
365
376
|
setter = ptr.method(setter)
|
366
377
|
if h == 1 || w == 1
|
367
|
-
setter.call(0,obj)
|
378
|
+
setter.call(0,obj.flatten)
|
368
379
|
else
|
369
380
|
obj.each_with_index do |row,i|
|
370
381
|
raise ArgumentError, "number of row elements must be equal for each row" if row.size != w
|
data/manifest.xml
CHANGED
data/ropencv.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'ropencv'
|
3
|
-
s.version = '0.0.
|
4
|
-
s.date = '2014-
|
3
|
+
s.version = '0.0.16'
|
4
|
+
s.date = '2014-07-06'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ['Alexander Duda']
|
7
7
|
s.email = ['Alexander.Duda@dfki.de']
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.files = `git ls-files`.split("\n") + ["lib/ropencv/ropencv_types.rb","lib/ropencv/ropencv_ruby.rb"]
|
12
12
|
s.require_path = 'lib'
|
13
13
|
s.required_rubygems_version = ">= 1.3.6"
|
14
|
-
s.add_runtime_dependency "rbind", ">= 0.0.
|
14
|
+
s.add_runtime_dependency "rbind", ">= 0.0.25"
|
15
15
|
s.add_runtime_dependency "ffi", "~> 1.9.0"
|
16
16
|
s.extensions = ['ext/extconf.rb']
|
17
17
|
s.license = 'BSD'
|
metadata
CHANGED
@@ -1,36 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ropencv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.16
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Alexander Duda
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-07-06 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rbind
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.0.
|
19
|
+
version: 0.0.25
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.0.
|
26
|
+
version: 0.0.25
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: ffi
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -70,6 +65,7 @@ files:
|
|
70
65
|
- examples/hog_descriptor.rb
|
71
66
|
- examples/hough_circles.rb
|
72
67
|
- examples/match_keypoints.rb
|
68
|
+
- examples/polyfit.rb
|
73
69
|
- ext/CMakeLists.txt
|
74
70
|
- ext/extconf.rb
|
75
71
|
- ext/helper.rb
|
@@ -78,6 +74,7 @@ files:
|
|
78
74
|
- ext/parser_out.txt
|
79
75
|
- ext/post_opencv244.txt
|
80
76
|
- ext/post_opencv249.txt
|
77
|
+
- ext/post_opencv300.txt
|
81
78
|
- ext/pre_opencv244.txt
|
82
79
|
- ext/rbind.rb
|
83
80
|
- ext/src/CMakeLists.txt
|
@@ -99,27 +96,26 @@ files:
|
|
99
96
|
homepage: http://www.ropencv.aduda.eu
|
100
97
|
licenses:
|
101
98
|
- BSD
|
99
|
+
metadata: {}
|
102
100
|
post_install_message:
|
103
101
|
rdoc_options: []
|
104
102
|
require_paths:
|
105
103
|
- lib
|
106
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
105
|
requirements:
|
109
|
-
- -
|
106
|
+
- - '>='
|
110
107
|
- !ruby/object:Gem::Version
|
111
108
|
version: '0'
|
112
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
110
|
requirements:
|
115
|
-
- -
|
111
|
+
- - '>='
|
116
112
|
- !ruby/object:Gem::Version
|
117
113
|
version: 1.3.6
|
118
114
|
requirements: []
|
119
115
|
rubyforge_project:
|
120
|
-
rubygems_version:
|
116
|
+
rubygems_version: 2.0.14
|
121
117
|
signing_key:
|
122
|
-
specification_version:
|
118
|
+
specification_version: 4
|
123
119
|
summary: Ruby bindings for opencv 2.4.4 and higher
|
124
120
|
test_files: []
|
125
121
|
has_rdoc:
|