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/cvmat.h
CHANGED
|
@@ -21,7 +21,7 @@ __NAMESPACE_BEGIN_CVMAT
|
|
|
21
21
|
|
|
22
22
|
VALUE rb_class();
|
|
23
23
|
|
|
24
|
-
void
|
|
24
|
+
void init_ruby_class();
|
|
25
25
|
|
|
26
26
|
VALUE rb_allocate(VALUE klass);
|
|
27
27
|
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
|
@@ -177,7 +177,7 @@ VALUE rb_warp_affine(int argc, VALUE *argv, VALUE self);
|
|
|
177
177
|
VALUE rb_rotation_matrix2D(VALUE self, VALUE center, VALUE angle, VALUE scale);
|
|
178
178
|
VALUE rb_get_perspective_transform(VALUE self, VALUE source, VALUE dest);
|
|
179
179
|
VALUE rb_warp_perspective(int argc, VALUE *argv, VALUE self);
|
|
180
|
-
VALUE
|
|
180
|
+
VALUE rb_find_homography(int argc, VALUE *argv, VALUE self);
|
|
181
181
|
VALUE rb_remap(int argc, VALUE *argv, VALUE self);
|
|
182
182
|
VALUE rb_log_polar(int argc, VALUE *argv, VALUE self);
|
|
183
183
|
|
|
@@ -221,7 +221,6 @@ VALUE rb_apply_color_map(VALUE self, VALUE colormap);
|
|
|
221
221
|
/* Matching*/
|
|
222
222
|
VALUE rb_match_template(int argc, VALUE *argv, VALUE self);
|
|
223
223
|
VALUE rb_match_shapes(int argc, VALUE *argv, VALUE self);
|
|
224
|
-
VALUE rb_match_descriptors(int argc, VALUE *argv, VALUE self);
|
|
225
224
|
|
|
226
225
|
/* Object Tracking */
|
|
227
226
|
VALUE rb_mean_shift(VALUE self, VALUE window, VALUE criteria);
|
data/ext/opencv/cvmemstorage.cpp
CHANGED
|
@@ -24,20 +24,6 @@ rb_class()
|
|
|
24
24
|
return rb_klass;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
void
|
|
28
|
-
define_ruby_class()
|
|
29
|
-
{
|
|
30
|
-
if (rb_klass)
|
|
31
|
-
return;
|
|
32
|
-
/*
|
|
33
|
-
* opencv = rb_define_module("OpenCV");
|
|
34
|
-
*
|
|
35
|
-
* note: this comment is used by rdoc.
|
|
36
|
-
*/
|
|
37
|
-
VALUE opencv = rb_module_opencv();
|
|
38
|
-
rb_klass = rb_define_class_under(opencv, "CvMemStorage", rb_cObject);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
27
|
VALUE
|
|
42
28
|
rb_allocate(VALUE klass)
|
|
43
29
|
{
|
|
@@ -63,6 +49,25 @@ new_object(int blocksize)
|
|
|
63
49
|
return Data_Wrap_Struct(rb_klass, 0, cvmemstorage_free, storage);
|
|
64
50
|
}
|
|
65
51
|
|
|
52
|
+
void
|
|
53
|
+
init_ruby_class()
|
|
54
|
+
{
|
|
55
|
+
#if 0
|
|
56
|
+
// For documentation using YARD
|
|
57
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
if (rb_klass)
|
|
61
|
+
return;
|
|
62
|
+
/*
|
|
63
|
+
* opencv = rb_define_module("OpenCV");
|
|
64
|
+
*
|
|
65
|
+
* note: this comment is used by rdoc.
|
|
66
|
+
*/
|
|
67
|
+
VALUE opencv = rb_module_opencv();
|
|
68
|
+
rb_klass = rb_define_class_under(opencv, "CvMemStorage", rb_cObject);
|
|
69
|
+
}
|
|
66
70
|
|
|
67
71
|
__NAMESPACE_END_CVMEMSTORAGE
|
|
68
72
|
__NAMESPACE_END_OPENCV
|
|
73
|
+
|
data/ext/opencv/cvmemstorage.h
CHANGED
data/ext/opencv/cvmoments.cpp
CHANGED
|
@@ -30,50 +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
|
-
|
|
45
|
-
rb_klass = rb_define_class_under(opencv, "CvMoments", rb_cObject);
|
|
46
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
47
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
48
|
-
rb_define_method(rb_klass, "spatial", RUBY_METHOD_FUNC(rb_spatial), 2);
|
|
49
|
-
rb_define_method(rb_klass, "central", RUBY_METHOD_FUNC(rb_central), 2);
|
|
50
|
-
rb_define_method(rb_klass, "normalized_central", RUBY_METHOD_FUNC(rb_normalized_central), 2);
|
|
51
|
-
rb_define_method(rb_klass, "hu", RUBY_METHOD_FUNC(rb_hu), 0);
|
|
52
|
-
rb_define_method(rb_klass, "gravity_center", RUBY_METHOD_FUNC(rb_gravity_center), 0);
|
|
53
|
-
rb_define_method(rb_klass, "angle", RUBY_METHOD_FUNC(rb_angle), 0);
|
|
54
|
-
|
|
55
|
-
DEFINE_CVMOMENTS_ACCESSOR(m00);
|
|
56
|
-
DEFINE_CVMOMENTS_ACCESSOR(m10);
|
|
57
|
-
DEFINE_CVMOMENTS_ACCESSOR(m01);
|
|
58
|
-
DEFINE_CVMOMENTS_ACCESSOR(m20);
|
|
59
|
-
DEFINE_CVMOMENTS_ACCESSOR(m11);
|
|
60
|
-
DEFINE_CVMOMENTS_ACCESSOR(m02);
|
|
61
|
-
DEFINE_CVMOMENTS_ACCESSOR(m30);
|
|
62
|
-
DEFINE_CVMOMENTS_ACCESSOR(m21);
|
|
63
|
-
DEFINE_CVMOMENTS_ACCESSOR(m12);
|
|
64
|
-
DEFINE_CVMOMENTS_ACCESSOR(m03);
|
|
65
|
-
|
|
66
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu20);
|
|
67
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu11);
|
|
68
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu02);
|
|
69
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu30);
|
|
70
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu21);
|
|
71
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu12);
|
|
72
|
-
DEFINE_CVMOMENTS_ACCESSOR(mu03);
|
|
73
|
-
|
|
74
|
-
DEFINE_CVMOMENTS_ACCESSOR(inv_sqrt_m00);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
33
|
VALUE
|
|
78
34
|
rb_allocate(VALUE klass)
|
|
79
35
|
{
|
|
@@ -82,7 +38,7 @@ rb_allocate(VALUE klass)
|
|
|
82
38
|
}
|
|
83
39
|
/*
|
|
84
40
|
* call-seq:
|
|
85
|
-
* CvMoments.new(
|
|
41
|
+
* CvMoments.new(src[,is_binary = nil])
|
|
86
42
|
*
|
|
87
43
|
* Calculates all moments up to third order of a polygon or rasterized shape.
|
|
88
44
|
* <i>src</i> should be CvMat or CvPolygon.
|
|
@@ -283,5 +239,55 @@ new_object(CvArr *arr, int is_binary = 0)
|
|
|
283
239
|
return object;
|
|
284
240
|
}
|
|
285
241
|
|
|
242
|
+
void
|
|
243
|
+
init_ruby_class()
|
|
244
|
+
{
|
|
245
|
+
#if 0
|
|
246
|
+
// For documentation using YARD
|
|
247
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
248
|
+
#endif
|
|
249
|
+
|
|
250
|
+
if (rb_klass)
|
|
251
|
+
return;
|
|
252
|
+
/*
|
|
253
|
+
* opencv = rb_define_module("OpenCV");
|
|
254
|
+
*
|
|
255
|
+
* note: this comment is used by rdoc.
|
|
256
|
+
*/
|
|
257
|
+
VALUE opencv = rb_module_opencv();
|
|
258
|
+
|
|
259
|
+
rb_klass = rb_define_class_under(opencv, "CvMoments", rb_cObject);
|
|
260
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
261
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
262
|
+
rb_define_method(rb_klass, "spatial", RUBY_METHOD_FUNC(rb_spatial), 2);
|
|
263
|
+
rb_define_method(rb_klass, "central", RUBY_METHOD_FUNC(rb_central), 2);
|
|
264
|
+
rb_define_method(rb_klass, "normalized_central", RUBY_METHOD_FUNC(rb_normalized_central), 2);
|
|
265
|
+
rb_define_method(rb_klass, "hu", RUBY_METHOD_FUNC(rb_hu), 0);
|
|
266
|
+
rb_define_method(rb_klass, "gravity_center", RUBY_METHOD_FUNC(rb_gravity_center), 0);
|
|
267
|
+
rb_define_method(rb_klass, "angle", RUBY_METHOD_FUNC(rb_angle), 0);
|
|
268
|
+
|
|
269
|
+
DEFINE_CVMOMENTS_ACCESSOR(m00);
|
|
270
|
+
DEFINE_CVMOMENTS_ACCESSOR(m10);
|
|
271
|
+
DEFINE_CVMOMENTS_ACCESSOR(m01);
|
|
272
|
+
DEFINE_CVMOMENTS_ACCESSOR(m20);
|
|
273
|
+
DEFINE_CVMOMENTS_ACCESSOR(m11);
|
|
274
|
+
DEFINE_CVMOMENTS_ACCESSOR(m02);
|
|
275
|
+
DEFINE_CVMOMENTS_ACCESSOR(m30);
|
|
276
|
+
DEFINE_CVMOMENTS_ACCESSOR(m21);
|
|
277
|
+
DEFINE_CVMOMENTS_ACCESSOR(m12);
|
|
278
|
+
DEFINE_CVMOMENTS_ACCESSOR(m03);
|
|
279
|
+
|
|
280
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu20);
|
|
281
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu11);
|
|
282
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu02);
|
|
283
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu30);
|
|
284
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu21);
|
|
285
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu12);
|
|
286
|
+
DEFINE_CVMOMENTS_ACCESSOR(mu03);
|
|
287
|
+
|
|
288
|
+
DEFINE_CVMOMENTS_ACCESSOR(inv_sqrt_m00);
|
|
289
|
+
}
|
|
290
|
+
|
|
286
291
|
__NAMESPACE_END_CVMOMENTS
|
|
287
292
|
__NAMESPACE_END_OPENCV
|
|
293
|
+
|
data/ext/opencv/cvmoments.h
CHANGED
data/ext/opencv/cvpoint.cpp
CHANGED
|
@@ -31,32 +31,6 @@ rb_class()
|
|
|
31
31
|
return rb_klass;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
void
|
|
35
|
-
define_ruby_class()
|
|
36
|
-
{
|
|
37
|
-
if (rb_klass)
|
|
38
|
-
return;
|
|
39
|
-
/*
|
|
40
|
-
* opencv = rb_define_module("OpenCV");
|
|
41
|
-
*
|
|
42
|
-
* note: this comment is used by rdoc.
|
|
43
|
-
*/
|
|
44
|
-
VALUE opencv = rb_module_opencv();
|
|
45
|
-
|
|
46
|
-
rb_klass = rb_define_class_under(opencv, "CvPoint", rb_cObject);
|
|
47
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
48
|
-
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
|
|
49
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
50
|
-
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
|
|
51
|
-
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
|
|
52
|
-
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
|
|
53
|
-
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
|
|
54
|
-
|
|
55
|
-
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
|
|
56
|
-
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
|
|
57
|
-
rb_define_alias(rb_klass, "to_a", "to_ary");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
34
|
/*
|
|
61
35
|
* call-seq:
|
|
62
36
|
* combatible?(obj)
|
|
@@ -224,5 +198,37 @@ new_object(CvPoint point)
|
|
|
224
198
|
return object;
|
|
225
199
|
}
|
|
226
200
|
|
|
201
|
+
void
|
|
202
|
+
init_ruby_class()
|
|
203
|
+
{
|
|
204
|
+
#if 0
|
|
205
|
+
// For documentation using YARD
|
|
206
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
207
|
+
#endif
|
|
208
|
+
|
|
209
|
+
if (rb_klass)
|
|
210
|
+
return;
|
|
211
|
+
/*
|
|
212
|
+
* opencv = rb_define_module("OpenCV");
|
|
213
|
+
*
|
|
214
|
+
* note: this comment is used by rdoc.
|
|
215
|
+
*/
|
|
216
|
+
VALUE opencv = rb_module_opencv();
|
|
217
|
+
|
|
218
|
+
rb_klass = rb_define_class_under(opencv, "CvPoint", rb_cObject);
|
|
219
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
220
|
+
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
|
|
221
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
222
|
+
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
|
|
223
|
+
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
|
|
224
|
+
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
|
|
225
|
+
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
|
|
226
|
+
|
|
227
|
+
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
|
|
228
|
+
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
|
|
229
|
+
rb_define_alias(rb_klass, "to_a", "to_ary");
|
|
230
|
+
}
|
|
231
|
+
|
|
227
232
|
__NAMESPACE_END_CVPOINT
|
|
228
233
|
__NAMESPACE_END_OPENCV
|
|
234
|
+
|
data/ext/opencv/cvpoint.h
CHANGED
data/ext/opencv/cvpoint2d32f.cpp
CHANGED
|
@@ -31,32 +31,6 @@ rb_class()
|
|
|
31
31
|
return rb_klass;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
void
|
|
35
|
-
define_ruby_class()
|
|
36
|
-
{
|
|
37
|
-
if (rb_klass)
|
|
38
|
-
return;
|
|
39
|
-
/*
|
|
40
|
-
* opencv = rb_define_module("OpenCV");
|
|
41
|
-
*
|
|
42
|
-
* note: this comment is used by rdoc.
|
|
43
|
-
*/
|
|
44
|
-
VALUE opencv = rb_module_opencv();
|
|
45
|
-
|
|
46
|
-
rb_klass = rb_define_class_under(opencv, "CvPoint2D32f", rb_cObject);
|
|
47
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
48
|
-
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
|
|
49
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
50
|
-
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
|
|
51
|
-
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
|
|
52
|
-
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
|
|
53
|
-
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
|
|
54
|
-
|
|
55
|
-
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
|
|
56
|
-
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
|
|
57
|
-
rb_define_alias(rb_klass, "to_a", "to_ary");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
34
|
/*
|
|
61
35
|
* call-seq:
|
|
62
36
|
* combatible?(obj)
|
|
@@ -207,5 +181,36 @@ new_object(CvPoint2D32f point)
|
|
|
207
181
|
return object;
|
|
208
182
|
}
|
|
209
183
|
|
|
184
|
+
void
|
|
185
|
+
init_ruby_class()
|
|
186
|
+
{
|
|
187
|
+
#if 0
|
|
188
|
+
// For documentation using YARD
|
|
189
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
190
|
+
#endif
|
|
191
|
+
|
|
192
|
+
if (rb_klass)
|
|
193
|
+
return;
|
|
194
|
+
/*
|
|
195
|
+
* opencv = rb_define_module("OpenCV");
|
|
196
|
+
*
|
|
197
|
+
* note: this comment is used by rdoc.
|
|
198
|
+
*/
|
|
199
|
+
VALUE opencv = rb_module_opencv();
|
|
200
|
+
|
|
201
|
+
rb_klass = rb_define_class_under(opencv, "CvPoint2D32f", rb_cObject);
|
|
202
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
203
|
+
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
|
|
204
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
205
|
+
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
|
|
206
|
+
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
|
|
207
|
+
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
|
|
208
|
+
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
|
|
209
|
+
|
|
210
|
+
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
|
|
211
|
+
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
|
|
212
|
+
rb_define_alias(rb_klass, "to_a", "to_ary");
|
|
213
|
+
}
|
|
214
|
+
|
|
210
215
|
__NAMESPACE_END_CVPOINT2D32F
|
|
211
216
|
__NAMESPACE_END_OPENCV
|
data/ext/opencv/cvpoint2d32f.h
CHANGED
data/ext/opencv/cvpoint3d32f.cpp
CHANGED
|
@@ -32,35 +32,6 @@ rb_class()
|
|
|
32
32
|
return rb_klass;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
void
|
|
36
|
-
define_ruby_class()
|
|
37
|
-
{
|
|
38
|
-
if (rb_klass)
|
|
39
|
-
return;
|
|
40
|
-
/*
|
|
41
|
-
* opencv = rb_define_module("OpenCV");
|
|
42
|
-
* cvpoint2d32f = rb_define_class_under(opencv, "CvPoint2D32f", rb_cObject);
|
|
43
|
-
*
|
|
44
|
-
* note: this comment is used by rdoc.
|
|
45
|
-
*/
|
|
46
|
-
VALUE opencv = rb_module_opencv();
|
|
47
|
-
VALUE cvpoint2d32f = cCvPoint2D32f::rb_class();
|
|
48
|
-
rb_klass = rb_define_class_under(opencv, "CvPoint3D32f", cvpoint2d32f);
|
|
49
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
50
|
-
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
|
|
51
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
52
|
-
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
|
|
53
|
-
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
|
|
54
|
-
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
|
|
55
|
-
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
|
|
56
|
-
rb_define_method(rb_klass, "z", RUBY_METHOD_FUNC(rb_z), 0);
|
|
57
|
-
rb_define_method(rb_klass, "z=", RUBY_METHOD_FUNC(rb_set_z), 1);
|
|
58
|
-
|
|
59
|
-
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
|
|
60
|
-
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
|
|
61
|
-
rb_define_alias(rb_klass, "to_a", "to_ary");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
35
|
/*
|
|
65
36
|
* call-seq:
|
|
66
37
|
* combatible?(obj)
|
|
@@ -241,5 +212,41 @@ new_object(CvPoint3D32f point)
|
|
|
241
212
|
return object;
|
|
242
213
|
}
|
|
243
214
|
|
|
215
|
+
void
|
|
216
|
+
init_ruby_class()
|
|
217
|
+
{
|
|
218
|
+
#if 0
|
|
219
|
+
// For documentation using YARD
|
|
220
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
221
|
+
VALUE cvpoint2d32f = rb_define_class_under(opencv, "CvPoint2D32f", rb_cObject);
|
|
222
|
+
#endif
|
|
223
|
+
|
|
224
|
+
if (rb_klass)
|
|
225
|
+
return;
|
|
226
|
+
/*
|
|
227
|
+
* opencv = rb_define_module("OpenCV");
|
|
228
|
+
* cvpoint2d32f = rb_define_class_under(opencv, "CvPoint2D32f", rb_cObject);
|
|
229
|
+
*
|
|
230
|
+
* note: this comment is used by rdoc.
|
|
231
|
+
*/
|
|
232
|
+
VALUE opencv = rb_module_opencv();
|
|
233
|
+
VALUE cvpoint2d32f = cCvPoint2D32f::rb_class();
|
|
234
|
+
rb_klass = rb_define_class_under(opencv, "CvPoint3D32f", cvpoint2d32f);
|
|
235
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
236
|
+
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
|
|
237
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
238
|
+
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
|
|
239
|
+
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
|
|
240
|
+
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
|
|
241
|
+
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
|
|
242
|
+
rb_define_method(rb_klass, "z", RUBY_METHOD_FUNC(rb_z), 0);
|
|
243
|
+
rb_define_method(rb_klass, "z=", RUBY_METHOD_FUNC(rb_set_z), 1);
|
|
244
|
+
|
|
245
|
+
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
|
|
246
|
+
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
|
|
247
|
+
rb_define_alias(rb_klass, "to_a", "to_ary");
|
|
248
|
+
}
|
|
249
|
+
|
|
244
250
|
__NAMESPACE_END_CVPOINT3D32F
|
|
245
251
|
__NAMESPACE_END_OPENCV
|
|
252
|
+
|