ruby-opencv 0.0.8-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +25 -0
- data/DEVELOPERS_NOTE.md +120 -0
- data/Gemfile +9 -0
- data/History.txt +5 -0
- data/License.txt +30 -0
- data/Manifest.txt +226 -0
- data/README.md +98 -0
- data/Rakefile +32 -0
- data/examples/alpha_blend.rb +21 -0
- data/examples/box.png +0 -0
- data/examples/box_in_scene.png +0 -0
- data/examples/contours/bitmap-contours-with-labels.png +0 -0
- data/examples/contours/bitmap-contours.png +0 -0
- data/examples/contours/bounding-box-detect-canny.rb +62 -0
- data/examples/contours/contour_retrieval_modes.rb +139 -0
- data/examples/contours/rotated-boxes.jpg +0 -0
- data/examples/convexhull.rb +47 -0
- data/examples/face_detect.rb +20 -0
- data/examples/find_obj.rb +169 -0
- data/examples/houghcircle.rb +22 -0
- data/examples/inpaint.png +0 -0
- data/examples/inpaint.rb +57 -0
- data/examples/lenna-rotated.jpg +0 -0
- data/examples/lenna.jpg +0 -0
- data/examples/match_kdtree.rb +88 -0
- data/examples/matching_to_many_images.rb +16 -0
- 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 +3 -0
- data/examples/paint.rb +70 -0
- data/examples/snake.rb +43 -0
- data/examples/stuff.jpg +0 -0
- data/examples/tiffany.jpg +0 -0
- data/ext/opencv/curve.cpp +112 -0
- data/ext/opencv/curve.h +34 -0
- data/ext/opencv/cvavgcomp.cpp +67 -0
- data/ext/opencv/cvavgcomp.h +39 -0
- data/ext/opencv/cvbox2d.cpp +197 -0
- data/ext/opencv/cvbox2d.h +61 -0
- data/ext/opencv/cvcapture.cpp +499 -0
- data/ext/opencv/cvcapture.h +72 -0
- data/ext/opencv/cvchain.cpp +233 -0
- data/ext/opencv/cvchain.h +46 -0
- data/ext/opencv/cvcircle32f.cpp +116 -0
- data/ext/opencv/cvcircle32f.h +52 -0
- data/ext/opencv/cvcondensation.cpp +282 -0
- data/ext/opencv/cvcondensation.h +49 -0
- data/ext/opencv/cvconnectedcomp.cpp +143 -0
- data/ext/opencv/cvconnectedcomp.h +49 -0
- data/ext/opencv/cvcontour.cpp +296 -0
- data/ext/opencv/cvcontour.h +48 -0
- data/ext/opencv/cvcontourtree.cpp +91 -0
- data/ext/opencv/cvcontourtree.h +41 -0
- data/ext/opencv/cvconvexitydefect.cpp +103 -0
- data/ext/opencv/cvconvexitydefect.h +42 -0
- data/ext/opencv/cverror.cpp +159 -0
- data/ext/opencv/cverror.h +28 -0
- data/ext/opencv/cvfeaturetree.cpp +125 -0
- data/ext/opencv/cvfeaturetree.h +55 -0
- data/ext/opencv/cvfont.cpp +208 -0
- data/ext/opencv/cvfont.h +64 -0
- data/ext/opencv/cvhaarclassifiercascade.cpp +168 -0
- data/ext/opencv/cvhaarclassifiercascade.h +39 -0
- data/ext/opencv/cvhistogram.cpp +546 -0
- data/ext/opencv/cvhistogram.h +73 -0
- data/ext/opencv/cvhumoments.cpp +139 -0
- data/ext/opencv/cvhumoments.h +51 -0
- data/ext/opencv/cvline.cpp +154 -0
- data/ext/opencv/cvline.h +54 -0
- data/ext/opencv/cvmat.cpp +5848 -0
- data/ext/opencv/cvmat.h +284 -0
- data/ext/opencv/cvmatnd.cpp +44 -0
- data/ext/opencv/cvmatnd.h +28 -0
- data/ext/opencv/cvmemstorage.cpp +68 -0
- data/ext/opencv/cvmemstorage.h +53 -0
- data/ext/opencv/cvmoments.cpp +287 -0
- data/ext/opencv/cvmoments.h +75 -0
- data/ext/opencv/cvpoint.cpp +228 -0
- data/ext/opencv/cvpoint.h +64 -0
- data/ext/opencv/cvpoint2d32f.cpp +211 -0
- data/ext/opencv/cvpoint2d32f.h +63 -0
- data/ext/opencv/cvpoint3d32f.cpp +245 -0
- data/ext/opencv/cvpoint3d32f.h +66 -0
- data/ext/opencv/cvrect.cpp +333 -0
- data/ext/opencv/cvrect.h +79 -0
- data/ext/opencv/cvscalar.cpp +236 -0
- data/ext/opencv/cvscalar.h +71 -0
- data/ext/opencv/cvseq.cpp +599 -0
- data/ext/opencv/cvseq.h +74 -0
- data/ext/opencv/cvsize.cpp +221 -0
- data/ext/opencv/cvsize.h +65 -0
- data/ext/opencv/cvsize2d32f.cpp +209 -0
- data/ext/opencv/cvsize2d32f.h +64 -0
- data/ext/opencv/cvslice.cpp +120 -0
- data/ext/opencv/cvslice.h +61 -0
- data/ext/opencv/cvsparsemat.cpp +44 -0
- data/ext/opencv/cvsparsemat.h +28 -0
- data/ext/opencv/cvsurfparams.cpp +199 -0
- data/ext/opencv/cvsurfparams.h +58 -0
- data/ext/opencv/cvsurfpoint.cpp +223 -0
- data/ext/opencv/cvsurfpoint.h +52 -0
- data/ext/opencv/cvtermcriteria.cpp +192 -0
- data/ext/opencv/cvtermcriteria.h +71 -0
- data/ext/opencv/cvtwopoints.cpp +116 -0
- data/ext/opencv/cvtwopoints.h +51 -0
- data/ext/opencv/cvutils.cpp +194 -0
- data/ext/opencv/cvutils.h +29 -0
- data/ext/opencv/cvvideowriter.cpp +137 -0
- data/ext/opencv/cvvideowriter.h +43 -0
- data/ext/opencv/gui.cpp +68 -0
- data/ext/opencv/gui.h +30 -0
- data/ext/opencv/iplconvkernel.cpp +192 -0
- data/ext/opencv/iplconvkernel.h +71 -0
- data/ext/opencv/iplimage.cpp +644 -0
- data/ext/opencv/iplimage.h +73 -0
- data/ext/opencv/lib/opencv.rb +3 -0
- data/ext/opencv/lib/opencv/psyched_yaml.rb +22 -0
- data/ext/opencv/lib/opencv/version.rb +3 -0
- data/ext/opencv/mouseevent.cpp +181 -0
- data/ext/opencv/mouseevent.h +56 -0
- data/ext/opencv/opencv.cpp +722 -0
- data/ext/opencv/opencv.h +400 -0
- data/ext/opencv/pointset.cpp +274 -0
- data/ext/opencv/pointset.h +68 -0
- data/ext/opencv/trackbar.cpp +121 -0
- data/ext/opencv/trackbar.h +69 -0
- data/ext/opencv/window.cpp +357 -0
- data/ext/opencv/window.h +66 -0
- data/extconf.rb +75 -0
- data/images/CvMat_sobel.png +0 -0
- data/images/CvMat_sub_rect.png +0 -0
- data/images/CvSeq_relationmap.png +0 -0
- data/images/face_detect_from_lena.jpg +0 -0
- data/lib/opencv.rb +3 -0
- data/lib/opencv/psyched_yaml.rb +22 -0
- data/lib/opencv/version.rb +3 -0
- data/ruby-opencv.gemspec +43 -0
- data/test/helper.rb +166 -0
- data/test/runner.rb +30 -0
- data/test/samples/airplane.jpg +0 -0
- data/test/samples/baboon.jpg +0 -0
- data/test/samples/baboon200.jpg +0 -0
- data/test/samples/baboon200_rotated.jpg +0 -0
- data/test/samples/blank0.jpg +0 -0
- data/test/samples/blank1.jpg +0 -0
- data/test/samples/blank2.jpg +0 -0
- data/test/samples/blank3.jpg +0 -0
- data/test/samples/blank4.jpg +0 -0
- data/test/samples/blank5.jpg +0 -0
- data/test/samples/blank6.jpg +0 -0
- data/test/samples/blank7.jpg +0 -0
- data/test/samples/blank8.jpg +0 -0
- data/test/samples/blank9.jpg +0 -0
- data/test/samples/cat.jpg +0 -0
- data/test/samples/chessboard.jpg +0 -0
- data/test/samples/contours.jpg +0 -0
- data/test/samples/fruits.jpg +0 -0
- data/test/samples/haarcascade_frontalface_alt.xml.gz +0 -0
- data/test/samples/inpaint-mask.bmp +0 -0
- data/test/samples/lena-256x256.jpg +0 -0
- data/test/samples/lena-32x32.jpg +0 -0
- data/test/samples/lena-eyes.jpg +0 -0
- data/test/samples/lena-inpaint.jpg +0 -0
- data/test/samples/lena.jpg +0 -0
- data/test/samples/lines.jpg +0 -0
- data/test/samples/messy0.jpg +0 -0
- data/test/samples/messy1.jpg +0 -0
- data/test/samples/movie_sample.avi +0 -0
- data/test/samples/one_way_train_0000.jpg +0 -0
- data/test/samples/one_way_train_0001.jpg +0 -0
- data/test/samples/partially_blank0.jpg +0 -0
- data/test/samples/partially_blank1.jpg +0 -0
- data/test/samples/smooth0.jpg +0 -0
- data/test/samples/smooth1.jpg +0 -0
- data/test/samples/smooth2.jpg +0 -0
- data/test/samples/smooth3.jpg +0 -0
- data/test/samples/smooth4.jpg +0 -0
- data/test/samples/smooth5.jpg +0 -0
- data/test/samples/smooth6.jpg +0 -0
- data/test/samples/str-cv-rotated.jpg +0 -0
- data/test/samples/str-cv.jpg +0 -0
- data/test/samples/str-ov.jpg +0 -0
- data/test/samples/stuff.jpg +0 -0
- data/test/test_curve.rb +43 -0
- data/test/test_cvavgcomp.rb +24 -0
- data/test/test_cvbox2d.rb +76 -0
- data/test/test_cvcapture.rb +183 -0
- data/test/test_cvchain.rb +108 -0
- data/test/test_cvcircle32f.rb +41 -0
- data/test/test_cvconnectedcomp.rb +61 -0
- data/test/test_cvcontour.rb +150 -0
- data/test/test_cvcontourtree.rb +43 -0
- data/test/test_cverror.rb +50 -0
- data/test/test_cvfeaturetree.rb +65 -0
- data/test/test_cvfont.rb +58 -0
- data/test/test_cvhaarclassifiercascade.rb +63 -0
- data/test/test_cvhistogram.rb +271 -0
- data/test/test_cvhumoments.rb +83 -0
- data/test/test_cvline.rb +50 -0
- data/test/test_cvmat.rb +2947 -0
- data/test/test_cvmat_drawing.rb +349 -0
- data/test/test_cvmat_dxt.rb +150 -0
- data/test/test_cvmat_imageprocessing.rb +2025 -0
- data/test/test_cvmat_matching.rb +57 -0
- data/test/test_cvmoments.rb +180 -0
- data/test/test_cvpoint.rb +75 -0
- data/test/test_cvpoint2d32f.rb +75 -0
- data/test/test_cvpoint3d32f.rb +93 -0
- data/test/test_cvrect.rb +144 -0
- data/test/test_cvscalar.rb +113 -0
- data/test/test_cvseq.rb +295 -0
- data/test/test_cvsize.rb +75 -0
- data/test/test_cvsize2d32f.rb +75 -0
- data/test/test_cvslice.rb +31 -0
- data/test/test_cvsurfparams.rb +57 -0
- data/test/test_cvsurfpoint.rb +66 -0
- data/test/test_cvtermcriteria.rb +56 -0
- data/test/test_cvtwopoints.rb +40 -0
- data/test/test_cvvideowriter.rb +58 -0
- data/test/test_iplconvkernel.rb +54 -0
- data/test/test_iplimage.rb +236 -0
- data/test/test_mouseevent.rb +17 -0
- data/test/test_opencv.rb +324 -0
- data/test/test_pointset.rb +126 -0
- data/test/test_preliminary.rb +130 -0
- data/test/test_trackbar.rb +47 -0
- data/test/test_window.rb +115 -0
- metadata +414 -0
data/ext/opencv/cvmat.h
ADDED
@@ -0,0 +1,284 @@
|
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvmat.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005-2007 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVMAT_H
|
11
|
+
#define RUBY_OPENCV_CVMAT_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
|
16
|
+
#define __NAMESPACE_BEGIN_CVMAT namespace cCvMat {
|
17
|
+
#define __NAMESPACE_END_CVMAT }
|
18
|
+
|
19
|
+
__NAMESPACE_BEGIN_OPENCV
|
20
|
+
__NAMESPACE_BEGIN_CVMAT
|
21
|
+
|
22
|
+
VALUE rb_class();
|
23
|
+
|
24
|
+
void define_ruby_class();
|
25
|
+
|
26
|
+
VALUE rb_allocate(VALUE klass);
|
27
|
+
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
28
|
+
VALUE rb_load_imageM(int argc, VALUE *argv, VALUE self);
|
29
|
+
VALUE rb_encode_imageM(int argc, VALUE *argv, VALUE self);
|
30
|
+
VALUE rb_decode_imageM(int argc, VALUE *argv, VALUE self);
|
31
|
+
|
32
|
+
VALUE rb_method_missing(int argc, VALUE *argv, VALUE self);
|
33
|
+
VALUE rb_to_s(VALUE self);
|
34
|
+
VALUE rb_inside_q(VALUE self, VALUE object);
|
35
|
+
VALUE rb_to_IplConvKernel(VALUE self, VALUE anchor);
|
36
|
+
VALUE rb_create_mask(VALUE self);
|
37
|
+
|
38
|
+
VALUE rb_width(VALUE self);
|
39
|
+
VALUE rb_height(VALUE self);
|
40
|
+
VALUE rb_depth(VALUE self);
|
41
|
+
VALUE rb_channel(VALUE self);
|
42
|
+
VALUE rb_data(VALUE self);
|
43
|
+
|
44
|
+
VALUE rb_clone(VALUE self);
|
45
|
+
VALUE rb_copy(int argc, VALUE *argv, VALUE self);
|
46
|
+
VALUE copy(VALUE mat);
|
47
|
+
|
48
|
+
VALUE rb_to_8u(VALUE self);
|
49
|
+
VALUE rb_to_8s(VALUE self);
|
50
|
+
VALUE rb_to_16u(VALUE self);
|
51
|
+
VALUE rb_to_16s(VALUE self);
|
52
|
+
VALUE rb_to_32s(VALUE self);
|
53
|
+
VALUE rb_to_32f(VALUE self);
|
54
|
+
VALUE rb_to_64f(VALUE self);
|
55
|
+
VALUE rb_vector_q(VALUE self);
|
56
|
+
VALUE rb_square_q(VALUE self);
|
57
|
+
// cxcore function
|
58
|
+
VALUE rb_to_CvMat(VALUE self);
|
59
|
+
VALUE rb_to_IplImage(VALUE self);
|
60
|
+
VALUE rb_sub_rect(VALUE self, VALUE args);
|
61
|
+
VALUE rb_get_rows(int argc, VALUE* argv, VALUE self);
|
62
|
+
VALUE rb_get_cols(VALUE self, VALUE col);
|
63
|
+
VALUE rb_each_row(VALUE self);
|
64
|
+
VALUE rb_each_col(VALUE self);
|
65
|
+
VALUE rb_diag(int argc, VALUE *argv, VALUE self);
|
66
|
+
VALUE rb_size(VALUE self);
|
67
|
+
VALUE rb_dims(VALUE self);
|
68
|
+
VALUE rb_dim_size(VALUE self, VALUE index);
|
69
|
+
VALUE rb_aref(VALUE self, VALUE args);
|
70
|
+
VALUE rb_aset(VALUE self, VALUE args);
|
71
|
+
VALUE rb_set_data(VALUE self, VALUE data);
|
72
|
+
VALUE rb_set(int argc, VALUE *argv, VALUE self);
|
73
|
+
VALUE rb_set_bang(int argc, VALUE *argv, VALUE self);
|
74
|
+
VALUE rb_set_zero(VALUE self);
|
75
|
+
VALUE rb_set_zero_bang(VALUE self);
|
76
|
+
VALUE rb_set_identity(int argc, VALUE *argv, VALUE self);
|
77
|
+
VALUE rb_set_identity_bang(int argc, VALUE *argv, VALUE self);
|
78
|
+
VALUE rb_range(VALUE self, VALUE start, VALUE end);
|
79
|
+
VALUE rb_range_bang(VALUE self, VALUE start, VALUE end);
|
80
|
+
/* Transforms and Permutations */
|
81
|
+
VALUE rb_reshape(VALUE self, VALUE hash);
|
82
|
+
VALUE rb_repeat(VALUE self, VALUE object);
|
83
|
+
VALUE rb_flip(int argc, VALUE *argv, VALUE self);
|
84
|
+
VALUE rb_flip_bang(int argc, VALUE *argv, VALUE self);
|
85
|
+
VALUE rb_split(VALUE self);
|
86
|
+
VALUE rb_merge(VALUE klass, VALUE args);
|
87
|
+
VALUE rb_rand_shuffle(int argc, VALUE *argv, VALUE klass);
|
88
|
+
VALUE rb_rand_shuffle_bang(int argc, VALUE *argv, VALUE klass);
|
89
|
+
|
90
|
+
VALUE rb_lut(VALUE self, VALUE lut);
|
91
|
+
VALUE rb_convert_scale(VALUE self, VALUE hash);
|
92
|
+
VALUE rb_convert_scale_abs(VALUE self, VALUE hash);
|
93
|
+
VALUE rb_add(int argc, VALUE *argv, VALUE self);
|
94
|
+
VALUE rb_sub(int argc, VALUE *argv, VALUE self);
|
95
|
+
VALUE rb_mul(int argc, VALUE *argv, VALUE self);
|
96
|
+
VALUE rb_mat_mul(int argc, VALUE *argv, VALUE self);
|
97
|
+
VALUE rb_div(int argc, VALUE *argv, VALUE self);
|
98
|
+
VALUE rb_and(int argc, VALUE *argv, VALUE self);
|
99
|
+
VALUE rb_or(int argc, VALUE *argv, VALUE self);
|
100
|
+
VALUE rb_xor(int argc, VALUE *argv, VALUE self);
|
101
|
+
VALUE rb_not(VALUE self);
|
102
|
+
VALUE rb_not_bang(VALUE self);
|
103
|
+
VALUE rb_cmp_internal(VALUE self, VALUE val, int operand);
|
104
|
+
VALUE rb_eq(VALUE self, VALUE val);
|
105
|
+
VALUE rb_gt(VALUE self, VALUE val);
|
106
|
+
VALUE rb_ge(VALUE self, VALUE val);
|
107
|
+
VALUE rb_lt(VALUE self, VALUE val);
|
108
|
+
VALUE rb_le(VALUE self, VALUE val);
|
109
|
+
VALUE rb_ne(VALUE self, VALUE val);
|
110
|
+
VALUE rb_in_range(VALUE self, VALUE min, VALUE max);
|
111
|
+
VALUE rb_abs_diff(VALUE self, VALUE val);
|
112
|
+
VALUE rb_normalize(int argc, VALUE *argv, VALUE self);
|
113
|
+
VALUE rb_add_weighted(VALUE klass, VALUE src1, VALUE alpha, VALUE src2, VALUE beta, VALUE gamma);
|
114
|
+
/* Statistics */
|
115
|
+
VALUE rb_count_non_zero(VALUE self);
|
116
|
+
VALUE rb_sum(VALUE self);
|
117
|
+
VALUE rb_avg(int argc, VALUE *argv, VALUE self);
|
118
|
+
VALUE rb_avg_sdv(int argc, VALUE *argv, VALUE self);
|
119
|
+
VALUE rb_sdv(int argc, VALUE *argv, VALUE self);
|
120
|
+
VALUE rb_min_max_loc(int argc, VALUE *argv, VALUE self);
|
121
|
+
|
122
|
+
//VALUE rb_norm();
|
123
|
+
VALUE rb_dot_product(VALUE self, VALUE mat);
|
124
|
+
VALUE rb_cross_product(VALUE self, VALUE mat);
|
125
|
+
// VALUE rb_gemm();
|
126
|
+
VALUE rb_transform(int argc, VALUE *argv, VALUE self);
|
127
|
+
VALUE rb_perspective_transform(VALUE self, VALUE mat);
|
128
|
+
VALUE rb_mul_transposed(int argc, VALUE *argv, VALUE self);
|
129
|
+
VALUE rb_trace(VALUE self);
|
130
|
+
VALUE rb_transpose(VALUE self);
|
131
|
+
VALUE rb_det(VALUE self);
|
132
|
+
VALUE rb_invert(int argc, VALUE *argv, VALUE self);
|
133
|
+
VALUE rb_solve(int argc, VALUE *argv, VALUE self);
|
134
|
+
VALUE rb_svd(int argc, VALUE *argv, VALUE self);
|
135
|
+
VALUE rb_eigenvv(int argc, VALUE *argv, VALUE self);
|
136
|
+
VALUE rb_eigenvv_bang(int argc, VALUE *argv, VALUE self);
|
137
|
+
|
138
|
+
VALUE rb_dft(int argc, VALUE *argv, VALUE self);
|
139
|
+
VALUE rb_dct(int argc, VALUE *argv, VALUE self);
|
140
|
+
|
141
|
+
/* drawing function*/
|
142
|
+
VALUE rb_line(int argc, VALUE *argv, VALUE self);
|
143
|
+
VALUE rb_line_bang(int argc, VALUE *argv, VALUE self);
|
144
|
+
VALUE rb_rectangle(int argc, VALUE *argv, VALUE self);
|
145
|
+
VALUE rb_rectangle_bang(int argc, VALUE *argv, VALUE self);
|
146
|
+
VALUE rb_circle(int argc, VALUE *argv, VALUE self);
|
147
|
+
VALUE rb_circle_bang(int argc, VALUE *argv, VALUE self);
|
148
|
+
VALUE rb_ellipse(int argc, VALUE *argv, VALUE self);
|
149
|
+
VALUE rb_ellipse_bang(int argc, VALUE *argv, VALUE self);
|
150
|
+
VALUE rb_ellipse_box(int argc, VALUE *argv, VALUE self);
|
151
|
+
VALUE rb_ellipse_box_bang(int argc, VALUE *argv, VALUE self);
|
152
|
+
VALUE rb_fill_poly(int argc, VALUE *argv, VALUE self);
|
153
|
+
VALUE rb_fill_poly_bang(int argc, VALUE *argv, VALUE self);
|
154
|
+
VALUE rb_fill_convex_poly(int argc, VALUE *argv, VALUE self);
|
155
|
+
VALUE rb_fill_convex_poly_bang(int argc, VALUE *argv, VALUE self);
|
156
|
+
VALUE rb_poly_line(int argc, VALUE *argv, VALUE self);
|
157
|
+
VALUE rb_poly_line_bang(int argc, VALUE *argv, VALUE self);
|
158
|
+
VALUE rb_put_text(int argc, VALUE *argv, VALUE self);
|
159
|
+
VALUE rb_put_text_bang(int argc, VALUE *argv, VALUE self);
|
160
|
+
|
161
|
+
/* cv function */
|
162
|
+
VALUE rb_sobel(int argc, VALUE *argv, VALUE self);
|
163
|
+
VALUE rb_laplace(int argc, VALUE *argv, VALUE self);
|
164
|
+
VALUE rb_canny(int argc, VALUE *argv, VALUE self);
|
165
|
+
VALUE rb_pre_corner_detect(int argc, VALUE *argv, VALUE self);
|
166
|
+
VALUE rb_corner_eigenvv(int argc, VALUE *argv, VALUE self);
|
167
|
+
VALUE rb_corner_min_eigen_val(int argc, VALUE *argv, VALUE self);
|
168
|
+
VALUE rb_corner_harris(int argc, VALUE *argv, VALUE self);
|
169
|
+
VALUE rb_find_chessboard_corners(int argc, VALUE *argv, VALUE self);
|
170
|
+
VALUE rb_find_corner_sub_pix(VALUE self, VALUE corners, VALUE win_size, VALUE zero_zone, VALUE criteria);
|
171
|
+
VALUE rb_good_features_to_track(int argc, VALUE *argv, VALUE self);
|
172
|
+
|
173
|
+
VALUE rb_rect_sub_pix(int argc, VALUE *argv, VALUE self);
|
174
|
+
VALUE rb_quadrangle_sub_pix(int argc, VALUE *argv, VALUE self);
|
175
|
+
VALUE rb_resize(int argc, VALUE *argv, VALUE self);
|
176
|
+
VALUE rb_warp_affine(int argc, VALUE *argv, VALUE self);
|
177
|
+
VALUE rb_rotation_matrix2D(VALUE self, VALUE center, VALUE angle, VALUE scale);
|
178
|
+
VALUE rb_warp_perspective(int argc, VALUE *argv, VALUE self);
|
179
|
+
VALUE rb_find_homograpy(int argc, VALUE *argv, VALUE self);
|
180
|
+
VALUE rb_remap(int argc, VALUE *argv, VALUE self);
|
181
|
+
VALUE rb_log_polar(int argc, VALUE *argv, VALUE self);
|
182
|
+
|
183
|
+
VALUE rb_erode(int argc, VALUE *argv, VALUE self);
|
184
|
+
VALUE rb_erode_bang(int argc, VALUE *argv, VALUE self);
|
185
|
+
VALUE rb_dilate(int argc, VALUE *argv, VALUE self);
|
186
|
+
VALUE rb_dilate_bang(int argc, VALUE *argv, VALUE self);
|
187
|
+
VALUE rb_morphology(int argc, VALUE *argv, VALUE self);
|
188
|
+
|
189
|
+
VALUE rb_smooth(int argc, VALUE *argv, VALUE self);
|
190
|
+
VALUE rb_copy_make_border(int argc, VALUE *argv, VALUE self);
|
191
|
+
VALUE rb_filter2d(int argc, VALUE *argv, VALUE self);
|
192
|
+
VALUE rb_integral(int argc, VALUE *argv, VALUE self);
|
193
|
+
VALUE rb_threshold(int argc, VALUE *argv, VALUE self);
|
194
|
+
VALUE rb_adaptive_threshold(int argc, VALUE *argv, VALUE self);
|
195
|
+
|
196
|
+
VALUE rb_pyr_down(int argc, VALUE *argv, VALUE self);
|
197
|
+
VALUE rb_pyr_up(int argc, VALUE *argv, VALUE self);
|
198
|
+
|
199
|
+
VALUE rb_flood_fill(int argc, VALUE *argv, VALUE self);
|
200
|
+
VALUE rb_flood_fill_bang(int argc, VALUE *argv, VALUE self);
|
201
|
+
VALUE rb_find_contours(int argc, VALUE *argv, VALUE self);
|
202
|
+
VALUE rb_find_contours_bang(int argc, VALUE *argv, VALUE self);
|
203
|
+
VALUE rb_draw_contours(int argc, VALUE *argv, VALUE self);
|
204
|
+
VALUE rb_draw_contours_bang(int argc, VALUE *argv, VALUE self);
|
205
|
+
VALUE rb_draw_chessboard_corners(VALUE self, VALUE pattern_size, VALUE corners, VALUE pattern_was_found);
|
206
|
+
VALUE rb_draw_chessboard_corners_bang(VALUE self, VALUE pattern_size, VALUE corners, VALUE pattern_was_found);
|
207
|
+
VALUE rb_pyr_mean_shift_filtering(int argc, VALUE *argv, VALUE self);
|
208
|
+
VALUE rb_watershed(VALUE self, VALUE markers);
|
209
|
+
VALUE rb_moments(int argc, VALUE *argv, VALUE self);
|
210
|
+
|
211
|
+
VALUE rb_hough_lines(int argc, VALUE *argv, VALUE self);
|
212
|
+
VALUE rb_hough_circles(int argc, VALUE *argv, VALUE self);
|
213
|
+
VALUE rb_dist_transform(int argc, VALUE *argv, VALUE self);
|
214
|
+
VALUE rb_inpaint(VALUE self, VALUE inpaint_method, VALUE mask, VALUE radius);
|
215
|
+
|
216
|
+
VALUE rb_equalize_hist(VALUE self);
|
217
|
+
/* Matching*/
|
218
|
+
VALUE rb_match_template(int argc, VALUE *argv, VALUE self);
|
219
|
+
VALUE rb_match_shapes(int argc, VALUE *argv, VALUE self);
|
220
|
+
VALUE rb_match_descriptors(int argc, VALUE *argv, VALUE self);
|
221
|
+
|
222
|
+
/* Object Tracking */
|
223
|
+
VALUE rb_mean_shift(VALUE self, VALUE window, VALUE criteria);
|
224
|
+
VALUE rb_cam_shift(VALUE self, VALUE window, VALUE criteria);
|
225
|
+
VALUE rb_snake_image(int argc, VALUE *argv, VALUE self);
|
226
|
+
/* Optical Flow */
|
227
|
+
VALUE rb_optical_flow_hs(int argc, VALUE *argv, VALUE self);
|
228
|
+
VALUE rb_optical_flow_lk(VALUE self, VALUE prev, VALUE win_size);
|
229
|
+
VALUE rb_optical_flow_bm(int argc, VALUE *argv, VALUE self);
|
230
|
+
VALUE rb_optical_flow_pyr_lk(int argc, VALUE *argv, VALUE self);
|
231
|
+
|
232
|
+
/* Epipolar Geometory */
|
233
|
+
VALUE rb_find_fundamental_mat(int argc, VALUE *argv, VALUE klass);
|
234
|
+
VALUE rb_compute_correspond_epilines(VALUE klass, VALUE points, VALUE which_image, VALUE fundamental_matrix);
|
235
|
+
|
236
|
+
/* Feature detection and description */
|
237
|
+
VALUE rb_extract_surf(int argc, VALUE *argv, VALUE self);
|
238
|
+
|
239
|
+
// HighGUI function
|
240
|
+
VALUE rb_save_image(int argc, VALUE *argv, VALUE self);
|
241
|
+
|
242
|
+
VALUE new_object(int rows, int cols, int type);
|
243
|
+
VALUE new_object(CvSize size, int type);
|
244
|
+
VALUE new_mat_kind_object(CvSize size, VALUE ref_obj);
|
245
|
+
VALUE new_mat_kind_object(CvSize size, VALUE ref_obj, int cvmat_depth, int channel);
|
246
|
+
|
247
|
+
CvMat* prepare_decoding(int argc, VALUE *argv, int* iscolor, int* need_release);
|
248
|
+
|
249
|
+
__NAMESPACE_END_CVMAT
|
250
|
+
|
251
|
+
inline CvMat*
|
252
|
+
CVMAT(VALUE object)
|
253
|
+
{
|
254
|
+
CvMat *ptr, stub;
|
255
|
+
Data_Get_Struct(object, CvMat, ptr);
|
256
|
+
return cvGetMat(ptr, &stub);
|
257
|
+
}
|
258
|
+
|
259
|
+
inline CvMat*
|
260
|
+
CVMAT_WITH_CHECK(VALUE object)
|
261
|
+
{
|
262
|
+
if (!rb_obj_is_kind_of(object, cCvMat::rb_class()))
|
263
|
+
raise_typeerror(object, cCvMat::rb_class());
|
264
|
+
return CVMAT(object);
|
265
|
+
}
|
266
|
+
|
267
|
+
inline CvMat*
|
268
|
+
MASK(VALUE object)
|
269
|
+
{
|
270
|
+
if (NIL_P(object))
|
271
|
+
return NULL;
|
272
|
+
else {
|
273
|
+
CvMat* obj_ptr = CVMAT_WITH_CHECK(object);
|
274
|
+
if (CV_MAT_DEPTH(obj_ptr->type) == CV_8UC1 &&
|
275
|
+
CV_MAT_CN(obj_ptr->type) == 1)
|
276
|
+
return obj_ptr;
|
277
|
+
else
|
278
|
+
rb_raise(rb_eTypeError, "Mask should be 8bit 1-channel matrix.");
|
279
|
+
}
|
280
|
+
}
|
281
|
+
|
282
|
+
__NAMESPACE_END_OPENCV
|
283
|
+
|
284
|
+
#endif // RUBY_OPENCV_CVMAT_H
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/***********************************************************
|
2
|
+
|
3
|
+
cvmatnd.cpp -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2007 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#include "cvmatnd.h"
|
11
|
+
/*
|
12
|
+
* Document-class: OpenCV::CvMatND
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
__NAMESPACE_BEGIN_OPENCV
|
16
|
+
__NAMESPACE_BEGIN_CVMATND
|
17
|
+
|
18
|
+
VALUE rb_klass;
|
19
|
+
|
20
|
+
VALUE
|
21
|
+
rb_class()
|
22
|
+
{
|
23
|
+
return rb_klass;
|
24
|
+
}
|
25
|
+
|
26
|
+
void
|
27
|
+
define_ruby_class()
|
28
|
+
{
|
29
|
+
if (rb_klass)
|
30
|
+
return;
|
31
|
+
/*
|
32
|
+
* opencv = rb_define_module("OpenCV");
|
33
|
+
* cvmat = rb_define_class_under(opencv, "CvMat", rb_cObject);
|
34
|
+
*
|
35
|
+
* note: this comment is used by rdoc.
|
36
|
+
*/
|
37
|
+
VALUE opencv = rb_module_opencv(), cvmat = cCvMat::rb_class();
|
38
|
+
|
39
|
+
rb_klass = rb_define_class_under(opencv, "CvMatND", cvmat);
|
40
|
+
}
|
41
|
+
|
42
|
+
__NAMESPACE_END_CVMATND
|
43
|
+
__NAMESPACE_END_OPENCV
|
44
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvmatnd.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2007 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVMATND_H
|
11
|
+
#define RUBY_OPENCV_CVMATND_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
#define __NAMESPACE_BEGIN_CVMATND namespace cCvMatND {
|
16
|
+
#define __NAMESPACE_END_CVMATND }
|
17
|
+
|
18
|
+
__NAMESPACE_BEGIN_OPENCV
|
19
|
+
__NAMESPACE_BEGIN_CVMATND
|
20
|
+
|
21
|
+
VALUE rb_class();
|
22
|
+
|
23
|
+
void define_ruby_class();
|
24
|
+
|
25
|
+
__NAMESPACE_END_CVMATND
|
26
|
+
__NAMESPACE_END_OPENCV
|
27
|
+
|
28
|
+
#endif // RUBY_OPENCV_CVMATND_H
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvmemstorage.cpp -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#include "cvmemstorage.h"
|
11
|
+
/*
|
12
|
+
* Document-class: OpenCV::CvMemStorage
|
13
|
+
*
|
14
|
+
* Internal memory management class used by CvSeq.
|
15
|
+
*/
|
16
|
+
__NAMESPACE_BEGIN_OPENCV
|
17
|
+
__NAMESPACE_BEGIN_CVMEMSTORAGE
|
18
|
+
|
19
|
+
VALUE rb_klass;
|
20
|
+
|
21
|
+
VALUE
|
22
|
+
rb_class()
|
23
|
+
{
|
24
|
+
return rb_klass;
|
25
|
+
}
|
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
|
+
VALUE
|
42
|
+
rb_allocate(VALUE klass)
|
43
|
+
{
|
44
|
+
CvMemStorage *storage = rb_cvCreateMemStorage(0);
|
45
|
+
return Data_Wrap_Struct(klass, 0, cvmemstorage_free, storage);
|
46
|
+
}
|
47
|
+
|
48
|
+
void
|
49
|
+
cvmemstorage_free(void *ptr)
|
50
|
+
{
|
51
|
+
try {
|
52
|
+
cvReleaseMemStorage((CvMemStorage**)&ptr);
|
53
|
+
}
|
54
|
+
catch (cv::Exception& e) {
|
55
|
+
raise_cverror(e);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
VALUE
|
60
|
+
new_object(int blocksize)
|
61
|
+
{
|
62
|
+
CvMemStorage *storage = rb_cvCreateMemStorage(blocksize);
|
63
|
+
return Data_Wrap_Struct(rb_klass, 0, cvmemstorage_free, storage);
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
__NAMESPACE_END_CVMEMSTORAGE
|
68
|
+
__NAMESPACE_END_OPENCV
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvmemstorage.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVMEMSTORAGE_H
|
11
|
+
#define RUBY_OPENCV_CVMEMSTORAGE_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
#define __NAMESPACE_BEGIN_CVMEMSTORAGE namespace cCvMemStorage {
|
16
|
+
#define __NAMESPACE_END_CVMEMSTORAGE }
|
17
|
+
|
18
|
+
__NAMESPACE_BEGIN_OPENCV
|
19
|
+
__NAMESPACE_BEGIN_CVMEMSTORAGE
|
20
|
+
|
21
|
+
void define_ruby_class();
|
22
|
+
|
23
|
+
VALUE rb_class();
|
24
|
+
VALUE rb_allocate(VALUE klass);
|
25
|
+
void cvmemstorage_free(void *ptr);
|
26
|
+
|
27
|
+
VALUE new_object(int blocksize = 0);
|
28
|
+
|
29
|
+
__NAMESPACE_END_CVMEMSTORAGE
|
30
|
+
|
31
|
+
inline CvMemStorage*
|
32
|
+
CVMEMSTORAGE(VALUE object)
|
33
|
+
{
|
34
|
+
CvMemStorage *ptr;
|
35
|
+
Data_Get_Struct(object, CvMemStorage, ptr);
|
36
|
+
return ptr;
|
37
|
+
}
|
38
|
+
|
39
|
+
inline VALUE
|
40
|
+
CHECK_CVMEMSTORAGE(VALUE object)
|
41
|
+
{
|
42
|
+
if (rb_obj_is_kind_of(object, cCvMemStorage::rb_class()))
|
43
|
+
return object;
|
44
|
+
else {
|
45
|
+
if (!NIL_P(object))
|
46
|
+
rb_warn("invalid CvMemStorage object given. allocate new memory storage automatically.");
|
47
|
+
return cCvMemStorage::new_object();
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
__NAMESPACE_END_OPENCV
|
52
|
+
|
53
|
+
#endif // RUBY_OPENCV_CVMEMSTORAGE_H
|