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/iplconvkernel.h
CHANGED
|
@@ -21,7 +21,7 @@ __NAMESPACE_BEGIN_IPLCONVKERNEL
|
|
|
21
21
|
VALUE rb_class();
|
|
22
22
|
VALUE rb_allocate(VALUE klass);
|
|
23
23
|
|
|
24
|
-
void
|
|
24
|
+
void init_ruby_class();
|
|
25
25
|
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
|
26
26
|
VALUE rb_size(VALUE self);
|
|
27
27
|
VALUE rb_cols(VALUE self);
|
data/ext/opencv/iplimage.cpp
CHANGED
|
@@ -33,40 +33,6 @@ rb_class()
|
|
|
33
33
|
return rb_klass;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
void
|
|
37
|
-
define_ruby_class()
|
|
38
|
-
{
|
|
39
|
-
if (rb_klass)
|
|
40
|
-
return;
|
|
41
|
-
/*
|
|
42
|
-
* opencv = rb_define_module("OpenCV");
|
|
43
|
-
* cvmat = rb_define_class_under(opencv, "CvMat", rb_cObject);
|
|
44
|
-
*
|
|
45
|
-
* note: this comment is used by rdoc.
|
|
46
|
-
*/
|
|
47
|
-
VALUE opencv = rb_module_opencv();
|
|
48
|
-
VALUE cvmat = cCvMat::rb_class();
|
|
49
|
-
rb_klass = rb_define_class_under(opencv, "IplImage", cvmat);
|
|
50
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
51
|
-
rb_define_singleton_method(rb_klass, "load", RUBY_METHOD_FUNC(rb_load_image), -1);
|
|
52
|
-
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
53
|
-
rb_define_method(rb_klass, "get_roi", RUBY_METHOD_FUNC(rb_get_roi), 0);
|
|
54
|
-
rb_define_alias(rb_klass, "roi", "get_roi");
|
|
55
|
-
rb_define_method(rb_klass, "set_roi", RUBY_METHOD_FUNC(rb_set_roi), 1);
|
|
56
|
-
rb_define_alias(rb_klass, "roi=", "set_roi");
|
|
57
|
-
rb_define_method(rb_klass, "reset_roi", RUBY_METHOD_FUNC(rb_reset_roi), 0);
|
|
58
|
-
rb_define_method(rb_klass, "get_coi", RUBY_METHOD_FUNC(rb_get_coi), 0);
|
|
59
|
-
rb_define_alias(rb_klass, "coi", "get_coi");
|
|
60
|
-
rb_define_method(rb_klass, "set_coi", RUBY_METHOD_FUNC(rb_set_coi), 1);
|
|
61
|
-
rb_define_alias(rb_klass, "coi=", "set_coi");
|
|
62
|
-
rb_define_method(rb_klass, "reset_coi", RUBY_METHOD_FUNC(rb_reset_coi), 0);
|
|
63
|
-
rb_define_method(rb_klass, "pyr_segmentation", RUBY_METHOD_FUNC(rb_pyr_segmentation), 3);
|
|
64
|
-
rb_define_method(rb_klass, "smoothness", RUBY_METHOD_FUNC(rb_smoothness), -1);
|
|
65
|
-
|
|
66
|
-
rb_define_singleton_method(rb_klass, "decode_image", RUBY_METHOD_FUNC(rb_decode_image), -1);
|
|
67
|
-
rb_define_alias(rb_singleton_class(rb_klass), "decode", "decode_image");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
36
|
VALUE
|
|
71
37
|
rb_allocate(VALUE klass)
|
|
72
38
|
{
|
|
@@ -75,7 +41,7 @@ rb_allocate(VALUE klass)
|
|
|
75
41
|
|
|
76
42
|
/*
|
|
77
43
|
* call-seq:
|
|
78
|
-
* new(
|
|
44
|
+
* new(width, height[, depth = CV_8U][, channel = 3])
|
|
79
45
|
*
|
|
80
46
|
* Create width * height image. Each element-value set 0.
|
|
81
47
|
*
|
|
@@ -99,7 +65,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
|
|
|
99
65
|
|
|
100
66
|
/*
|
|
101
67
|
* call-seq:
|
|
102
|
-
* IplImage::load(
|
|
68
|
+
* IplImage::load(filename[,iscolor = CV_LOAD_IMAGE_COLOR])
|
|
103
69
|
*
|
|
104
70
|
* Load an image from file.
|
|
105
71
|
* iscolor = CV_LOAD_IMAGE_COLOR, the loaded image is forced to be a 3-channel color image
|
|
@@ -183,8 +149,8 @@ rb_get_roi(VALUE self)
|
|
|
183
149
|
|
|
184
150
|
/*
|
|
185
151
|
* call-seq:
|
|
186
|
-
* set_roi(
|
|
187
|
-
* set_roi(
|
|
152
|
+
* set_roi(rect)
|
|
153
|
+
* set_roi(rect){|image| ...}
|
|
188
154
|
*
|
|
189
155
|
* Set ROI. <i>rect</i> should be CvRect or compatible object.
|
|
190
156
|
* Return self.
|
|
@@ -244,8 +210,8 @@ rb_get_coi(VALUE self)
|
|
|
244
210
|
|
|
245
211
|
/*
|
|
246
212
|
* call-seq:
|
|
247
|
-
* set_coi(
|
|
248
|
-
* set_coi(
|
|
213
|
+
* set_coi(coi)
|
|
214
|
+
* set_coi(coi){|image| ...}
|
|
249
215
|
*
|
|
250
216
|
* Set COI. <i>coi</i> should be Fixnum.
|
|
251
217
|
* Return self.
|
|
@@ -288,7 +254,7 @@ rb_reset_coi(VALUE self)
|
|
|
288
254
|
|
|
289
255
|
/*
|
|
290
256
|
* call-seq:
|
|
291
|
-
* IplImage.smoothness(
|
|
257
|
+
* IplImage.smoothness(lowFreqRatio, blankDensity, messyDensity, highFreqRatio) -> [ symbol, float, float ]
|
|
292
258
|
*
|
|
293
259
|
* Determines if the image's smoothness is either, :smooth, :messy, or :blank.
|
|
294
260
|
*
|
|
@@ -593,7 +559,7 @@ high_pass_range(const IplImage *pImage, float lostPercentage, int &outLow, int &
|
|
|
593
559
|
|
|
594
560
|
/*
|
|
595
561
|
* call-seq:
|
|
596
|
-
* pyr_segmentation(
|
|
562
|
+
* pyr_segmentation(level, threshold1, threshold2) -> [iplimage, cvseq(include cvconnectedcomp)]
|
|
597
563
|
*
|
|
598
564
|
* Does image segmentation by pyramids.
|
|
599
565
|
* The pyramid builds up to the level <i>level<i>.
|
|
@@ -640,5 +606,46 @@ new_object(CvSize size, int type)
|
|
|
640
606
|
return OPENCV_OBJECT(rb_klass, rb_cvCreateImage(size, cvIplDepth(type), CV_MAT_CN(type)));
|
|
641
607
|
}
|
|
642
608
|
|
|
609
|
+
void
|
|
610
|
+
init_ruby_class()
|
|
611
|
+
{
|
|
612
|
+
#if 0
|
|
613
|
+
// For documentation using YARD
|
|
614
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
615
|
+
VALUE cvmat = rb_define_class_under(opencv, "CvMat", rb_cObject);
|
|
616
|
+
#endif
|
|
617
|
+
|
|
618
|
+
if (rb_klass)
|
|
619
|
+
return;
|
|
620
|
+
/*
|
|
621
|
+
* opencv = rb_define_module("OpenCV");
|
|
622
|
+
* cvmat = rb_define_class_under(opencv, "CvMat", rb_cObject);
|
|
623
|
+
*
|
|
624
|
+
* note: this comment is used by rdoc.
|
|
625
|
+
*/
|
|
626
|
+
VALUE opencv = rb_module_opencv();
|
|
627
|
+
VALUE cvmat = cCvMat::rb_class();
|
|
628
|
+
rb_klass = rb_define_class_under(opencv, "IplImage", cvmat);
|
|
629
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
630
|
+
rb_define_singleton_method(rb_klass, "load", RUBY_METHOD_FUNC(rb_load_image), -1);
|
|
631
|
+
rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
632
|
+
rb_define_method(rb_klass, "get_roi", RUBY_METHOD_FUNC(rb_get_roi), 0);
|
|
633
|
+
rb_define_alias(rb_klass, "roi", "get_roi");
|
|
634
|
+
rb_define_method(rb_klass, "set_roi", RUBY_METHOD_FUNC(rb_set_roi), 1);
|
|
635
|
+
rb_define_alias(rb_klass, "roi=", "set_roi");
|
|
636
|
+
rb_define_method(rb_klass, "reset_roi", RUBY_METHOD_FUNC(rb_reset_roi), 0);
|
|
637
|
+
rb_define_method(rb_klass, "get_coi", RUBY_METHOD_FUNC(rb_get_coi), 0);
|
|
638
|
+
rb_define_alias(rb_klass, "coi", "get_coi");
|
|
639
|
+
rb_define_method(rb_klass, "set_coi", RUBY_METHOD_FUNC(rb_set_coi), 1);
|
|
640
|
+
rb_define_alias(rb_klass, "coi=", "set_coi");
|
|
641
|
+
rb_define_method(rb_klass, "reset_coi", RUBY_METHOD_FUNC(rb_reset_coi), 0);
|
|
642
|
+
rb_define_method(rb_klass, "pyr_segmentation", RUBY_METHOD_FUNC(rb_pyr_segmentation), 3);
|
|
643
|
+
rb_define_method(rb_klass, "smoothness", RUBY_METHOD_FUNC(rb_smoothness), -1);
|
|
644
|
+
|
|
645
|
+
rb_define_singleton_method(rb_klass, "decode_image", RUBY_METHOD_FUNC(rb_decode_image), -1);
|
|
646
|
+
rb_define_alias(rb_singleton_class(rb_klass), "decode", "decode_image");
|
|
647
|
+
}
|
|
648
|
+
|
|
643
649
|
__NAMESPACE_END_IPLIMAGE
|
|
644
650
|
__NAMESPACE_END_OPENCV
|
|
651
|
+
|
data/ext/opencv/iplimage.h
CHANGED
data/ext/opencv/lbph.cpp
CHANGED
|
@@ -50,8 +50,15 @@ rb_initialize(int argc, VALUE argv[], VALUE self)
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
void
|
|
53
|
-
|
|
53
|
+
init_ruby_class()
|
|
54
54
|
{
|
|
55
|
+
#if 0
|
|
56
|
+
// For documentation using YARD
|
|
57
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
58
|
+
VALUE alghorithm = rb_define_class_under(opencv, "Algorithm", rb_cObject);
|
|
59
|
+
VALUE face_recognizer = rb_define_class_under(opencv, "FaceRecognizer", alghorithm);
|
|
60
|
+
#endif
|
|
61
|
+
|
|
55
62
|
if (rb_klass)
|
|
56
63
|
return;
|
|
57
64
|
/*
|
|
@@ -60,7 +67,8 @@ define_ruby_class()
|
|
|
60
67
|
* note: this comment is used by rdoc.
|
|
61
68
|
*/
|
|
62
69
|
VALUE opencv = rb_module_opencv();
|
|
63
|
-
|
|
70
|
+
VALUE face_recognizer = cFaceRecognizer::rb_class();
|
|
71
|
+
rb_klass = rb_define_class_under(opencv, "LBPH", face_recognizer);
|
|
64
72
|
rb_define_alloc_func(rb_klass, cFaceRecognizer::allocate_facerecognizer);
|
|
65
73
|
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
66
74
|
}
|
data/ext/opencv/lbph.h
CHANGED
data/ext/opencv/mouseevent.cpp
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
* Document-module: OpenCV::GUI::MouseEvent
|
|
13
13
|
*
|
|
14
14
|
* MouseEvent object.
|
|
15
|
-
* have
|
|
16
|
-
* see OpenCV::GUI::Window#set_mouse_callback.
|
|
17
15
|
*/
|
|
18
16
|
__NAMESPACE_BEGIN_OPENCV
|
|
19
17
|
__NAMESPACE_BEGIN_GUI
|
|
@@ -27,29 +25,6 @@ rb_class()
|
|
|
27
25
|
return rb_klass;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
void
|
|
31
|
-
define_ruby_class()
|
|
32
|
-
{
|
|
33
|
-
if (rb_klass)
|
|
34
|
-
return;
|
|
35
|
-
/*
|
|
36
|
-
* opencv = rb_define_module("OpenCV");
|
|
37
|
-
* GUI = rb_define_module_under(opencv, "GUI");
|
|
38
|
-
* cvpoint = rb_define_class_under(opencv, "CvPoint", rb_cObject);
|
|
39
|
-
*/
|
|
40
|
-
VALUE GUI = rb_module_GUI();
|
|
41
|
-
VALUE cvpoint = cCvPoint::rb_class();
|
|
42
|
-
rb_klass = rb_define_class_under(GUI, "MouseEvent", cvpoint);
|
|
43
|
-
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
44
|
-
rb_define_method(rb_klass, "event", RUBY_METHOD_FUNC(rb_event), 0);
|
|
45
|
-
rb_define_method(rb_klass, "left_button?", RUBY_METHOD_FUNC(rb_left_button_q), 0);
|
|
46
|
-
rb_define_method(rb_klass, "right_button?", RUBY_METHOD_FUNC(rb_right_button_q), 0);
|
|
47
|
-
rb_define_method(rb_klass, "middle_button?", RUBY_METHOD_FUNC(rb_middle_button_q), 0);
|
|
48
|
-
rb_define_method(rb_klass, "ctrl_key?", RUBY_METHOD_FUNC(rb_ctrl_key_q), 0);
|
|
49
|
-
rb_define_method(rb_klass, "shift_key?", RUBY_METHOD_FUNC(rb_shift_key_q), 0);
|
|
50
|
-
rb_define_method(rb_klass, "alt_key?", RUBY_METHOD_FUNC(rb_alt_key_q), 0);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
28
|
VALUE
|
|
54
29
|
rb_allocate(VALUE klass)
|
|
55
30
|
{
|
|
@@ -175,6 +150,36 @@ new_object(int event, int x, int y, int flags)
|
|
|
175
150
|
return object;
|
|
176
151
|
}
|
|
177
152
|
|
|
153
|
+
void
|
|
154
|
+
init_ruby_class()
|
|
155
|
+
{
|
|
156
|
+
#if 0
|
|
157
|
+
// For documentation using YARD
|
|
158
|
+
VALUE opencv = rb_define_module("OpenCV");
|
|
159
|
+
VALUE GUI = rb_define_module_under(opencv, "GUI");
|
|
160
|
+
VALUE cvpoint = rb_define_class_under(opencv, "CvPoint", rb_cObject);
|
|
161
|
+
#endif
|
|
162
|
+
|
|
163
|
+
if (rb_klass)
|
|
164
|
+
return;
|
|
165
|
+
/*
|
|
166
|
+
* opencv = rb_define_module("OpenCV");
|
|
167
|
+
* GUI = rb_define_module_under(opencv, "GUI");
|
|
168
|
+
* cvpoint = rb_define_class_under(opencv, "CvPoint", rb_cObject);
|
|
169
|
+
*/
|
|
170
|
+
VALUE GUI = rb_module_GUI();
|
|
171
|
+
VALUE cvpoint = cCvPoint::rb_class();
|
|
172
|
+
rb_klass = rb_define_class_under(GUI, "MouseEvent", cvpoint);
|
|
173
|
+
rb_define_alloc_func(rb_klass, rb_allocate);
|
|
174
|
+
rb_define_method(rb_klass, "event", RUBY_METHOD_FUNC(rb_event), 0);
|
|
175
|
+
rb_define_method(rb_klass, "left_button?", RUBY_METHOD_FUNC(rb_left_button_q), 0);
|
|
176
|
+
rb_define_method(rb_klass, "right_button?", RUBY_METHOD_FUNC(rb_right_button_q), 0);
|
|
177
|
+
rb_define_method(rb_klass, "middle_button?", RUBY_METHOD_FUNC(rb_middle_button_q), 0);
|
|
178
|
+
rb_define_method(rb_klass, "ctrl_key?", RUBY_METHOD_FUNC(rb_ctrl_key_q), 0);
|
|
179
|
+
rb_define_method(rb_klass, "shift_key?", RUBY_METHOD_FUNC(rb_shift_key_q), 0);
|
|
180
|
+
rb_define_method(rb_klass, "alt_key?", RUBY_METHOD_FUNC(rb_alt_key_q), 0);
|
|
181
|
+
}
|
|
182
|
+
|
|
178
183
|
__NAMESPACE_END_MOUSEEVENT
|
|
179
184
|
__NAMESPACE_END_GUI
|
|
180
185
|
__NAMESPACE_END_OPENCV
|
data/ext/opencv/mouseevent.h
CHANGED
data/ext/opencv/opencv.cpp
CHANGED
|
@@ -154,7 +154,7 @@ rb_module_opencv()
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
void
|
|
157
|
-
|
|
157
|
+
init_ruby_module()
|
|
158
158
|
{
|
|
159
159
|
if (rb_module)
|
|
160
160
|
return;
|
|
@@ -320,6 +320,8 @@ define_ruby_module()
|
|
|
320
320
|
|
|
321
321
|
/* Flags of window */
|
|
322
322
|
rb_define_const(rb_module, "CV_WINDOW_AUTOSIZE", INT2FIX(CV_WINDOW_AUTOSIZE));
|
|
323
|
+
rb_define_const(rb_module, "CV_WINDOW_NORMAL", INT2FIX(CV_WINDOW_NORMAL));
|
|
324
|
+
rb_define_const(rb_module, "CV_WINDOW_OPENGL", INT2FIX(CV_WINDOW_OPENGL));
|
|
323
325
|
|
|
324
326
|
/* Object detection mode */
|
|
325
327
|
rb_define_const(rb_module, "CV_HAAR_DO_CANNY_PRUNING", INT2FIX(CV_HAAR_DO_CANNY_PRUNING));
|
|
@@ -705,70 +707,67 @@ extern "C" {
|
|
|
705
707
|
{
|
|
706
708
|
cvRedirectError((CvErrorCallback)mOpenCV::error_callback);
|
|
707
709
|
|
|
708
|
-
mOpenCV::
|
|
710
|
+
mOpenCV::init_ruby_module();
|
|
709
711
|
|
|
710
|
-
mOpenCV::cCvError::
|
|
711
|
-
mOpenCV::cCvPoint::
|
|
712
|
-
mOpenCV::cCvPoint2D32f::
|
|
713
|
-
mOpenCV::cCvPoint3D32f::
|
|
714
|
-
mOpenCV::cCvSize::
|
|
715
|
-
mOpenCV::cCvSize2D32f::
|
|
716
|
-
mOpenCV::cCvRect::
|
|
717
|
-
mOpenCV::cCvScalar::
|
|
718
|
-
mOpenCV::cCvSlice::
|
|
719
|
-
mOpenCV::cCvTermCriteria::
|
|
720
|
-
mOpenCV::cCvBox2D::
|
|
721
|
-
mOpenCV::cCvFont::
|
|
722
|
-
mOpenCV::cIplConvKernel::
|
|
723
|
-
mOpenCV::cCvMoments::
|
|
724
|
-
mOpenCV::cCvHuMoments::
|
|
725
|
-
mOpenCV::cCvConvexityDefect::
|
|
726
|
-
|
|
727
|
-
mOpenCV::cCvSURFPoint::
|
|
728
|
-
mOpenCV::cCvSURFParams::
|
|
712
|
+
mOpenCV::cCvError::init_ruby_class();
|
|
713
|
+
mOpenCV::cCvPoint::init_ruby_class();
|
|
714
|
+
mOpenCV::cCvPoint2D32f::init_ruby_class();
|
|
715
|
+
mOpenCV::cCvPoint3D32f::init_ruby_class();
|
|
716
|
+
mOpenCV::cCvSize::init_ruby_class();
|
|
717
|
+
mOpenCV::cCvSize2D32f::init_ruby_class();
|
|
718
|
+
mOpenCV::cCvRect::init_ruby_class();
|
|
719
|
+
mOpenCV::cCvScalar::init_ruby_class();
|
|
720
|
+
mOpenCV::cCvSlice::init_ruby_class();
|
|
721
|
+
mOpenCV::cCvTermCriteria::init_ruby_class();
|
|
722
|
+
mOpenCV::cCvBox2D::init_ruby_class();
|
|
723
|
+
mOpenCV::cCvFont::init_ruby_class();
|
|
724
|
+
mOpenCV::cIplConvKernel::init_ruby_class();
|
|
725
|
+
mOpenCV::cCvMoments::init_ruby_class();
|
|
726
|
+
mOpenCV::cCvHuMoments::init_ruby_class();
|
|
727
|
+
mOpenCV::cCvConvexityDefect::init_ruby_class();
|
|
728
|
+
|
|
729
|
+
mOpenCV::cCvSURFPoint::init_ruby_class();
|
|
730
|
+
mOpenCV::cCvSURFParams::init_ruby_class();
|
|
729
731
|
|
|
730
|
-
mOpenCV::cCvMemStorage::
|
|
731
|
-
|
|
732
|
-
mOpenCV::cCvSeq::
|
|
733
|
-
mOpenCV::mCurve::
|
|
734
|
-
mOpenCV::mPointSet::
|
|
735
|
-
mOpenCV::cCvChain::
|
|
736
|
-
mOpenCV::cCvContour::
|
|
737
|
-
mOpenCV::cCvContourTree::
|
|
738
|
-
|
|
739
|
-
mOpenCV::cCvMat::
|
|
740
|
-
mOpenCV::cIplImage::
|
|
741
|
-
mOpenCV::
|
|
742
|
-
mOpenCV::
|
|
743
|
-
mOpenCV::
|
|
744
|
-
|
|
745
|
-
mOpenCV::
|
|
746
|
-
|
|
747
|
-
mOpenCV::
|
|
748
|
-
|
|
749
|
-
mOpenCV::
|
|
750
|
-
|
|
751
|
-
mOpenCV::
|
|
752
|
-
mOpenCV::
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
mOpenCV::
|
|
756
|
-
mOpenCV::
|
|
757
|
-
|
|
758
|
-
mOpenCV::
|
|
759
|
-
mOpenCV::
|
|
760
|
-
|
|
761
|
-
mOpenCV::
|
|
762
|
-
mOpenCV::
|
|
763
|
-
|
|
764
|
-
mOpenCV::mGUI::
|
|
765
|
-
mOpenCV::mGUI::cWindow::define_ruby_class();
|
|
766
|
-
mOpenCV::mGUI::cTrackbar::define_ruby_class();
|
|
767
|
-
mOpenCV::mGUI::cMouseEvent::define_ruby_class();
|
|
732
|
+
mOpenCV::cCvMemStorage::init_ruby_class();
|
|
733
|
+
|
|
734
|
+
mOpenCV::cCvSeq::init_ruby_class();
|
|
735
|
+
mOpenCV::mCurve::init_ruby_module();
|
|
736
|
+
mOpenCV::mPointSet::init_ruby_module();
|
|
737
|
+
mOpenCV::cCvChain::init_ruby_class();
|
|
738
|
+
mOpenCV::cCvContour::init_ruby_class();
|
|
739
|
+
mOpenCV::cCvContourTree::init_ruby_class();
|
|
740
|
+
|
|
741
|
+
mOpenCV::cCvMat::init_ruby_class();
|
|
742
|
+
mOpenCV::cIplImage::init_ruby_class();
|
|
743
|
+
mOpenCV::cCvHistogram::init_ruby_class();
|
|
744
|
+
mOpenCV::cCvCapture::init_ruby_class();
|
|
745
|
+
mOpenCV::cCvVideoWriter::init_ruby_class();
|
|
746
|
+
|
|
747
|
+
mOpenCV::cCvLine::init_ruby_class();
|
|
748
|
+
mOpenCV::cCvTwoPoints::init_ruby_class();
|
|
749
|
+
mOpenCV::cCvCircle32f::init_ruby_class();
|
|
750
|
+
|
|
751
|
+
mOpenCV::cCvFeatureTree::init_ruby_class();
|
|
752
|
+
|
|
753
|
+
mOpenCV::cCvConnectedComp::init_ruby_class();
|
|
754
|
+
mOpenCV::cCvAvgComp::init_ruby_class();
|
|
755
|
+
mOpenCV::cCvHaarClassifierCascade::init_ruby_class();
|
|
756
|
+
|
|
757
|
+
mOpenCV::cAlgorithm::init_ruby_class();
|
|
758
|
+
mOpenCV::cFaceRecognizer::init_ruby_class();
|
|
759
|
+
mOpenCV::cEigenFaces::init_ruby_class();
|
|
760
|
+
mOpenCV::cFisherFaces::init_ruby_class();
|
|
761
|
+
mOpenCV::cLBPH::init_ruby_class();
|
|
762
|
+
|
|
763
|
+
mOpenCV::mGUI::init_ruby_module();
|
|
764
|
+
mOpenCV::mGUI::cWindow::init_ruby_class();
|
|
765
|
+
mOpenCV::mGUI::cTrackbar::init_ruby_class();
|
|
766
|
+
mOpenCV::mGUI::cMouseEvent::init_ruby_class();
|
|
768
767
|
|
|
769
768
|
#ifdef HAVE_ML_H
|
|
770
769
|
/* feature support.
|
|
771
|
-
mOpenCV::mMachineLearning::
|
|
770
|
+
mOpenCV::mMachineLearning::init_ruby_module();
|
|
772
771
|
*/
|
|
773
772
|
#endif
|
|
774
773
|
|
data/ext/opencv/opencv.h
CHANGED
|
@@ -109,8 +109,6 @@ extern "C" {
|
|
|
109
109
|
|
|
110
110
|
#include "cvmat.h"
|
|
111
111
|
#include "iplimage.h"
|
|
112
|
-
#include "cvmatnd.h"
|
|
113
|
-
#include "cvsparsemat.h"
|
|
114
112
|
#include "cvhistogram.h"
|
|
115
113
|
#include "cvcapture.h"
|
|
116
114
|
#include "cvvideowriter.h"
|
|
@@ -119,8 +117,6 @@ extern "C" {
|
|
|
119
117
|
#include "cvtwopoints.h"
|
|
120
118
|
#include "cvcircle32f.h"
|
|
121
119
|
|
|
122
|
-
#include "cvcondensation.h"
|
|
123
|
-
|
|
124
120
|
#include "cvconnectedcomp.h"
|
|
125
121
|
#include "cvavgcomp.h"
|
|
126
122
|
#include "cvhaarclassifiercascade.h"
|
|
@@ -200,7 +196,7 @@ void release_object(void *ptr);
|
|
|
200
196
|
void release_iplconvkernel_object(void *ptr);
|
|
201
197
|
|
|
202
198
|
VALUE rb_module_opencv();
|
|
203
|
-
void
|
|
199
|
+
void init_ruby_module();
|
|
204
200
|
|
|
205
201
|
// Ruby/OpenCV inline functions
|
|
206
202
|
inline CvArr*
|