ruby-opencv 0.0.11 → 0.0.12.pre
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 +4 -4
- data/.gitignore +2 -0
- data/.yardopts +3 -0
- data/Gemfile +1 -0
- data/Manifest.txt +2 -14
- data/README.md +1 -1
- data/Rakefile +10 -1
- data/examples/facerec/facerec_lbph.rb +1 -1
- data/ext/opencv/algorithm.cpp +6 -1
- data/ext/opencv/algorithm.h +1 -1
- data/ext/opencv/curve.cpp +48 -33
- data/ext/opencv/curve.h +1 -1
- data/ext/opencv/cvavgcomp.cpp +22 -25
- data/ext/opencv/cvavgcomp.h +1 -1
- data/ext/opencv/cvbox2d.cpp +56 -58
- data/ext/opencv/cvbox2d.h +1 -1
- data/ext/opencv/cvcapture.cpp +210 -109
- data/ext/opencv/cvcapture.h +1 -1
- data/ext/opencv/cvchain.cpp +71 -71
- data/ext/opencv/cvchain.h +1 -1
- data/ext/opencv/cvcircle32f.cpp +37 -27
- data/ext/opencv/cvcircle32f.h +1 -1
- data/ext/opencv/cvconnectedcomp.cpp +49 -36
- data/ext/opencv/cvconnectedcomp.h +1 -1
- data/ext/opencv/cvcontour.cpp +117 -81
- data/ext/opencv/cvcontour.h +1 -1
- data/ext/opencv/cvcontourtree.cpp +37 -32
- data/ext/opencv/cvcontourtree.h +1 -1
- data/ext/opencv/cvconvexitydefect.cpp +33 -44
- data/ext/opencv/cvconvexitydefect.h +1 -1
- data/ext/opencv/cverror.cpp +22 -66
- data/ext/opencv/cverror.h +1 -1
- data/ext/opencv/cvfeaturetree.cpp +31 -33
- data/ext/opencv/cvfeaturetree.h +1 -1
- data/ext/opencv/cvfont.cpp +98 -78
- data/ext/opencv/cvfont.h +1 -1
- data/ext/opencv/cvhaarclassifiercascade.cpp +39 -59
- data/ext/opencv/cvhaarclassifiercascade.h +1 -1
- data/ext/opencv/cvhistogram.cpp +259 -90
- data/ext/opencv/cvhistogram.h +1 -1
- data/ext/opencv/cvhumoments.cpp +99 -60
- data/ext/opencv/cvhumoments.h +1 -1
- data/ext/opencv/cvline.cpp +45 -40
- data/ext/opencv/cvline.h +1 -1
- data/ext/opencv/cvmat.cpp +1894 -1829
- data/ext/opencv/cvmat.h +2 -3
- data/ext/opencv/cvmemstorage.cpp +19 -14
- data/ext/opencv/cvmemstorage.h +1 -1
- data/ext/opencv/cvmoments.cpp +51 -45
- data/ext/opencv/cvmoments.h +1 -1
- data/ext/opencv/cvpoint.cpp +32 -26
- data/ext/opencv/cvpoint.h +1 -1
- data/ext/opencv/cvpoint2d32f.cpp +31 -26
- data/ext/opencv/cvpoint2d32f.h +1 -1
- data/ext/opencv/cvpoint3d32f.cpp +36 -29
- data/ext/opencv/cvpoint3d32f.h +1 -1
- data/ext/opencv/cvrect.cpp +38 -33
- data/ext/opencv/cvrect.h +1 -1
- data/ext/opencv/cvscalar.cpp +50 -45
- data/ext/opencv/cvscalar.h +1 -1
- data/ext/opencv/cvseq.cpp +53 -47
- data/ext/opencv/cvseq.h +1 -1
- data/ext/opencv/cvsize.cpp +32 -26
- data/ext/opencv/cvsize.h +1 -1
- data/ext/opencv/cvsize2d32f.cpp +31 -25
- data/ext/opencv/cvsize2d32f.h +1 -1
- data/ext/opencv/cvslice.cpp +28 -22
- data/ext/opencv/cvslice.h +1 -1
- data/ext/opencv/cvsurfparams.cpp +37 -28
- data/ext/opencv/cvsurfparams.h +1 -1
- data/ext/opencv/cvsurfpoint.cpp +76 -53
- data/ext/opencv/cvsurfpoint.h +1 -1
- data/ext/opencv/cvtermcriteria.cpp +32 -26
- data/ext/opencv/cvtermcriteria.h +1 -1
- data/ext/opencv/cvtwopoints.cpp +28 -22
- data/ext/opencv/cvtwopoints.h +1 -1
- data/ext/opencv/cvvideowriter.cpp +25 -20
- data/ext/opencv/cvvideowriter.h +1 -1
- data/ext/opencv/eigenfaces.cpp +10 -2
- data/ext/opencv/eigenfaces.h +1 -1
- data/ext/opencv/facerecognizer.cpp +15 -8
- data/ext/opencv/facerecognizer.h +2 -2
- data/ext/opencv/fisherfaces.cpp +10 -2
- data/ext/opencv/fisherfaces.h +1 -1
- data/ext/opencv/gui.cpp +26 -23
- data/ext/opencv/gui.h +1 -1
- data/ext/opencv/iplconvkernel.cpp +30 -24
- data/ext/opencv/iplconvkernel.h +1 -1
- data/ext/opencv/iplimage.cpp +49 -42
- data/ext/opencv/iplimage.h +1 -1
- data/ext/opencv/lbph.cpp +10 -2
- data/ext/opencv/lbph.h +1 -1
- data/ext/opencv/mouseevent.cpp +30 -25
- data/ext/opencv/mouseevent.h +1 -1
- data/ext/opencv/opencv.cpp +59 -60
- data/ext/opencv/opencv.h +1 -5
- data/ext/opencv/pointset.cpp +31 -25
- data/ext/opencv/pointset.h +1 -1
- data/ext/opencv/trackbar.cpp +27 -21
- data/ext/opencv/trackbar.h +1 -1
- data/ext/opencv/window.cpp +77 -57
- data/ext/opencv/window.h +1 -1
- data/lib/opencv/version.rb +2 -1
- data/ruby-opencv.gemspec +19 -18
- data/test/test_opencv.rb +5 -3
- data/yard_extension.rb +5 -0
- metadata +13 -27
- data/examples/matching_to_many_images/matching_to_many_images.rb +0 -16
- 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 +0 -3
- data/ext/opencv/cvcondensation.cpp +0 -282
- data/ext/opencv/cvcondensation.h +0 -49
- data/ext/opencv/cvmatnd.cpp +0 -44
- data/ext/opencv/cvmatnd.h +0 -28
- data/ext/opencv/cvsparsemat.cpp +0 -44
- data/ext/opencv/cvsparsemat.h +0 -28
- data/images/face_detect_from_lena.jpg +0 -0
- data/test/test_cvmat_matching.rb +0 -57
data/ext/opencv/cvsize2d32f.h
CHANGED
data/ext/opencv/cvslice.cpp
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
************************************************************/
|
|
10
10
|
#include "cvslice.h"
|
|
11
11
|
/*
|
|
12
|
-
* Document-class: OpenCV::
|
|
12
|
+
* Document-class: OpenCV::CvSlice
|
|
13
13
|
*
|
|
14
14
|
* C structure is here, very simple.
|
|
15
15
|
* typdef struct CvSlice {
|
|
@@ -28,26 +28,6 @@ rb_class()
|
|
|
28
28
|
return rb_klass;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
void
|
|
32
|
-
define_ruby_class()
|
|
33
|
-
{
|
|
34
|
-
if (rb_klass)
|
|
35
|
-
return;
|
|
36
|
-
/*
|
|
37
|
-
* opencv = rb_define_module("OpenCV");
|
|
38
|
-
*
|
|
39
|
-
* note: this comment is used by rdoc.
|
|
40
|
-
*/
|
|
41
|
-
VALUE opencv = rb_module_opencv();
|
|
42
|
-
rb_klass = rb_define_class_under(opencv, "CvSlice", rb_cObject);
|
|
43
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
44
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), 2);
|
|
45
|
-
rb_define_method(rb_klass, "start_index", RUBY_METHOD_FUNC(rb_start_index_aref), 0);
|
|
46
|
-
rb_define_method(rb_klass, "end_index", RUBY_METHOD_FUNC(rb_end_index_aref), 0);
|
|
47
|
-
rb_define_method(rb_klass, "start_index=", RUBY_METHOD_FUNC(rb_start_index_aset), 1);
|
|
48
|
-
rb_define_method(rb_klass, "end_index=", RUBY_METHOD_FUNC(rb_end_index_aset), 1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
31
|
VALUE
|
|
52
32
|
rb_allocate(VALUE klass)
|
|
53
33
|
{
|
|
@@ -57,7 +37,7 @@ rb_allocate(VALUE klass)
|
|
|
57
37
|
|
|
58
38
|
/*
|
|
59
39
|
* call-seq:
|
|
60
|
-
* new(
|
|
40
|
+
* new(start, end)
|
|
61
41
|
*
|
|
62
42
|
* Create new slice object.
|
|
63
43
|
*/
|
|
@@ -116,5 +96,31 @@ rb_end_index_aset(VALUE self, VALUE index)
|
|
|
116
96
|
return self;
|
|
117
97
|
}
|
|
118
98
|
|
|
99
|
+
void
|
|
100
|
+
init_ruby_class()
|
|
101
|
+
{
|
|
102
|
+
#if 0
|
|
103
|
+
// For documentation using YARD
|
|
104
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
if (rb_klass)
|
|
108
|
+
return;
|
|
109
|
+
/*
|
|
110
|
+
* opencv = rb_define_module("OpenCV");
|
|
111
|
+
*
|
|
112
|
+
* note: this comment is used by rdoc.
|
|
113
|
+
*/
|
|
114
|
+
VALUE opencv = rb_module_opencv();
|
|
115
|
+
rb_klass = rb_define_class_under(opencv, "CvSlice", rb_cObject);
|
|
116
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
117
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), 2);
|
|
118
|
+
rb_define_method(rb_klass, "start_index", RUBY_METHOD_FUNC(rb_start_index_aref), 0);
|
|
119
|
+
rb_define_method(rb_klass, "end_index", RUBY_METHOD_FUNC(rb_end_index_aref), 0);
|
|
120
|
+
rb_define_method(rb_klass, "start_index=", RUBY_METHOD_FUNC(rb_start_index_aset), 1);
|
|
121
|
+
rb_define_method(rb_klass, "end_index=", RUBY_METHOD_FUNC(rb_end_index_aset), 1);
|
|
122
|
+
}
|
|
123
|
+
|
|
119
124
|
__NAMESPACE_END_CVSLICE
|
|
120
125
|
__NAMESPACE_END_OPENCV
|
|
126
|
+
|
data/ext/opencv/cvslice.h
CHANGED
data/ext/opencv/cvsurfparams.cpp
CHANGED
|
@@ -30,30 +30,6 @@ rb_class()
|
|
|
30
30
|
return rb_klass;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
void
|
|
34
|
-
define_ruby_class()
|
|
35
|
-
{
|
|
36
|
-
if (rb_klass)
|
|
37
|
-
return;
|
|
38
|
-
/*
|
|
39
|
-
* opencv = rb_define_module("OpenCV");
|
|
40
|
-
*
|
|
41
|
-
* note: this comment is used by rdoc.
|
|
42
|
-
*/
|
|
43
|
-
VALUE opencv = rb_module_opencv();
|
|
44
|
-
rb_klass = rb_define_class_under(opencv, "CvSURFParams", rb_cObject);
|
|
45
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
46
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
47
|
-
rb_define_method(rb_klass, "hessian_threshold", RUBY_METHOD_FUNC(rb_get_hessian_threshold), 0);
|
|
48
|
-
rb_define_method(rb_klass, "hessian_threshold=", RUBY_METHOD_FUNC(rb_set_hessian_threshold), 1);
|
|
49
|
-
rb_define_method(rb_klass, "extended", RUBY_METHOD_FUNC(rb_get_extended), 0);
|
|
50
|
-
rb_define_method(rb_klass, "extended=", RUBY_METHOD_FUNC(rb_set_extended), 1);
|
|
51
|
-
rb_define_method(rb_klass, "n_octaves", RUBY_METHOD_FUNC(rb_get_n_octaves), 0);
|
|
52
|
-
rb_define_method(rb_klass, "n_octaves=", RUBY_METHOD_FUNC(rb_set_n_octaves), 1);
|
|
53
|
-
rb_define_method(rb_klass, "n_octave_layers", RUBY_METHOD_FUNC(rb_get_n_octave_layers), 0);
|
|
54
|
-
rb_define_method(rb_klass, "n_octave_layers=", RUBY_METHOD_FUNC(rb_set_n_octave_layers), 1);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
33
|
VALUE
|
|
58
34
|
rb_allocate(VALUE klass)
|
|
59
35
|
{
|
|
@@ -61,11 +37,15 @@ rb_allocate(VALUE klass)
|
|
|
61
37
|
return Data_Make_Struct(klass, CvSURFParams, 0, -1, ptr);
|
|
62
38
|
}
|
|
63
39
|
|
|
64
|
-
/*
|
|
65
|
-
* call-seq:
|
|
66
|
-
* CvSURFParams.new(<i>hessian_threshold[,extended=false,n_octaves=3,n_octave_layers=4]</i>) -> cvsurfparams
|
|
67
|
-
*
|
|
40
|
+
/*
|
|
68
41
|
* Create a CvSURFParams
|
|
42
|
+
*
|
|
43
|
+
* @overload CvSURFParams.new(hessian_threshold, extended = false, n_octaves = 3, n_octave_layers = 4)
|
|
44
|
+
* @param hessian_threshold [Number]
|
|
45
|
+
* @param extended [Boolean] If <tt>true</tt>, exteneded descriptors (128 elements each),
|
|
46
|
+
* otherwise basic descriptors (64 elements each)
|
|
47
|
+
* @param n_octaves [Integer] Number of octaves to be used for extraction
|
|
48
|
+
* @param n_octave_layers [Integer] Number of layers within each octave
|
|
69
49
|
*/
|
|
70
50
|
VALUE
|
|
71
51
|
rb_initialize(int argc, VALUE *argv, VALUE self)
|
|
@@ -194,6 +174,35 @@ new_object(CvSURFParams* cvsurfparams)
|
|
|
194
174
|
return object;
|
|
195
175
|
}
|
|
196
176
|
|
|
177
|
+
void
|
|
178
|
+
init_ruby_class()
|
|
179
|
+
{
|
|
180
|
+
#if 0
|
|
181
|
+
// For documentation using YARD
|
|
182
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
183
|
+
#endif
|
|
184
|
+
|
|
185
|
+
if (rb_klass)
|
|
186
|
+
return;
|
|
187
|
+
/*
|
|
188
|
+
* opencv = rb_define_module("OpenCV");
|
|
189
|
+
*
|
|
190
|
+
* note: this comment is used by rdoc.
|
|
191
|
+
*/
|
|
192
|
+
VALUE opencv = rb_module_opencv();
|
|
193
|
+
rb_klass = rb_define_class_under(opencv, "CvSURFParams", rb_cObject);
|
|
194
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
195
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
196
|
+
rb_define_method(rb_klass, "hessian_threshold", RUBY_METHOD_FUNC(rb_get_hessian_threshold), 0);
|
|
197
|
+
rb_define_method(rb_klass, "hessian_threshold=", RUBY_METHOD_FUNC(rb_set_hessian_threshold), 1);
|
|
198
|
+
rb_define_method(rb_klass, "extended", RUBY_METHOD_FUNC(rb_get_extended), 0);
|
|
199
|
+
rb_define_method(rb_klass, "extended=", RUBY_METHOD_FUNC(rb_set_extended), 1);
|
|
200
|
+
rb_define_method(rb_klass, "n_octaves", RUBY_METHOD_FUNC(rb_get_n_octaves), 0);
|
|
201
|
+
rb_define_method(rb_klass, "n_octaves=", RUBY_METHOD_FUNC(rb_set_n_octaves), 1);
|
|
202
|
+
rb_define_method(rb_klass, "n_octave_layers", RUBY_METHOD_FUNC(rb_get_n_octave_layers), 0);
|
|
203
|
+
rb_define_method(rb_klass, "n_octave_layers=", RUBY_METHOD_FUNC(rb_set_n_octave_layers), 1);
|
|
204
|
+
}
|
|
205
|
+
|
|
197
206
|
__NAMESPACE_END_CVSURFPARAMS
|
|
198
207
|
__NAMESPACE_END_OPENCV
|
|
199
208
|
|
data/ext/opencv/cvsurfparams.h
CHANGED
data/ext/opencv/cvsurfpoint.cpp
CHANGED
|
@@ -35,32 +35,6 @@ rb_class()
|
|
|
35
35
|
return rb_klass;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
void
|
|
39
|
-
define_ruby_class()
|
|
40
|
-
{
|
|
41
|
-
if (rb_klass)
|
|
42
|
-
return;
|
|
43
|
-
/*
|
|
44
|
-
* opencv = rb_define_module("OpenCV");
|
|
45
|
-
*
|
|
46
|
-
* note: this comment is used by rdoc.
|
|
47
|
-
*/
|
|
48
|
-
VALUE opencv = rb_module_opencv();
|
|
49
|
-
rb_klass = rb_define_class_under(opencv, "CvSURFPoint", rb_cObject);
|
|
50
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
51
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), 5);
|
|
52
|
-
rb_define_method(rb_klass, "pt", RUBY_METHOD_FUNC(rb_get_pt), 0);
|
|
53
|
-
rb_define_method(rb_klass, "pt=", RUBY_METHOD_FUNC(rb_set_pt), 1);
|
|
54
|
-
rb_define_method(rb_klass, "laplacian", RUBY_METHOD_FUNC(rb_get_laplacian), 0);
|
|
55
|
-
rb_define_method(rb_klass, "laplacian=", RUBY_METHOD_FUNC(rb_set_laplacian), 1);
|
|
56
|
-
rb_define_method(rb_klass, "size", RUBY_METHOD_FUNC(rb_get_size), 0);
|
|
57
|
-
rb_define_method(rb_klass, "size=", RUBY_METHOD_FUNC(rb_set_size), 1);
|
|
58
|
-
rb_define_method(rb_klass, "dir", RUBY_METHOD_FUNC(rb_get_dir), 0);
|
|
59
|
-
rb_define_method(rb_klass, "dir=", RUBY_METHOD_FUNC(rb_set_dir), 1);
|
|
60
|
-
rb_define_method(rb_klass, "hessian", RUBY_METHOD_FUNC(rb_get_hessian), 0);
|
|
61
|
-
rb_define_method(rb_klass, "hessian=", RUBY_METHOD_FUNC(rb_set_hessian), 1);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
38
|
VALUE
|
|
65
39
|
rb_allocate(VALUE klass)
|
|
66
40
|
{
|
|
@@ -69,10 +43,18 @@ rb_allocate(VALUE klass)
|
|
|
69
43
|
}
|
|
70
44
|
|
|
71
45
|
/*
|
|
72
|
-
* call-seq:
|
|
73
|
-
* CvSURFPoint.new(<i>pt,laplacian,size,dir,hessian</i>) -> cvsurfpoint
|
|
74
|
-
*
|
|
75
46
|
* Create a CvSURFPoint
|
|
47
|
+
*
|
|
48
|
+
* @overload new(pt, laplacian, size, dir, hessian)
|
|
49
|
+
* @param pt [CvPoint2D32f] Position of the feature within the image
|
|
50
|
+
* @param laplacian [Integer] -1, 0 or +1. sign of the laplacian at the point.
|
|
51
|
+
* Can be used to speedup feature comparison
|
|
52
|
+
* (normally features with laplacians of different signs can not match)
|
|
53
|
+
* @param size [Integer] Size of the feature
|
|
54
|
+
* @param dir [Number] Orientation of the feature: 0..360 degrees
|
|
55
|
+
* @param hessian [Number] Value of the hessian (can be used to
|
|
56
|
+
* approximately estimate the feature strengths)
|
|
57
|
+
* @return [CvSURFPoint] self
|
|
76
58
|
*/
|
|
77
59
|
VALUE
|
|
78
60
|
rb_initialize(VALUE self, VALUE pt, VALUE laplacian, VALUE size, VALUE dir, VALUE hessian)
|
|
@@ -88,9 +70,10 @@ rb_initialize(VALUE self, VALUE pt, VALUE laplacian, VALUE size, VALUE dir, VALU
|
|
|
88
70
|
}
|
|
89
71
|
|
|
90
72
|
/*
|
|
91
|
-
* call-seq:
|
|
92
|
-
* pt -> cvpoint2d32f
|
|
93
73
|
* Return position of the feature as CvPoint2D32f.
|
|
74
|
+
*
|
|
75
|
+
* @overload pt
|
|
76
|
+
* @return [CvPoint2D32f] Position of the feature.
|
|
94
77
|
*/
|
|
95
78
|
VALUE
|
|
96
79
|
rb_get_pt(VALUE self)
|
|
@@ -99,10 +82,10 @@ rb_get_pt(VALUE self)
|
|
|
99
82
|
}
|
|
100
83
|
|
|
101
84
|
/*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
85
|
+
* Set position of the feature.
|
|
86
|
+
*
|
|
87
|
+
* @overload pt=(value)
|
|
88
|
+
* @param value [CvPoint2D32f] Valuet to set.
|
|
106
89
|
*/
|
|
107
90
|
VALUE
|
|
108
91
|
rb_set_pt(VALUE self, VALUE value)
|
|
@@ -112,9 +95,10 @@ rb_set_pt(VALUE self, VALUE value)
|
|
|
112
95
|
}
|
|
113
96
|
|
|
114
97
|
/*
|
|
115
|
-
* call-seq:
|
|
116
|
-
* laplacian -> number
|
|
117
98
|
* Return sign of the laplacian at the point (-1, 0 or +1)
|
|
99
|
+
*
|
|
100
|
+
* @overload laplacian
|
|
101
|
+
* @return [Integer] Sign of the laplacian at the point.
|
|
118
102
|
*/
|
|
119
103
|
VALUE
|
|
120
104
|
rb_get_laplacian(VALUE self)
|
|
@@ -123,9 +107,10 @@ rb_get_laplacian(VALUE self)
|
|
|
123
107
|
}
|
|
124
108
|
|
|
125
109
|
/*
|
|
126
|
-
* call-seq:
|
|
127
|
-
* laplacian = <i>value</i> (-1, 0 or +1)
|
|
128
110
|
* Set sign of the laplacian at the point
|
|
111
|
+
*
|
|
112
|
+
* @overload laplacian=(value)
|
|
113
|
+
* @param value [Integer] Value to set.
|
|
129
114
|
*/
|
|
130
115
|
VALUE
|
|
131
116
|
rb_set_laplacian(VALUE self, VALUE value)
|
|
@@ -136,9 +121,10 @@ rb_set_laplacian(VALUE self, VALUE value)
|
|
|
136
121
|
}
|
|
137
122
|
|
|
138
123
|
/*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
124
|
+
* Returns size of feature.
|
|
125
|
+
*
|
|
126
|
+
* @overload size
|
|
127
|
+
* @return [Integer] Size of feature.
|
|
142
128
|
*/
|
|
143
129
|
VALUE
|
|
144
130
|
rb_get_size(VALUE self)
|
|
@@ -147,9 +133,10 @@ rb_get_size(VALUE self)
|
|
|
147
133
|
}
|
|
148
134
|
|
|
149
135
|
/*
|
|
150
|
-
* call-seq:
|
|
151
|
-
* size = <i>value</i>
|
|
152
136
|
* Return size of feature
|
|
137
|
+
*
|
|
138
|
+
* @overload size=(value)
|
|
139
|
+
* @param [Integer] Value to set.
|
|
153
140
|
*/
|
|
154
141
|
VALUE
|
|
155
142
|
rb_set_size(VALUE self, VALUE value)
|
|
@@ -159,9 +146,10 @@ rb_set_size(VALUE self, VALUE value)
|
|
|
159
146
|
}
|
|
160
147
|
|
|
161
148
|
/*
|
|
162
|
-
* call-seq:
|
|
163
|
-
* dir -> number
|
|
164
149
|
* Return orientation of the feature: 0..360 degrees
|
|
150
|
+
*
|
|
151
|
+
* @overload dir
|
|
152
|
+
* @return [Number] Orientation of the feature.
|
|
165
153
|
*/
|
|
166
154
|
VALUE
|
|
167
155
|
rb_get_dir(VALUE self)
|
|
@@ -170,9 +158,10 @@ rb_get_dir(VALUE self)
|
|
|
170
158
|
}
|
|
171
159
|
|
|
172
160
|
/*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
161
|
+
* Set orientation of the feature: 0..360 degrees.
|
|
162
|
+
*
|
|
163
|
+
* @overload dir=(value)
|
|
164
|
+
* @param [Number] Value to set.
|
|
176
165
|
*/
|
|
177
166
|
VALUE
|
|
178
167
|
rb_set_dir(VALUE self, VALUE value)
|
|
@@ -182,9 +171,10 @@ rb_set_dir(VALUE self, VALUE value)
|
|
|
182
171
|
}
|
|
183
172
|
|
|
184
173
|
/*
|
|
185
|
-
* call-seq:
|
|
186
|
-
* hessian -> number
|
|
187
174
|
* Return value of the hessian
|
|
175
|
+
*
|
|
176
|
+
* @overload hessian
|
|
177
|
+
* @return [Number] Hessian
|
|
188
178
|
*/
|
|
189
179
|
VALUE
|
|
190
180
|
rb_get_hessian(VALUE self)
|
|
@@ -193,9 +183,10 @@ rb_get_hessian(VALUE self)
|
|
|
193
183
|
}
|
|
194
184
|
|
|
195
185
|
/*
|
|
196
|
-
* call-seq:
|
|
197
|
-
* hessian = <i>value</i>
|
|
198
186
|
* Set value of the hessian
|
|
187
|
+
*
|
|
188
|
+
* @overload hessian=(value)
|
|
189
|
+
* @param [Number] Value to set.
|
|
199
190
|
*/
|
|
200
191
|
VALUE
|
|
201
192
|
rb_set_hessian(VALUE self, VALUE value)
|
|
@@ -219,5 +210,37 @@ new_object(CvSURFPoint* cvsurfpoint)
|
|
|
219
210
|
return object;
|
|
220
211
|
}
|
|
221
212
|
|
|
213
|
+
void
|
|
214
|
+
init_ruby_class()
|
|
215
|
+
{
|
|
216
|
+
#if 0
|
|
217
|
+
// For documentation using YARD
|
|
218
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
219
|
+
#endif
|
|
220
|
+
|
|
221
|
+
if (rb_klass)
|
|
222
|
+
return;
|
|
223
|
+
/*
|
|
224
|
+
* opencv = rb_define_module("OpenCV");
|
|
225
|
+
*
|
|
226
|
+
* note: this comment is used by rdoc.
|
|
227
|
+
*/
|
|
228
|
+
VALUE opencv = rb_module_opencv();
|
|
229
|
+
rb_klass = rb_define_class_under(opencv, "CvSURFPoint", rb_cObject);
|
|
230
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
231
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), 5);
|
|
232
|
+
rb_define_method(rb_klass, "pt", RUBY_METHOD_FUNC(rb_get_pt), 0);
|
|
233
|
+
rb_define_method(rb_klass, "pt=", RUBY_METHOD_FUNC(rb_set_pt), 1);
|
|
234
|
+
rb_define_method(rb_klass, "laplacian", RUBY_METHOD_FUNC(rb_get_laplacian), 0);
|
|
235
|
+
rb_define_method(rb_klass, "laplacian=", RUBY_METHOD_FUNC(rb_set_laplacian), 1);
|
|
236
|
+
rb_define_method(rb_klass, "size", RUBY_METHOD_FUNC(rb_get_size), 0);
|
|
237
|
+
rb_define_method(rb_klass, "size=", RUBY_METHOD_FUNC(rb_set_size), 1);
|
|
238
|
+
rb_define_method(rb_klass, "dir", RUBY_METHOD_FUNC(rb_get_dir), 0);
|
|
239
|
+
rb_define_method(rb_klass, "dir=", RUBY_METHOD_FUNC(rb_set_dir), 1);
|
|
240
|
+
rb_define_method(rb_klass, "hessian", RUBY_METHOD_FUNC(rb_get_hessian), 0);
|
|
241
|
+
rb_define_method(rb_klass, "hessian=", RUBY_METHOD_FUNC(rb_set_hessian), 1);
|
|
242
|
+
}
|
|
243
|
+
|
|
222
244
|
__NAMESPACE_END_CVSURFPOINT
|
|
223
245
|
__NAMESPACE_END_OPENCV
|
|
246
|
+
|
data/ext/opencv/cvsurfpoint.h
CHANGED
|
@@ -29,32 +29,6 @@ rb_class()
|
|
|
29
29
|
return rb_klass;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
void
|
|
33
|
-
define_ruby_class()
|
|
34
|
-
{
|
|
35
|
-
if (rb_klass)
|
|
36
|
-
return;
|
|
37
|
-
/*
|
|
38
|
-
* opencv = rb_define_module("OpenCV");
|
|
39
|
-
*
|
|
40
|
-
* note: this comment is used by rdoc.
|
|
41
|
-
*/
|
|
42
|
-
VALUE opencv = rb_module_opencv();
|
|
43
|
-
|
|
44
|
-
rb_klass = rb_define_class_under(opencv, "CvTermCriteria", rb_cObject);
|
|
45
|
-
/* CvTermCriteria: class */
|
|
46
|
-
rb_define_const(opencv, "CvTerm", rb_klass);
|
|
47
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
48
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
49
|
-
rb_define_method(rb_klass, "type", RUBY_METHOD_FUNC(rb_type), 0);
|
|
50
|
-
rb_define_method(rb_klass, "max", RUBY_METHOD_FUNC(rb_max), 0);
|
|
51
|
-
rb_define_method(rb_klass, "max=", RUBY_METHOD_FUNC(rb_set_max), 1);
|
|
52
|
-
rb_define_method(rb_klass, "eps", RUBY_METHOD_FUNC(rb_eps), 0);
|
|
53
|
-
rb_define_method(rb_klass, "eps=", RUBY_METHOD_FUNC(rb_set_eps), 1);
|
|
54
|
-
rb_define_alias(rb_klass, "epsilon", "eps");
|
|
55
|
-
rb_define_alias(rb_klass, "epsilon=", "eps=");
|
|
56
|
-
}
|
|
57
|
-
|
|
58
32
|
VALUE
|
|
59
33
|
rb_allocate(VALUE klass)
|
|
60
34
|
{
|
|
@@ -188,5 +162,37 @@ new_object(CvTermCriteria criteria)
|
|
|
188
162
|
return object;
|
|
189
163
|
}
|
|
190
164
|
|
|
165
|
+
void
|
|
166
|
+
init_ruby_class()
|
|
167
|
+
{
|
|
168
|
+
#if 0
|
|
169
|
+
// For documentation using YARD
|
|
170
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
171
|
+
#endif
|
|
172
|
+
|
|
173
|
+
if (rb_klass)
|
|
174
|
+
return;
|
|
175
|
+
/*
|
|
176
|
+
* opencv = rb_define_module("OpenCV");
|
|
177
|
+
*
|
|
178
|
+
* note: this comment is used by rdoc.
|
|
179
|
+
*/
|
|
180
|
+
VALUE opencv = rb_module_opencv();
|
|
181
|
+
|
|
182
|
+
rb_klass = rb_define_class_under(opencv, "CvTermCriteria", rb_cObject);
|
|
183
|
+
/* CvTermCriteria: class */
|
|
184
|
+
rb_define_const(opencv, "CvTerm", rb_klass);
|
|
185
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
186
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
187
|
+
rb_define_method(rb_klass, "type", RUBY_METHOD_FUNC(rb_type), 0);
|
|
188
|
+
rb_define_method(rb_klass, "max", RUBY_METHOD_FUNC(rb_max), 0);
|
|
189
|
+
rb_define_method(rb_klass, "max=", RUBY_METHOD_FUNC(rb_set_max), 1);
|
|
190
|
+
rb_define_method(rb_klass, "eps", RUBY_METHOD_FUNC(rb_eps), 0);
|
|
191
|
+
rb_define_method(rb_klass, "eps=", RUBY_METHOD_FUNC(rb_set_eps), 1);
|
|
192
|
+
rb_define_alias(rb_klass, "epsilon", "eps");
|
|
193
|
+
rb_define_alias(rb_klass, "epsilon=", "eps=");
|
|
194
|
+
}
|
|
195
|
+
|
|
191
196
|
__NAMESPACE_END_CVTERMCRITERIA
|
|
192
197
|
__NAMESPACE_END_OPENCV
|
|
198
|
+
|