bonanza-ruby-opencv 0.0.13.20160621111908 → 0.0.13.20160627234042

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/opencv/cvmat.cpp +14 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9db0b94905f6087fa029acc9c129281308832420
4
- data.tar.gz: 0a14b2216cfe58ca0eac122a4771fec9c5ef667d
3
+ metadata.gz: 9d7ecce3c50d33f67eaa351e32a2bc562203c9ec
4
+ data.tar.gz: dabfb5e08f516da564e9309b40bc54d0e55a539b
5
5
  SHA512:
6
- metadata.gz: 6c792de42ba8042d613b1821bf12f437bf7354736eb4347f458946eb8957f19cda09f3f642d26ed8e27b08d9bb229aa84b3a4c25603f3714b96b509db7fa0683
7
- data.tar.gz: 62157065d7794ce7f3ec08ad8bd4fe94d7b17632621d7bc239bc7f79ffb7d8be81f10e5ba93d8afb38b018d2fe14f6411a965959965ee4eb0f8dc40964a14a16
6
+ metadata.gz: 199202edb9d324d5d987022345d2c9f1b0619975d83ca1998bf73e19b833d10bb363c63d2867dc1fd764492912a7cd0947d2e9dee5c8fa56e6a615d18f65f7c2
7
+ data.tar.gz: d83c0bed5148e56ef34160625ffbee24c2d60c5e401ee85dde5f1e0a5eda8baf019d69fbbe13aaeb5b6afd5f3ddc321bff94bb33be408c797ec7d87fceb4cda1
data/ext/opencv/cvmat.cpp CHANGED
@@ -5432,6 +5432,19 @@ rb_watershed(VALUE self, VALUE markers)
5432
5432
  return markers;
5433
5433
  }
5434
5434
 
5435
+ VALUE
5436
+ rb_kmeans(VALUE self, VALUE k, VALUE termcrit)
5437
+ {
5438
+ VALUE labels = new_object(CVMAT(self)->height, 1, CV_32SC1);
5439
+ try {
5440
+ cvKMeans2(CVARR(self), NUM2INT(k), CVARR(labels), *CVTERMCRITERIA(termcrit));
5441
+ }
5442
+ catch (cv::Exception& e) {
5443
+ raise_cverror(e);
5444
+ }
5445
+ return labels;
5446
+ }
5447
+
5435
5448
  /*
5436
5449
  * call-seq:
5437
5450
  * grab_cut -> cvmat(mask:cv8uc1)
@@ -6840,6 +6853,7 @@ init_ruby_class()
6840
6853
  rb_define_method(rb_klass, "draw_chessboard_corners!", RUBY_METHOD_FUNC(rb_draw_chessboard_corners_bang), 3);
6841
6854
  rb_define_method(rb_klass, "pyr_mean_shift_filtering", RUBY_METHOD_FUNC(rb_pyr_mean_shift_filtering), -1);
6842
6855
  rb_define_method(rb_klass, "watershed", RUBY_METHOD_FUNC(rb_watershed), 1);
6856
+ rb_define_method(rb_klass, "kmeans", RUBY_METHOD_FUNC(rb_kmeans), 2);
6843
6857
  rb_define_method(rb_klass, "grab_cut", RUBY_METHOD_FUNC(rb_grab_cut), 6);
6844
6858
  rb_define_method(rb_klass, "grab_cut2", RUBY_METHOD_FUNC(rb_grab_cut2), 10);
6845
6859
 
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.20160621111908
4
+ version: 0.0.13.20160627234042
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-06-21 00:00:00.000000000 Z
13
+ date: 2016-06-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rdoc