bonanza-ruby-opencv 0.0.13.20160428094028 → 0.0.13.20160519171728
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/opencv/cvmat.cpp +61 -8
- data/ext/opencv/cvmat.h +1 -1
- data/ext/opencv/opencv.cpp +8 -0
- data/ruby-opencv.gemspec +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7d609b9040a2e58f9f47a7cf61f96b68068c9a1
|
4
|
+
data.tar.gz: ab4c125c8b62c3eeaf8b59416923cf8067a3e712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ae802e14e96b7f72fb8f861740718af0fc663f906268d9f258ba4a570da1cebcaa2863ba7fc67c1e73ae5504b522aa10a7a1231f2cf245a39647cf2feae9fd8
|
7
|
+
data.tar.gz: 7837c1b1b0b62d494fcfc5756cb77fe45deb7d69c143a812d5a3abe4f7aa80fc96973741c009337b51a1fae1ed6b86a9f1e24a91d1c9c98c49d1c9b858aa2543
|
data/ext/opencv/cvmat.cpp
CHANGED
@@ -1977,6 +1977,18 @@ rb_and(int argc, VALUE *argv, VALUE self)
|
|
1977
1977
|
return dest;
|
1978
1978
|
}
|
1979
1979
|
|
1980
|
+
VALUE
|
1981
|
+
rb_and_into(VALUE self, VALUE other, VALUE dest)
|
1982
|
+
{
|
1983
|
+
try {
|
1984
|
+
cvAnd(CVARR(self), CVARR(other), CVARR(dest));
|
1985
|
+
}
|
1986
|
+
catch (cv::Exception& e) {
|
1987
|
+
raise_cverror(e);
|
1988
|
+
}
|
1989
|
+
return dest;
|
1990
|
+
}
|
1991
|
+
|
1980
1992
|
/*
|
1981
1993
|
* Calculates the per-element bit-wise disjunction of two arrays or an array and a scalar.
|
1982
1994
|
*
|
@@ -2068,10 +2080,15 @@ rb_not_bang(VALUE self)
|
|
2068
2080
|
}
|
2069
2081
|
|
2070
2082
|
VALUE
|
2071
|
-
|
2083
|
+
rb_cmp(VALUE self, VALUE val, VALUE dest, VALUE operand)
|
2084
|
+
{
|
2085
|
+
return rb_cmp_internal(self, val, dest, NUM2INT(operand));
|
2086
|
+
}
|
2087
|
+
|
2088
|
+
VALUE
|
2089
|
+
rb_cmp_internal(VALUE self, VALUE val, VALUE dest, int operand)
|
2072
2090
|
{
|
2073
2091
|
CvArr* self_ptr = CVARR(self);
|
2074
|
-
VALUE dest = new_mat_kind_object(cvGetSize(self_ptr), self, CV_8U, 1);
|
2075
2092
|
try {
|
2076
2093
|
if (rb_obj_is_kind_of(val, rb_klass))
|
2077
2094
|
cvCmp(self_ptr, CVARR(val), CVARR(dest), operand);
|
@@ -2101,7 +2118,8 @@ rb_cmp_internal(VALUE self, VALUE val, int operand)
|
|
2101
2118
|
VALUE
|
2102
2119
|
rb_eq(VALUE self, VALUE val)
|
2103
2120
|
{
|
2104
|
-
|
2121
|
+
VALUE dest = new_mat_kind_object(cvGetSize(CVARR(self)), self, CV_8U, 1);
|
2122
|
+
return rb_cmp_internal(self, val, dest, CV_CMP_EQ);
|
2105
2123
|
}
|
2106
2124
|
|
2107
2125
|
/*
|
@@ -2116,7 +2134,8 @@ rb_eq(VALUE self, VALUE val)
|
|
2116
2134
|
VALUE
|
2117
2135
|
rb_gt(VALUE self, VALUE val)
|
2118
2136
|
{
|
2119
|
-
|
2137
|
+
VALUE dest = new_mat_kind_object(cvGetSize(CVARR(self)), self, CV_8U, 1);
|
2138
|
+
return rb_cmp_internal(self, val, dest, CV_CMP_GT);
|
2120
2139
|
}
|
2121
2140
|
|
2122
2141
|
/*
|
@@ -2131,7 +2150,8 @@ rb_gt(VALUE self, VALUE val)
|
|
2131
2150
|
VALUE
|
2132
2151
|
rb_ge(VALUE self, VALUE val)
|
2133
2152
|
{
|
2134
|
-
|
2153
|
+
VALUE dest = new_mat_kind_object(cvGetSize(CVARR(self)), self, CV_8U, 1);
|
2154
|
+
return rb_cmp_internal(self, val, dest, CV_CMP_GE);
|
2135
2155
|
}
|
2136
2156
|
|
2137
2157
|
/*
|
@@ -2146,7 +2166,8 @@ rb_ge(VALUE self, VALUE val)
|
|
2146
2166
|
VALUE
|
2147
2167
|
rb_lt(VALUE self, VALUE val)
|
2148
2168
|
{
|
2149
|
-
|
2169
|
+
VALUE dest = new_mat_kind_object(cvGetSize(CVARR(self)), self, CV_8U, 1);
|
2170
|
+
return rb_cmp_internal(self, val, dest, CV_CMP_LT);
|
2150
2171
|
}
|
2151
2172
|
|
2152
2173
|
/*
|
@@ -2161,7 +2182,8 @@ rb_lt(VALUE self, VALUE val)
|
|
2161
2182
|
VALUE
|
2162
2183
|
rb_le(VALUE self, VALUE val)
|
2163
2184
|
{
|
2164
|
-
|
2185
|
+
VALUE dest = new_mat_kind_object(cvGetSize(CVARR(self)), self, CV_8U, 1);
|
2186
|
+
return rb_cmp_internal(self, val, dest, CV_CMP_LE);
|
2165
2187
|
}
|
2166
2188
|
|
2167
2189
|
/*
|
@@ -2176,7 +2198,8 @@ rb_le(VALUE self, VALUE val)
|
|
2176
2198
|
VALUE
|
2177
2199
|
rb_ne(VALUE self, VALUE val)
|
2178
2200
|
{
|
2179
|
-
|
2201
|
+
VALUE dest = new_mat_kind_object(cvGetSize(CVARR(self)), self, CV_8U, 1);
|
2202
|
+
return rb_cmp_internal(self, val, dest, CV_CMP_NE);
|
2180
2203
|
}
|
2181
2204
|
|
2182
2205
|
/*
|
@@ -2400,6 +2423,19 @@ rb_avg(int argc, VALUE *argv, VALUE self)
|
|
2400
2423
|
return cCvScalar::new_object(avg);
|
2401
2424
|
}
|
2402
2425
|
|
2426
|
+
VALUE
|
2427
|
+
rb_avg_value(VALUE self, VALUE mask)
|
2428
|
+
{
|
2429
|
+
CvScalar avg;
|
2430
|
+
try {
|
2431
|
+
avg = cvAvg(CVARR(self), MASK(mask));
|
2432
|
+
}
|
2433
|
+
catch (cv::Exception& e) {
|
2434
|
+
raise_cverror(e);
|
2435
|
+
}
|
2436
|
+
return rb_float_new(avg.val[0]);
|
2437
|
+
}
|
2438
|
+
|
2403
2439
|
/*
|
2404
2440
|
* Calculates a mean and standard deviation of array elements.
|
2405
2441
|
* @overload avg_sdv(mask = nil)
|
@@ -4465,6 +4501,19 @@ rb_dilate_bang(int argc, VALUE *argv, VALUE self)
|
|
4465
4501
|
return self;
|
4466
4502
|
}
|
4467
4503
|
|
4504
|
+
VALUE
|
4505
|
+
rb_dilate_into(VALUE self, VALUE dest, VALUE element, VALUE iteration)
|
4506
|
+
{
|
4507
|
+
IplConvKernel* kernel = NIL_P(element) ? NULL : IPLCONVKERNEL_WITH_CHECK(element);
|
4508
|
+
try {
|
4509
|
+
cvDilate(CVARR(self), CVARR(dest), kernel, NUM2INT(iteration));
|
4510
|
+
}
|
4511
|
+
catch (cv::Exception& e) {
|
4512
|
+
raise_cverror(e);
|
4513
|
+
}
|
4514
|
+
return self;
|
4515
|
+
}
|
4516
|
+
|
4468
4517
|
/*
|
4469
4518
|
* Performs advanced morphological transformations using erosion and dilation as basic operations.
|
4470
4519
|
*
|
@@ -6658,12 +6707,14 @@ init_ruby_class()
|
|
6658
6707
|
rb_define_singleton_method(rb_klass, "add_weighted", RUBY_METHOD_FUNC(rb_add_weighted), 5);
|
6659
6708
|
rb_define_method(rb_klass, "and", RUBY_METHOD_FUNC(rb_and), -1);
|
6660
6709
|
rb_define_alias(rb_klass, "&", "and");
|
6710
|
+
rb_define_method(rb_klass, "and_into", RUBY_METHOD_FUNC(rb_and_into), 2);
|
6661
6711
|
rb_define_method(rb_klass, "or", RUBY_METHOD_FUNC(rb_or), -1);
|
6662
6712
|
rb_define_alias(rb_klass, "|", "or");
|
6663
6713
|
rb_define_method(rb_klass, "xor", RUBY_METHOD_FUNC(rb_xor), -1);
|
6664
6714
|
rb_define_alias(rb_klass, "^", "xor");
|
6665
6715
|
rb_define_method(rb_klass, "not", RUBY_METHOD_FUNC(rb_not), 0);
|
6666
6716
|
rb_define_method(rb_klass, "not!", RUBY_METHOD_FUNC(rb_not_bang), 0);
|
6717
|
+
rb_define_method(rb_klass, "cmp", RUBY_METHOD_FUNC(rb_cmp), 3);
|
6667
6718
|
rb_define_method(rb_klass, "eq", RUBY_METHOD_FUNC(rb_eq), 1);
|
6668
6719
|
rb_define_method(rb_klass, "gt", RUBY_METHOD_FUNC(rb_gt), 1);
|
6669
6720
|
rb_define_method(rb_klass, "ge", RUBY_METHOD_FUNC(rb_ge), 1);
|
@@ -6679,6 +6730,7 @@ init_ruby_class()
|
|
6679
6730
|
rb_define_method(rb_klass, "count_non_zero", RUBY_METHOD_FUNC(rb_count_non_zero), 0);
|
6680
6731
|
rb_define_method(rb_klass, "sum", RUBY_METHOD_FUNC(rb_sum), 0);
|
6681
6732
|
rb_define_method(rb_klass, "avg", RUBY_METHOD_FUNC(rb_avg), -1);
|
6733
|
+
rb_define_method(rb_klass, "avg_value", RUBY_METHOD_FUNC(rb_avg_value), 1);
|
6682
6734
|
rb_define_method(rb_klass, "avg_sdv", RUBY_METHOD_FUNC(rb_avg_sdv), -1);
|
6683
6735
|
rb_define_method(rb_klass, "sdv", RUBY_METHOD_FUNC(rb_sdv), -1);
|
6684
6736
|
rb_define_method(rb_klass, "min_max_loc", RUBY_METHOD_FUNC(rb_min_max_loc), -1);
|
@@ -6751,6 +6803,7 @@ init_ruby_class()
|
|
6751
6803
|
rb_define_method(rb_klass, "erode!", RUBY_METHOD_FUNC(rb_erode_bang), -1);
|
6752
6804
|
rb_define_method(rb_klass, "dilate", RUBY_METHOD_FUNC(rb_dilate), -1);
|
6753
6805
|
rb_define_method(rb_klass, "dilate!", RUBY_METHOD_FUNC(rb_dilate_bang), -1);
|
6806
|
+
rb_define_method(rb_klass, "dilate_into", RUBY_METHOD_FUNC(rb_dilate_into), 3);
|
6754
6807
|
rb_define_method(rb_klass, "morphology", RUBY_METHOD_FUNC(rb_morphology), -1);
|
6755
6808
|
|
6756
6809
|
rb_define_method(rb_klass, "smooth", RUBY_METHOD_FUNC(rb_smooth), -1);
|
data/ext/opencv/cvmat.h
CHANGED
@@ -104,7 +104,7 @@ VALUE rb_or(int argc, VALUE *argv, VALUE self);
|
|
104
104
|
VALUE rb_xor(int argc, VALUE *argv, VALUE self);
|
105
105
|
VALUE rb_not(VALUE self);
|
106
106
|
VALUE rb_not_bang(VALUE self);
|
107
|
-
VALUE rb_cmp_internal(VALUE self, VALUE val, int operand);
|
107
|
+
VALUE rb_cmp_internal(VALUE self, VALUE val, VALUE dest, int operand);
|
108
108
|
VALUE rb_eq(VALUE self, VALUE val);
|
109
109
|
VALUE rb_gt(VALUE self, VALUE val);
|
110
110
|
VALUE rb_ge(VALUE self, VALUE val);
|
data/ext/opencv/opencv.cpp
CHANGED
@@ -234,6 +234,14 @@ init_ruby_module()
|
|
234
234
|
rb_define_const(rb_module, "CV_IMWRITE_PNG_STRATEGY_FIXED", INT2FIX(CV_IMWRITE_PNG_STRATEGY_FIXED));
|
235
235
|
rb_define_const(rb_module, "CV_IMWRITE_PXM_BINARY", INT2FIX(CV_IMWRITE_PXM_BINARY));
|
236
236
|
|
237
|
+
/* Comparison types */
|
238
|
+
rb_define_const(rb_module, "CV_CMP_EQ", INT2FIX(CV_CMP_EQ));
|
239
|
+
rb_define_const(rb_module, "CV_CMP_GT", INT2FIX(CV_CMP_GT));
|
240
|
+
rb_define_const(rb_module, "CV_CMP_GE", INT2FIX(CV_CMP_GE));
|
241
|
+
rb_define_const(rb_module, "CV_CMP_LT", INT2FIX(CV_CMP_LT));
|
242
|
+
rb_define_const(rb_module, "CV_CMP_LE", INT2FIX(CV_CMP_LE));
|
243
|
+
rb_define_const(rb_module, "CV_CMP_NE", INT2FIX(CV_CMP_NE));
|
244
|
+
|
237
245
|
/* Types of morphological operations */
|
238
246
|
rb_define_const(rb_module, "CV_MOP_OPEN", INT2FIX(CV_MOP_OPEN));
|
239
247
|
rb_define_const(rb_module, "CV_MOP_CLOSE", INT2FIX(CV_MOP_CLOSE));
|
data/ruby-opencv.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ruby-opencv 0.0.13.
|
2
|
+
# stub: ruby-opencv 0.0.13.20160519171728 ruby lib
|
3
3
|
# stub: ext/opencv/extconf.rb
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "bonanza-ruby-opencv"
|
7
|
-
s.version = "0.0.13.
|
7
|
+
s.version = "0.0.13.20160519171728"
|
8
8
|
|
9
9
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
10
|
s.require_paths = ["lib"]
|
11
11
|
s.authors = ["lsxi", "ser1zw", "pcting"]
|
12
|
-
s.date = "2016-
|
12
|
+
s.date = "2016-05-20"
|
13
13
|
s.description = "ruby-opencv is a wrapper of OpenCV for Ruby. It helps you to write computer vision programs (e.g. detecting faces from pictures) with Ruby."
|
14
14
|
s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
|
15
15
|
s.extensions = ["ext/opencv/extconf.rb"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bonanza-ruby-opencv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.13.
|
4
|
+
version: 0.0.13.20160519171728
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lsxi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-05-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdoc
|
@@ -346,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
346
346
|
version: '0'
|
347
347
|
requirements: []
|
348
348
|
rubyforge_project:
|
349
|
-
rubygems_version: 2.5.1
|
349
|
+
rubygems_version: 2.4.5.1
|
350
350
|
signing_key:
|
351
351
|
specification_version: 4
|
352
352
|
summary: OpenCV wrapper for Ruby
|