ruby-opencv 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9ab69e46cbd94956c429710dd017b78ee16f718
4
- data.tar.gz: f6773286bb9c80677d4c35da2b24608991c104a9
3
+ metadata.gz: 00fdfbad5fec1130a085d1b0b28614239dc5b138
4
+ data.tar.gz: 70dce06ad82b90b2707fac4e13f0f798d9feff82
5
5
  SHA512:
6
- metadata.gz: b90d2239d49e50a6f08b1d79cb584e0f035f4951debeadf308e8996a7c5baf5428c3419efc4a55d39aacd3037e4671627fdfb47e54c6c839b394d1beb590450e
7
- data.tar.gz: '089851b80f9cb2dadefb8f432fd25da0bb83c9e6726d217456cc8d8b4540c20d8629ea299dfbcfbaec21a9c8b5b684aa7f4325d68bba24303c6a930c6ad7879e'
6
+ metadata.gz: 70e575baa745f3d07af3a39ea0e7549eaaa202a2f476e6fde8236d05d51dbedeafda1f45ce3ce399927fa1e100128a6a989e989cca296b2a3a4f55af430fd709
7
+ data.tar.gz: ae17d441ebe7d1e2dc5950034fce6cd886e27a92f0b0d94ad426cd969d0a283b74a93dfe002df491dd50e694a75218bb06c1365dbf8e46f8e3afe1b0b10919f1
data/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  An OpenCV wrapper for Ruby.
4
4
 
5
5
  * Web site: <https://github.com/ruby-opencv/ruby-opencv>
6
- * Ruby 1.9.3, 2.x and OpenCV 2.4.12 are supported.
6
+ * Ruby 2.x and OpenCV 2.4.13 are supported.
7
+ * [Documentation](http://www.rubydoc.info/gems/ruby-opencv/frames)
7
8
 
8
9
  ## Requirement
9
10
 
@@ -23,16 +24,9 @@ $ gem install ruby-opencv -- --with-opencv-dir=/path/to/opencvdir
23
24
  Note: **/path/to/opencvdir** is the directory where you installed OpenCV.
24
25
 
25
26
 
26
- ### Windows
27
- You can use pre-build binary for Windows (mswin32).
27
+ ### Windows (RubyInstaller)
28
28
 
29
- 1. Install [OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/)
30
- 2. Set path to OpenCV libraries. When you installed OpenCV to **C:\opencv**, add **C:\opencv\build\x86\vc10\bin** to the systems path.
31
- 3. Install ruby-opencv
32
-
33
- ```
34
- $ gem install ruby-opencv
35
- ```
29
+ See [install-ruby-opencv-with-rubyinstaller-on-windows.md](install-ruby-opencv-with-rubyinstaller-on-windows.md).
36
30
 
37
31
  ## Sample code
38
32
  ### Load and Display an Image
@@ -39,7 +39,7 @@ cvcapture_free(void *ptr)
39
39
  * Open video file or a capturing device for video capturing
40
40
  * @scope class
41
41
  * @overload open(dev = nil)
42
- * @param dev [String,Fixnum,Simbol,nil] Video capturing device
42
+ * @param dev [String,Integer,Simbol,nil] Video capturing device
43
43
  * * If dev is a string (i.e "stream.avi"), reads video stream from a file.
44
44
  * * If dev is a number or symbol (included in CvCapture::INTERFACE), reads video stream from a device.
45
45
  * * If dev is a nil, same as CvCapture.open(:any)
@@ -62,7 +62,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
62
62
  raise_cverror(e);
63
63
  }
64
64
  CvSeq* self_ptr = CVSEQ(self);
65
- cCvSeq::register_elem_class(self_ptr, rb_cFixnum);
65
+ cCvSeq::register_elem_class(self_ptr, rb_cInteger);
66
66
  register_root_object(self_ptr, storage_value);
67
67
 
68
68
  return self;
@@ -95,7 +95,7 @@ rb_set_origin(VALUE self, VALUE origin)
95
95
  /*
96
96
  * Returns the chain codes
97
97
  * @overload codes
98
- * @return [Array<Fixnum>] Chain codes
98
+ * @return [Array<Integer>] Chain codes
99
99
  * @opencv_func cvStartReadChainPoints
100
100
  * @opencv_func CV_READ_SEQ_ELEM
101
101
  */
@@ -44,14 +44,14 @@ rb_allocate(VALUE klass)
44
44
  * Constructor
45
45
  *
46
46
  * @overload new(seq_flags = CV_SEQ_ELTYPE_POINT | CV_SEQ_KIND_GENERIC, storage = nil)
47
- * @param [Fixnum] seq_flags Flags of the created sequence, which are combinations of
47
+ * @param [Integer] seq_flags Flags of the created sequence, which are combinations of
48
48
  * the element types and sequence types.
49
49
  * - Element type:
50
50
  * - <tt>CV_SEQ_ELTYPE_POINT</tt>: {CvPoint}
51
51
  * - <tt>CV_32FC2</tt>: {CvPoint2D32f}
52
52
  * - <tt>CV_SEQ_ELTYPE_POINT3D</tt>: {CvPoint3D32f}
53
- * - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Fixnum
54
- * - <tt>CV_SEQ_ELTYPE_CODE</tt>: Fixnum (Freeman code)
53
+ * - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Integer
54
+ * - <tt>CV_SEQ_ELTYPE_CODE</tt>: Integer (Freeman code)
55
55
  * - Sequence type:
56
56
  * - <tt>CV_SEQ_KIND_GENERIC</tt>: Generic sequence
57
57
  * - <tt>CV_SEQ_KIND_CURVE</tt>: Curve
@@ -108,7 +108,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
108
108
  /*
109
109
  * Returns font face
110
110
  * @overload face
111
- * @return [Fixnum] Font face
111
+ * @return [Integer] Font face
112
112
  */
113
113
  VALUE
114
114
  rb_face(VALUE self)
@@ -152,7 +152,7 @@ rb_shear(VALUE self)
152
152
  /*
153
153
  * Returns thickness
154
154
  * @overload thickness
155
- * @return [Fixnum] thickness
155
+ * @return [Integer] thickness
156
156
  */
157
157
  VALUE
158
158
  rb_thickness(VALUE self)
@@ -163,7 +163,7 @@ rb_thickness(VALUE self)
163
163
  /*
164
164
  * Returns line type
165
165
  * @overload line_type
166
- * @return [Fixnum] line_type
166
+ * @return [Integer] line_type
167
167
  */
168
168
  VALUE
169
169
  rb_line_type(VALUE self)
@@ -12,7 +12,7 @@
12
12
  * Document-class: OpenCV::CvPoint
13
13
  *
14
14
  * This class means one point on X axis Y axis.
15
- * X and Y takes the value of the Fixnum. see also CvPoint2D32F
15
+ * X and Y takes the value of the Integer. see also CvPoint2D32F
16
16
  *
17
17
  * C structure is here, very simple.
18
18
  * typdef struct CvPoint {
@@ -53,7 +53,7 @@ rb_allocate(VALUE klass)
53
53
  * call-seq:
54
54
  * new([d1][,d2][,d3][,d4])
55
55
  *
56
- * Create new Scalar. Argument should be Fixnum (or nil as 0).
56
+ * Create new Scalar. Argument should be Integer (or nil as 0).
57
57
  */
58
58
  VALUE
59
59
  rb_initialize(int argc, VALUE *argv, VALUE self)
@@ -43,7 +43,7 @@ eltype2class(int eltype, VALUE* ret) {
43
43
  break;
44
44
  case CV_SEQ_ELTYPE_CODE:
45
45
  case CV_SEQ_ELTYPE_INDEX:
46
- *ret = rb_cFixnum;
46
+ *ret = rb_cInteger;
47
47
  break;
48
48
  case CV_SEQ_ELTYPE_PPOINT: // or CV_SEQ_ELTYPE_PTR:
49
49
  // Not supported
@@ -132,7 +132,7 @@ class2seq_flags_value(VALUE klass) {
132
132
  else if (klass == cCvPoint3D32f::rb_class()) {
133
133
  seq_flags = CV_SEQ_ELTYPE_POINT3D;
134
134
  }
135
- else if (klass == rb_cFixnum) {
135
+ else if (klass == rb_cInteger) {
136
136
  seq_flags = CV_SEQ_ELTYPE_INDEX;
137
137
  }
138
138
  else {
@@ -146,14 +146,14 @@ class2seq_flags_value(VALUE klass) {
146
146
  * Constructor
147
147
  *
148
148
  * @overload new(seq_flags, storage = nil)
149
- * @param [Fixnum] seq_flags Flags of the created sequence, which are combinations of
149
+ * @param [Integer] seq_flags Flags of the created sequence, which are combinations of
150
150
  * the element types and sequence types.
151
151
  * - Element type:
152
152
  * - <tt>CV_SEQ_ELTYPE_POINT</tt>: {CvPoint}
153
153
  * - <tt>CV_32FC2</tt>: {CvPoint2D32f}
154
154
  * - <tt>CV_SEQ_ELTYPE_POINT3D</tt>: {CvPoint3D32f}
155
- * - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Fixnum
156
- * - <tt>CV_SEQ_ELTYPE_CODE</tt>: Fixnum (Freeman code)
155
+ * - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Integer
156
+ * - <tt>CV_SEQ_ELTYPE_CODE</tt>: Integer (Freeman code)
157
157
  * - Sequence type:
158
158
  * - <tt>CV_SEQ_KIND_GENERIC</tt>: Generic sequence
159
159
  * - <tt>CV_SEQ_KIND_CURVE</tt>: Curve
@@ -421,7 +421,7 @@ rb_pop(VALUE self)
421
421
  VALUE object = Qnil;
422
422
  VALUE klass = seqblock_class(seq);
423
423
  try {
424
- if (klass == rb_cFixnum) {
424
+ if (klass == rb_cInteger) {
425
425
  int n = 0;
426
426
  cvSeqPop(seq, &n);
427
427
  object = INT2FIX(n);
@@ -489,7 +489,7 @@ rb_shift(VALUE self)
489
489
 
490
490
  VALUE object = Qnil;
491
491
  try {
492
- if (seqblock_class(seq) == rb_cFixnum) {
492
+ if (seqblock_class(seq) == rb_cInteger) {
493
493
  int n = 0;
494
494
  cvSeqPopFront(seq, &n);
495
495
  object = INT2NUM(n);
@@ -525,7 +525,7 @@ rb_each(VALUE self)
525
525
  if (seq->total > 0) {
526
526
  VALUE klass = seqblock_class(seq);
527
527
  try {
528
- if (klass == rb_cFixnum)
528
+ if (klass == rb_cInteger)
529
529
  for (int i = 0; i < seq->total; ++i)
530
530
  rb_yield(INT2NUM(*CV_GET_SEQ_ELEM(int, seq, i)));
531
531
  else
@@ -567,10 +567,10 @@ rb_insert(VALUE self, VALUE index, VALUE object)
567
567
  Check_Type(index, T_FIXNUM);
568
568
  CvSeq *seq = CVSEQ(self);
569
569
  VALUE klass = seqblock_class(seq);
570
- if (CLASS_OF(object) != klass)
570
+ if (!rb_obj_is_kind_of(object, klass))
571
571
  rb_raise(rb_eTypeError, "arguments should be %s.", rb_class2name(klass));
572
572
  try {
573
- if (klass == rb_cFixnum) {
573
+ if (klass == rb_cInteger) {
574
574
  int n = NUM2INT(object);
575
575
  cvSeqInsert(seq, NUM2INT(index), &n);
576
576
  }
@@ -12,7 +12,7 @@
12
12
  * Document-class: OpenCV::CvSize
13
13
  *
14
14
  * This class means one size on X axis Y axis.
15
- * X and Y takes the value of the Fixnum.
15
+ * X and Y takes the value of the Integer.
16
16
  *
17
17
  * C structure is here, very simple.
18
18
  * typdef struct CvSize {
@@ -12,7 +12,7 @@
12
12
  * Document-class: OpenCV::CvTwoPoints
13
13
  *
14
14
  * This class means one twopoints on X axis Y axis.
15
- * X and Y takes the value of the Fixnum. see also CvTwopoints2D32F
15
+ * X and Y takes the value of the Integer. see also CvTwopoints2D32F
16
16
  *
17
17
  * C structure is here, very simple.
18
18
  * typdef struct CvTwopoints {
@@ -193,7 +193,7 @@ rb_reset_roi(VALUE self)
193
193
  }
194
194
 
195
195
  /*
196
- * Return COI as Fixnum.
196
+ * Return COI as Integer.
197
197
  */
198
198
  VALUE
199
199
  rb_get_coi(VALUE self)
@@ -213,7 +213,7 @@ rb_get_coi(VALUE self)
213
213
  * set_coi(coi)
214
214
  * set_coi(coi){|image| ...}
215
215
  *
216
- * Set COI. <i>coi</i> should be Fixnum.
216
+ * Set COI. <i>coi</i> should be Integer.
217
217
  * Return self.
218
218
  */
219
219
  VALUE
@@ -47,7 +47,7 @@ void trackbar_free(void *ptr) {
47
47
  *
48
48
  * Create new Trackbar.
49
49
  * <i>name</i> should be String.
50
- * <i>maxval</i> and <i>val</i> should be Fixnum.
50
+ * <i>maxval</i> and <i>val</i> should be Integer.
51
51
  * When Trackbar adjuster changed, block will be called.
52
52
  */
53
53
  VALUE rb_initialize(int argc, VALUE *argv, VALUE self) {
@@ -1,3 +1,3 @@
1
1
  module OpenCV
2
- VERSION = '0.0.17'
2
+ VERSION = '0.0.18'
3
3
  end
@@ -1,15 +1,15 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ruby-opencv 0.0.17.20160717014809 ruby lib
2
+ # stub: ruby-opencv 0.0.18.20170306223602 ruby lib
3
3
  # stub: ext/opencv/extconf.rb
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "ruby-opencv".freeze
7
- s.version = "0.0.17"
7
+ s.version = "0.0.18.20170306223602"
8
8
 
9
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
10
10
  s.require_paths = ["lib".freeze]
11
11
  s.authors = ["lsxi".freeze, "ser1zw".freeze, "pcting".freeze]
12
- s.date = "2016-07-16"
12
+ s.date = "2017-03-06"
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.".freeze
14
14
  s.email = ["masakazu.yonekura@gmail.com".freeze, "azariahsawtikes@gmail.com".freeze, "pcting@gmail.com".freeze]
15
15
  s.extensions = ["ext/opencv/extconf.rb".freeze]
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.homepage = "https://github.com/ruby-opencv/ruby-opencv/".freeze
19
19
  s.licenses = ["BSD-3-Clause".freeze]
20
20
  s.rdoc_options = ["--main".freeze, "README.md".freeze]
21
- s.rubygems_version = "2.6.6".freeze
21
+ s.rubygems_version = "2.6.10".freeze
22
22
  s.summary = "OpenCV wrapper for Ruby".freeze
23
23
 
24
24
  if s.respond_to? :specification_version then
@@ -18,7 +18,7 @@ class TestCvAvgComp < OpenCVTestCase
18
18
  end
19
19
 
20
20
  def test_neighbors
21
- assert_equal(Fixnum, @avgcomp.neighbors.class)
21
+ assert_kind_of(Integer, @avgcomp.neighbors)
22
22
  end
23
23
  end
24
24
 
@@ -42,7 +42,7 @@ class TestCvChain < OpenCVTestCase
42
42
  }
43
43
  chain = mat0.find_contours(:mode => CV_RETR_EXTERNAL, :method => CV_CHAIN_CODE)
44
44
  assert_equal(Array, chain.codes.class)
45
- assert(chain.codes.all? { |a| (a.class == Fixnum) and (a >= 0 and a <= 7) })
45
+ assert(chain.codes.all? { |a| (Integer === a) and (a >= 0 and a <= 7) })
46
46
  end
47
47
 
48
48
  def test_points
@@ -67,7 +67,7 @@ class TestCvSeq < OpenCVTestCase
67
67
 
68
68
  seq2 = CvSeq.new(CV_SEQ_ELTYPE_INDEX)
69
69
  seq2.push(10, 20, 30)
70
- assert_equal(Fixnum, seq2[0].class)
70
+ assert_kind_of(Integer, seq2[0])
71
71
  assert_equal(10, seq2[0])
72
72
  assert_equal(20, seq2[1])
73
73
  assert_equal(30, seq2[2])
@@ -101,7 +101,7 @@ class TestCvSeq < OpenCVTestCase
101
101
  seq4 = CvSeq.new(CV_SEQ_ELTYPE_INDEX).push(20, 30)
102
102
  seq3.push(seq4)
103
103
  assert_equal(3, seq3.total)
104
- assert_equal(Fixnum, seq3[0].class)
104
+ assert_kind_of(Integer, seq3[0])
105
105
  assert_equal(10, seq3[0])
106
106
  assert_equal(20, seq3[1])
107
107
  assert_equal(30, seq3[2])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-opencv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
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-07-16 00:00:00.000000000 Z
13
+ date: 2017-03-06 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.6.6
349
+ rubygems_version: 2.6.10
350
350
  signing_key:
351
351
  specification_version: 4
352
352
  summary: OpenCV wrapper for Ruby