ruby-opencv 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/opencv/cvseq.cpp +1 -1
- data/ext/opencv/facerecognizer.cpp +38 -0
- data/ext/opencv/opencv.h +6 -0
- data/lib/opencv/version.rb +1 -1
- data/ruby-opencv.gemspec +29 -30
- data/test/test_lbph.rb +14 -0
- data/test/test_opencv.rb +3 -3
- metadata +6 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40401c95ab8f679c62f524003fe0a0c43abb0681
|
4
|
+
data.tar.gz: ffe7858c51e1ccb47c416cd465a6a0061a3c8cc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e298023316425072af0c0ed97e681a31b8526cc1014d57ab4cfec3df804195582824b81a435676fc45d479f79d3e6de4c1a87359a6bf2ec74b4be746d7bf7bf
|
7
|
+
data.tar.gz: aec9e0aa7e67b5f500ca1131b52d8a4de62ca167e535398329eb09c53727e9bc2a916b114f81a93bda0dbc1a5d70e9349eab2d5df70a22d8fa80d7262b5d46fa
|
data/README.md
CHANGED
data/ext/opencv/cvseq.cpp
CHANGED
@@ -83,6 +83,43 @@ rb_train(VALUE self, VALUE src, VALUE labels)
|
|
83
83
|
return Qnil;
|
84
84
|
}
|
85
85
|
|
86
|
+
/*
|
87
|
+
* call-seq:
|
88
|
+
* udpate(src, labels)
|
89
|
+
*
|
90
|
+
* Updates a FaceRecognizer with given data and associated labels. Only valid on LBPH models.
|
91
|
+
*/
|
92
|
+
VALUE
|
93
|
+
rb_update(VALUE self, VALUE src, VALUE labels)
|
94
|
+
{
|
95
|
+
Check_Type(src, T_ARRAY);
|
96
|
+
Check_Type(labels, T_ARRAY);
|
97
|
+
|
98
|
+
VALUE *src_ptr = RARRAY_PTR(src);
|
99
|
+
int src_size = RARRAY_LEN(src);
|
100
|
+
std::vector<cv::Mat> images;
|
101
|
+
for (int i = 0; i < src_size; i++) {
|
102
|
+
images.push_back(cv::Mat(CVMAT_WITH_CHECK(src_ptr[i])));
|
103
|
+
}
|
104
|
+
|
105
|
+
VALUE *labels_ptr = RARRAY_PTR(labels);
|
106
|
+
int labels_size = RARRAY_LEN(labels);
|
107
|
+
std::vector<int> local_labels;
|
108
|
+
for (int i = 0; i < labels_size; i++) {
|
109
|
+
local_labels.push_back(NUM2INT(labels_ptr[i]));
|
110
|
+
}
|
111
|
+
|
112
|
+
cv::FaceRecognizer *self_ptr = FACERECOGNIZER(self);
|
113
|
+
try {
|
114
|
+
self_ptr->update(images, local_labels);
|
115
|
+
}
|
116
|
+
catch (cv::Exception& e) {
|
117
|
+
raise_cverror(e);
|
118
|
+
}
|
119
|
+
|
120
|
+
return Qnil;
|
121
|
+
}
|
122
|
+
|
86
123
|
/*
|
87
124
|
* call-seq:
|
88
125
|
* predict(src)
|
@@ -171,6 +208,7 @@ init_ruby_class()
|
|
171
208
|
VALUE alghorithm = cAlgorithm::rb_class();
|
172
209
|
rb_klass = rb_define_class_under(opencv, "FaceRecognizer", alghorithm);
|
173
210
|
rb_define_method(rb_klass, "train", RUBY_METHOD_FUNC(rb_train), 2);
|
211
|
+
rb_define_method(rb_klass, "update", RUBY_METHOD_FUNC(rb_update), 2);
|
174
212
|
rb_define_method(rb_klass, "predict", RUBY_METHOD_FUNC(rb_predict), 1);
|
175
213
|
rb_define_method(rb_klass, "save", RUBY_METHOD_FUNC(rb_save), 1);
|
176
214
|
rb_define_method(rb_klass, "load", RUBY_METHOD_FUNC(rb_load), 1);
|
data/ext/opencv/opencv.h
CHANGED
@@ -21,6 +21,12 @@
|
|
21
21
|
#include <version.h>
|
22
22
|
#endif
|
23
23
|
|
24
|
+
// Workaround for https://bugs.ruby-lang.org/issues/11962
|
25
|
+
#undef RB_OBJ_WB_UNPROTECT_FOR
|
26
|
+
#define RB_OBJ_WB_UNPROTECT_FOR(type, obj) \
|
27
|
+
(RGENGC_WB_PROTECTED_##type ? \
|
28
|
+
OBJ_WB_UNPROTECT((VALUE)(obj)) : ((VALUE)(obj)))
|
29
|
+
|
24
30
|
#ifdef RUBY_WIN32_H
|
25
31
|
#ifdef write
|
26
32
|
#undef write
|
data/lib/opencv/version.rb
CHANGED
data/ruby-opencv.gemspec
CHANGED
@@ -1,45 +1,44 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ruby-opencv 0.0.
|
2
|
+
# stub: ruby-opencv 0.0.15.20160408012232 ruby lib
|
3
3
|
# stub: ext/opencv/extconf.rb
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name = "ruby-opencv"
|
7
|
-
s.version = "0.0.
|
6
|
+
s.name = "ruby-opencv".freeze
|
7
|
+
s.version = "0.0.15.20160408012232"
|
8
8
|
|
9
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
|
-
s.require_paths = ["lib"]
|
11
|
-
s.authors = ["lsxi", "ser1zw", "pcting"]
|
12
|
-
s.date = "
|
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
|
-
s.email = ["masakazu.yonekura@gmail.com", "azariahsawtikes@gmail.com", "pcting@gmail.com"]
|
15
|
-
s.extensions = ["ext/opencv/extconf.rb"]
|
16
|
-
s.extra_rdoc_files = ["DEVELOPERS_NOTE.md", "History.txt", "License.txt", "Manifest.txt", "README.md", "examples/facerec/readme.md"]
|
17
|
-
s.files = [".gitignore", ".yardopts", "DEVELOPERS_NOTE.md", "Gemfile", "History.txt", "License.txt", "Manifest.txt", "README.md", "Rakefile", "config.yml", "examples/alpha_blend.rb", "examples/contours/bitmap-contours-with-labels.png", "examples/contours/bitmap-contours.png", "examples/contours/bounding-box-detect-canny.rb", "examples/contours/contour_retrieval_modes.rb", "examples/contours/rotated-boxes.jpg", "examples/convexhull.rb", "examples/face_detect.rb", "examples/facerec/create_csv.rb", "examples/facerec/facerec_eigenfaces.rb", "examples/facerec/facerec_fisherfaces.rb", "examples/facerec/facerec_lbph.rb", "examples/facerec/readme.md", "examples/find_obj.rb", "examples/houghcircle.rb", "examples/images/box.png", "examples/images/box_in_scene.png", "examples/images/inpaint.png", "examples/images/lena-256x256.jpg", "examples/images/lena-eyes.jpg", "examples/images/lenna-rotated.jpg", "examples/images/lenna.jpg", "examples/images/stuff.jpg", "examples/images/tiffany.jpg", "examples/inpaint.rb", "examples/match_kdtree.rb", "examples/match_template.rb", "examples/paint.rb", "examples/snake.rb", "ext/opencv/algorithm.cpp", "ext/opencv/algorithm.h", "ext/opencv/curve.cpp", "ext/opencv/curve.h", "ext/opencv/cvavgcomp.cpp", "ext/opencv/cvavgcomp.h", "ext/opencv/cvbox2d.cpp", "ext/opencv/cvbox2d.h", "ext/opencv/cvcapture.cpp", "ext/opencv/cvcapture.h", "ext/opencv/cvchain.cpp", "ext/opencv/cvchain.h", "ext/opencv/cvcircle32f.cpp", "ext/opencv/cvcircle32f.h", "ext/opencv/cvconnectedcomp.cpp", "ext/opencv/cvconnectedcomp.h", "ext/opencv/cvcontour.cpp", "ext/opencv/cvcontour.h", "ext/opencv/cvcontourtree.cpp", "ext/opencv/cvcontourtree.h", "ext/opencv/cvconvexitydefect.cpp", "ext/opencv/cvconvexitydefect.h", "ext/opencv/cverror.cpp", "ext/opencv/cverror.h", "ext/opencv/cvfeaturetree.cpp", "ext/opencv/cvfeaturetree.h", "ext/opencv/cvfont.cpp", "ext/opencv/cvfont.h", "ext/opencv/cvhaarclassifiercascade.cpp", "ext/opencv/cvhaarclassifiercascade.h", "ext/opencv/cvhistogram.cpp", "ext/opencv/cvhistogram.h", "ext/opencv/cvhumoments.cpp", "ext/opencv/cvhumoments.h", "ext/opencv/cvline.cpp", "ext/opencv/cvline.h", "ext/opencv/cvmat.cpp", "ext/opencv/cvmat.h", "ext/opencv/cvmemstorage.cpp", "ext/opencv/cvmemstorage.h", "ext/opencv/cvmoments.cpp", "ext/opencv/cvmoments.h", "ext/opencv/cvpoint.cpp", "ext/opencv/cvpoint.h", "ext/opencv/cvpoint2d32f.cpp", "ext/opencv/cvpoint2d32f.h", "ext/opencv/cvpoint3d32f.cpp", "ext/opencv/cvpoint3d32f.h", "ext/opencv/cvrect.cpp", "ext/opencv/cvrect.h", "ext/opencv/cvscalar.cpp", "ext/opencv/cvscalar.h", "ext/opencv/cvseq.cpp", "ext/opencv/cvseq.h", "ext/opencv/cvsize.cpp", "ext/opencv/cvsize.h", "ext/opencv/cvsize2d32f.cpp", "ext/opencv/cvsize2d32f.h", "ext/opencv/cvslice.cpp", "ext/opencv/cvslice.h", "ext/opencv/cvsurfparams.cpp", "ext/opencv/cvsurfparams.h", "ext/opencv/cvsurfpoint.cpp", "ext/opencv/cvsurfpoint.h", "ext/opencv/cvtermcriteria.cpp", "ext/opencv/cvtermcriteria.h", "ext/opencv/cvtwopoints.cpp", "ext/opencv/cvtwopoints.h", "ext/opencv/cvutils.cpp", "ext/opencv/cvutils.h", "ext/opencv/cvvideowriter.cpp", "ext/opencv/cvvideowriter.h", "ext/opencv/eigenfaces.cpp", "ext/opencv/eigenfaces.h", "ext/opencv/extconf.rb", "ext/opencv/facerecognizer.cpp", "ext/opencv/facerecognizer.h", "ext/opencv/fisherfaces.cpp", "ext/opencv/fisherfaces.h", "ext/opencv/gui.cpp", "ext/opencv/gui.h", "ext/opencv/iplconvkernel.cpp", "ext/opencv/iplconvkernel.h", "ext/opencv/iplimage.cpp", "ext/opencv/iplimage.h", "ext/opencv/lbph.cpp", "ext/opencv/lbph.h", "ext/opencv/mouseevent.cpp", "ext/opencv/mouseevent.h", "ext/opencv/opencv.cpp", "ext/opencv/opencv.h", "ext/opencv/pointset.cpp", "ext/opencv/pointset.h", "ext/opencv/trackbar.cpp", "ext/opencv/trackbar.h", "ext/opencv/window.cpp", "ext/opencv/window.h", "images/CvMat_sobel.png", "images/CvMat_sub_rect.png", "images/CvSeq_relationmap.png", "lib/opencv.rb", "lib/opencv/psyched_yaml.rb", "lib/opencv/version.rb", "ruby-opencv.gemspec", "test/eigenfaces_save.xml", "test/fisherfaces_save.xml", "test/helper.rb", "test/lbph_save.xml", "test/runner.rb", "test/samples/airplane.jpg", "test/samples/baboon.jpg", "test/samples/baboon200.jpg", "test/samples/baboon200_rotated.jpg", "test/samples/blank0.jpg", "test/samples/blank1.jpg", "test/samples/blank2.jpg", "test/samples/blank3.jpg", "test/samples/blank4.jpg", "test/samples/blank5.jpg", "test/samples/blank6.jpg", "test/samples/blank7.jpg", "test/samples/blank8.jpg", "test/samples/blank9.jpg", "test/samples/cat.jpg", "test/samples/chessboard.jpg", "test/samples/contours.jpg", "test/samples/fruits.jpg", "test/samples/haarcascade_frontalface_alt.xml.gz", "test/samples/inpaint-mask.bmp", "test/samples/lena-256x256.jpg", "test/samples/lena-32x32.jpg", "test/samples/lena-eyes.jpg", "test/samples/lena-inpaint.jpg", "test/samples/lena.jpg", "test/samples/lines.jpg", "test/samples/messy0.jpg", "test/samples/messy1.jpg", "test/samples/movie_sample.avi", "test/samples/one_way_train_0000.jpg", "test/samples/one_way_train_0001.jpg", "test/samples/partially_blank0.jpg", "test/samples/partially_blank1.jpg", "test/samples/smooth0.jpg", "test/samples/smooth1.jpg", "test/samples/smooth2.jpg", "test/samples/smooth3.jpg", "test/samples/smooth4.jpg", "test/samples/smooth5.jpg", "test/samples/smooth6.jpg", "test/samples/str-cv-rotated.jpg", "test/samples/str-cv.jpg", "test/samples/str-ov.jpg", "test/samples/stuff.jpg", "test/test_curve.rb", "test/test_cvavgcomp.rb", "test/test_cvbox2d.rb", "test/test_cvcapture.rb", "test/test_cvchain.rb", "test/test_cvcircle32f.rb", "test/test_cvconnectedcomp.rb", "test/test_cvcontour.rb", "test/test_cvcontourtree.rb", "test/test_cverror.rb", "test/test_cvfeaturetree.rb", "test/test_cvfont.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvhistogram.rb", "test/test_cvhumoments.rb", "test/test_cvline.rb", "test/test_cvmat.rb", "test/test_cvmat_drawing.rb", "test/test_cvmat_dxt.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvmoments.rb", "test/test_cvpoint.rb", "test/test_cvpoint2d32f.rb", "test/test_cvpoint3d32f.rb", "test/test_cvrect.rb", "test/test_cvscalar.rb", "test/test_cvseq.rb", "test/test_cvsize.rb", "test/test_cvsize2d32f.rb", "test/test_cvslice.rb", "test/test_cvsurfparams.rb", "test/test_cvsurfpoint.rb", "test/test_cvtermcriteria.rb", "test/test_cvtwopoints.rb", "test/test_cvvideowriter.rb", "test/test_eigenfaces.rb", "test/test_fisherfaces.rb", "test/test_iplconvkernel.rb", "test/test_iplimage.rb", "test/test_lbph.rb", "test/test_mouseevent.rb", "test/test_opencv.rb", "test/test_pointset.rb", "test/test_preliminary.rb", "test/test_trackbar.rb", "test/test_window.rb", "yard_extension.rb"]
|
18
|
-
s.homepage = "https://github.com/ruby-opencv/ruby-opencv/"
|
19
|
-
s.licenses = ["The BSD License"]
|
20
|
-
s.rdoc_options = ["--main", "README.md"]
|
21
|
-
s.rubygems_version = "2.
|
22
|
-
s.summary = "OpenCV wrapper for Ruby"
|
23
|
-
s.test_files = ["test/test_trackbar.rb", "test/test_cvhistogram.rb", "test/test_cvpoint.rb", "test/test_cvmat_dxt.rb", "test/test_iplconvkernel.rb", "test/test_cvconnectedcomp.rb", "test/test_curve.rb", "test/test_mouseevent.rb", "test/test_cvsurfpoint.rb", "test/test_eigenfaces.rb", "test/test_cvtwopoints.rb", "test/test_cvbox2d.rb", "test/test_cvmat_imageprocessing.rb", "test/test_cvtermcriteria.rb", "test/test_fisherfaces.rb", "test/test_cvvideowriter.rb", "test/test_cvmoments.rb", "test/test_cvsize2d32f.rb", "test/test_cvsize.rb", "test/test_cvcircle32f.rb", "test/test_cvavgcomp.rb", "test/test_cvscalar.rb", "test/test_cvhaarclassifiercascade.rb", "test/test_cvrect.rb", "test/test_cvfont.rb", "test/test_cvmat_drawing.rb", "test/test_cvhumoments.rb", "test/test_cvmat.rb", "test/test_cvcapture.rb", "test/test_pointset.rb", "test/test_cvcontour.rb", "test/test_opencv.rb", "test/test_cvline.rb", "test/test_lbph.rb", "test/test_iplimage.rb", "test/test_cvcontourtree.rb", "test/test_window.rb", "test/test_cvpoint3d32f.rb", "test/test_cvseq.rb", "test/test_preliminary.rb", "test/test_cvsurfparams.rb", "test/test_cvchain.rb", "test/test_cvfeaturetree.rb", "test/test_cvpoint2d32f.rb", "test/test_cverror.rb", "test/test_cvslice.rb"]
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
10
|
+
s.require_paths = ["lib".freeze]
|
11
|
+
s.authors = ["lsxi".freeze, "ser1zw".freeze, "pcting".freeze]
|
12
|
+
s.date = "2016-04-07"
|
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
|
+
s.email = ["masakazu.yonekura@gmail.com".freeze, "azariahsawtikes@gmail.com".freeze, "pcting@gmail.com".freeze]
|
15
|
+
s.extensions = ["ext/opencv/extconf.rb".freeze]
|
16
|
+
s.extra_rdoc_files = ["DEVELOPERS_NOTE.md".freeze, "History.txt".freeze, "License.txt".freeze, "Manifest.txt".freeze, "README.md".freeze, "examples/facerec/readme.md".freeze]
|
17
|
+
s.files = [".gitignore".freeze, ".yardopts".freeze, "DEVELOPERS_NOTE.md".freeze, "Gemfile".freeze, "History.txt".freeze, "License.txt".freeze, "Manifest.txt".freeze, "README.md".freeze, "Rakefile".freeze, "config.yml".freeze, "examples/alpha_blend.rb".freeze, "examples/contours/bitmap-contours-with-labels.png".freeze, "examples/contours/bitmap-contours.png".freeze, "examples/contours/bounding-box-detect-canny.rb".freeze, "examples/contours/contour_retrieval_modes.rb".freeze, "examples/contours/rotated-boxes.jpg".freeze, "examples/convexhull.rb".freeze, "examples/face_detect.rb".freeze, "examples/facerec/create_csv.rb".freeze, "examples/facerec/facerec_eigenfaces.rb".freeze, "examples/facerec/facerec_fisherfaces.rb".freeze, "examples/facerec/facerec_lbph.rb".freeze, "examples/facerec/readme.md".freeze, "examples/find_obj.rb".freeze, "examples/houghcircle.rb".freeze, "examples/images/box.png".freeze, "examples/images/box_in_scene.png".freeze, "examples/images/inpaint.png".freeze, "examples/images/lena-256x256.jpg".freeze, "examples/images/lena-eyes.jpg".freeze, "examples/images/lenna-rotated.jpg".freeze, "examples/images/lenna.jpg".freeze, "examples/images/stuff.jpg".freeze, "examples/images/tiffany.jpg".freeze, "examples/inpaint.rb".freeze, "examples/match_kdtree.rb".freeze, "examples/match_template.rb".freeze, "examples/paint.rb".freeze, "examples/snake.rb".freeze, "ext/opencv/algorithm.cpp".freeze, "ext/opencv/algorithm.h".freeze, "ext/opencv/curve.cpp".freeze, "ext/opencv/curve.h".freeze, "ext/opencv/cvavgcomp.cpp".freeze, "ext/opencv/cvavgcomp.h".freeze, "ext/opencv/cvbox2d.cpp".freeze, "ext/opencv/cvbox2d.h".freeze, "ext/opencv/cvcapture.cpp".freeze, "ext/opencv/cvcapture.h".freeze, "ext/opencv/cvchain.cpp".freeze, "ext/opencv/cvchain.h".freeze, "ext/opencv/cvcircle32f.cpp".freeze, "ext/opencv/cvcircle32f.h".freeze, "ext/opencv/cvconnectedcomp.cpp".freeze, "ext/opencv/cvconnectedcomp.h".freeze, "ext/opencv/cvcontour.cpp".freeze, "ext/opencv/cvcontour.h".freeze, "ext/opencv/cvcontourtree.cpp".freeze, "ext/opencv/cvcontourtree.h".freeze, "ext/opencv/cvconvexitydefect.cpp".freeze, "ext/opencv/cvconvexitydefect.h".freeze, "ext/opencv/cverror.cpp".freeze, "ext/opencv/cverror.h".freeze, "ext/opencv/cvfeaturetree.cpp".freeze, "ext/opencv/cvfeaturetree.h".freeze, "ext/opencv/cvfont.cpp".freeze, "ext/opencv/cvfont.h".freeze, "ext/opencv/cvhaarclassifiercascade.cpp".freeze, "ext/opencv/cvhaarclassifiercascade.h".freeze, "ext/opencv/cvhistogram.cpp".freeze, "ext/opencv/cvhistogram.h".freeze, "ext/opencv/cvhumoments.cpp".freeze, "ext/opencv/cvhumoments.h".freeze, "ext/opencv/cvline.cpp".freeze, "ext/opencv/cvline.h".freeze, "ext/opencv/cvmat.cpp".freeze, "ext/opencv/cvmat.h".freeze, "ext/opencv/cvmemstorage.cpp".freeze, "ext/opencv/cvmemstorage.h".freeze, "ext/opencv/cvmoments.cpp".freeze, "ext/opencv/cvmoments.h".freeze, "ext/opencv/cvpoint.cpp".freeze, "ext/opencv/cvpoint.h".freeze, "ext/opencv/cvpoint2d32f.cpp".freeze, "ext/opencv/cvpoint2d32f.h".freeze, "ext/opencv/cvpoint3d32f.cpp".freeze, "ext/opencv/cvpoint3d32f.h".freeze, "ext/opencv/cvrect.cpp".freeze, "ext/opencv/cvrect.h".freeze, "ext/opencv/cvscalar.cpp".freeze, "ext/opencv/cvscalar.h".freeze, "ext/opencv/cvseq.cpp".freeze, "ext/opencv/cvseq.h".freeze, "ext/opencv/cvsize.cpp".freeze, "ext/opencv/cvsize.h".freeze, "ext/opencv/cvsize2d32f.cpp".freeze, "ext/opencv/cvsize2d32f.h".freeze, "ext/opencv/cvslice.cpp".freeze, "ext/opencv/cvslice.h".freeze, "ext/opencv/cvsurfparams.cpp".freeze, "ext/opencv/cvsurfparams.h".freeze, "ext/opencv/cvsurfpoint.cpp".freeze, "ext/opencv/cvsurfpoint.h".freeze, "ext/opencv/cvtermcriteria.cpp".freeze, "ext/opencv/cvtermcriteria.h".freeze, "ext/opencv/cvtwopoints.cpp".freeze, "ext/opencv/cvtwopoints.h".freeze, "ext/opencv/cvutils.cpp".freeze, "ext/opencv/cvutils.h".freeze, "ext/opencv/cvvideowriter.cpp".freeze, "ext/opencv/cvvideowriter.h".freeze, "ext/opencv/eigenfaces.cpp".freeze, "ext/opencv/eigenfaces.h".freeze, "ext/opencv/extconf.rb".freeze, "ext/opencv/facerecognizer.cpp".freeze, "ext/opencv/facerecognizer.h".freeze, "ext/opencv/fisherfaces.cpp".freeze, "ext/opencv/fisherfaces.h".freeze, "ext/opencv/gui.cpp".freeze, "ext/opencv/gui.h".freeze, "ext/opencv/iplconvkernel.cpp".freeze, "ext/opencv/iplconvkernel.h".freeze, "ext/opencv/iplimage.cpp".freeze, "ext/opencv/iplimage.h".freeze, "ext/opencv/lbph.cpp".freeze, "ext/opencv/lbph.h".freeze, "ext/opencv/mouseevent.cpp".freeze, "ext/opencv/mouseevent.h".freeze, "ext/opencv/opencv.cpp".freeze, "ext/opencv/opencv.h".freeze, "ext/opencv/pointset.cpp".freeze, "ext/opencv/pointset.h".freeze, "ext/opencv/trackbar.cpp".freeze, "ext/opencv/trackbar.h".freeze, "ext/opencv/window.cpp".freeze, "ext/opencv/window.h".freeze, "images/CvMat_sobel.png".freeze, "images/CvMat_sub_rect.png".freeze, "images/CvSeq_relationmap.png".freeze, "lib/opencv.rb".freeze, "lib/opencv/psyched_yaml.rb".freeze, "lib/opencv/version.rb".freeze, "ruby-opencv.gemspec".freeze, "test/eigenfaces_save.xml".freeze, "test/fisherfaces_save.xml".freeze, "test/helper.rb".freeze, "test/lbph_save.xml".freeze, "test/runner.rb".freeze, "test/samples/airplane.jpg".freeze, "test/samples/baboon.jpg".freeze, "test/samples/baboon200.jpg".freeze, "test/samples/baboon200_rotated.jpg".freeze, "test/samples/blank0.jpg".freeze, "test/samples/blank1.jpg".freeze, "test/samples/blank2.jpg".freeze, "test/samples/blank3.jpg".freeze, "test/samples/blank4.jpg".freeze, "test/samples/blank5.jpg".freeze, "test/samples/blank6.jpg".freeze, "test/samples/blank7.jpg".freeze, "test/samples/blank8.jpg".freeze, "test/samples/blank9.jpg".freeze, "test/samples/cat.jpg".freeze, "test/samples/chessboard.jpg".freeze, "test/samples/contours.jpg".freeze, "test/samples/fruits.jpg".freeze, "test/samples/haarcascade_frontalface_alt.xml.gz".freeze, "test/samples/inpaint-mask.bmp".freeze, "test/samples/lena-256x256.jpg".freeze, "test/samples/lena-32x32.jpg".freeze, "test/samples/lena-eyes.jpg".freeze, "test/samples/lena-inpaint.jpg".freeze, "test/samples/lena.jpg".freeze, "test/samples/lines.jpg".freeze, "test/samples/messy0.jpg".freeze, "test/samples/messy1.jpg".freeze, "test/samples/movie_sample.avi".freeze, "test/samples/one_way_train_0000.jpg".freeze, "test/samples/one_way_train_0001.jpg".freeze, "test/samples/partially_blank0.jpg".freeze, "test/samples/partially_blank1.jpg".freeze, "test/samples/smooth0.jpg".freeze, "test/samples/smooth1.jpg".freeze, "test/samples/smooth2.jpg".freeze, "test/samples/smooth3.jpg".freeze, "test/samples/smooth4.jpg".freeze, "test/samples/smooth5.jpg".freeze, "test/samples/smooth6.jpg".freeze, "test/samples/str-cv-rotated.jpg".freeze, "test/samples/str-cv.jpg".freeze, "test/samples/str-ov.jpg".freeze, "test/samples/stuff.jpg".freeze, "test/test_curve.rb".freeze, "test/test_cvavgcomp.rb".freeze, "test/test_cvbox2d.rb".freeze, "test/test_cvcapture.rb".freeze, "test/test_cvchain.rb".freeze, "test/test_cvcircle32f.rb".freeze, "test/test_cvconnectedcomp.rb".freeze, "test/test_cvcontour.rb".freeze, "test/test_cvcontourtree.rb".freeze, "test/test_cverror.rb".freeze, "test/test_cvfeaturetree.rb".freeze, "test/test_cvfont.rb".freeze, "test/test_cvhaarclassifiercascade.rb".freeze, "test/test_cvhistogram.rb".freeze, "test/test_cvhumoments.rb".freeze, "test/test_cvline.rb".freeze, "test/test_cvmat.rb".freeze, "test/test_cvmat_drawing.rb".freeze, "test/test_cvmat_dxt.rb".freeze, "test/test_cvmat_imageprocessing.rb".freeze, "test/test_cvmoments.rb".freeze, "test/test_cvpoint.rb".freeze, "test/test_cvpoint2d32f.rb".freeze, "test/test_cvpoint3d32f.rb".freeze, "test/test_cvrect.rb".freeze, "test/test_cvscalar.rb".freeze, "test/test_cvseq.rb".freeze, "test/test_cvsize.rb".freeze, "test/test_cvsize2d32f.rb".freeze, "test/test_cvslice.rb".freeze, "test/test_cvsurfparams.rb".freeze, "test/test_cvsurfpoint.rb".freeze, "test/test_cvtermcriteria.rb".freeze, "test/test_cvtwopoints.rb".freeze, "test/test_cvvideowriter.rb".freeze, "test/test_eigenfaces.rb".freeze, "test/test_fisherfaces.rb".freeze, "test/test_iplconvkernel.rb".freeze, "test/test_iplimage.rb".freeze, "test/test_lbph.rb".freeze, "test/test_mouseevent.rb".freeze, "test/test_opencv.rb".freeze, "test/test_pointset.rb".freeze, "test/test_preliminary.rb".freeze, "test/test_trackbar.rb".freeze, "test/test_window.rb".freeze, "yard_extension.rb".freeze]
|
18
|
+
s.homepage = "https://github.com/ruby-opencv/ruby-opencv/".freeze
|
19
|
+
s.licenses = ["The BSD License".freeze]
|
20
|
+
s.rdoc_options = ["--main".freeze, "README.md".freeze]
|
21
|
+
s.rubygems_version = "2.6.2".freeze
|
22
|
+
s.summary = "OpenCV wrapper for Ruby".freeze
|
24
23
|
|
25
24
|
if s.respond_to? :specification_version then
|
26
25
|
s.specification_version = 4
|
27
26
|
|
28
27
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
29
|
-
s.add_development_dependency(%q<rdoc
|
30
|
-
s.add_development_dependency(%q<rake-compiler
|
31
|
-
s.add_development_dependency(%q<hoe-gemspec
|
32
|
-
s.add_development_dependency(%q<hoe
|
28
|
+
s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
29
|
+
s.add_development_dependency(%q<rake-compiler>.freeze, ["~> 0"])
|
30
|
+
s.add_development_dependency(%q<hoe-gemspec>.freeze, ["~> 0"])
|
31
|
+
s.add_development_dependency(%q<hoe>.freeze, ["~> 3.15"])
|
33
32
|
else
|
34
|
-
s.add_dependency(%q<rdoc
|
35
|
-
s.add_dependency(%q<rake-compiler
|
36
|
-
s.add_dependency(%q<hoe-gemspec
|
37
|
-
s.add_dependency(%q<hoe
|
33
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
34
|
+
s.add_dependency(%q<rake-compiler>.freeze, ["~> 0"])
|
35
|
+
s.add_dependency(%q<hoe-gemspec>.freeze, ["~> 0"])
|
36
|
+
s.add_dependency(%q<hoe>.freeze, ["~> 3.15"])
|
38
37
|
end
|
39
38
|
else
|
40
|
-
s.add_dependency(%q<rdoc
|
41
|
-
s.add_dependency(%q<rake-compiler
|
42
|
-
s.add_dependency(%q<hoe-gemspec
|
43
|
-
s.add_dependency(%q<hoe
|
39
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 4.0"])
|
40
|
+
s.add_dependency(%q<rake-compiler>.freeze, ["~> 0"])
|
41
|
+
s.add_dependency(%q<hoe-gemspec>.freeze, ["~> 0"])
|
42
|
+
s.add_dependency(%q<hoe>.freeze, ["~> 3.15"])
|
44
43
|
end
|
45
44
|
end
|
data/test/test_lbph.rb
CHANGED
@@ -13,6 +13,7 @@ class TestLBPH < OpenCVTestCase
|
|
13
13
|
@lbph = LBPH.new
|
14
14
|
|
15
15
|
@lbph_trained = LBPH.new
|
16
|
+
@lbph_update = LBPH.new
|
16
17
|
@images = [CvMat.load(FILENAME_LENA256x256, CV_LOAD_IMAGE_GRAYSCALE)] * 2
|
17
18
|
@labels = [1, 2]
|
18
19
|
@lbph_trained.train(@images, @labels)
|
@@ -52,6 +53,19 @@ class TestLBPH < OpenCVTestCase
|
|
52
53
|
}
|
53
54
|
end
|
54
55
|
|
56
|
+
def test_update
|
57
|
+
assert_nil(@lbph_update.train([@images[0]], [@labels[0]]))
|
58
|
+
assert_nil(@lbph_update.update([@images[1]], [@labels[1]]))
|
59
|
+
|
60
|
+
assert_raise(TypeError) {
|
61
|
+
@lbph_update.update(DUMMY_OBJ, @labels)
|
62
|
+
}
|
63
|
+
|
64
|
+
assert_raise(TypeError) {
|
65
|
+
@lbph_update.update(@images, DUMMY_OBJ)
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
55
69
|
def test_predict
|
56
70
|
predicted_label, predicted_confidence = @lbph_trained.predict(@images[0])
|
57
71
|
assert_equal(@labels[0], predicted_label)
|
data/test/test_opencv.rb
CHANGED
@@ -9,14 +9,14 @@ include OpenCV
|
|
9
9
|
class TestOpenCV < OpenCVTestCase
|
10
10
|
def test_constants
|
11
11
|
# OpenCV version
|
12
|
-
assert_equal('2.4.
|
12
|
+
assert_equal('2.4.12', CV_VERSION)
|
13
13
|
assert_equal(2, CV_MAJOR_VERSION)
|
14
14
|
assert_equal(4, CV_MINOR_VERSION)
|
15
|
-
assert_equal(
|
15
|
+
assert_equal(12, CV_SUBMINOR_VERSION)
|
16
16
|
|
17
17
|
assert_equal(2, CV_VERSION_EPOCH)
|
18
18
|
assert_equal(4, CV_VERSION_MAJOR)
|
19
|
-
assert_equal(
|
19
|
+
assert_equal(12, CV_VERSION_MINOR)
|
20
20
|
assert_equal(0, CV_VERSION_REVISION)
|
21
21
|
|
22
22
|
# Depths
|
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.
|
4
|
+
version: 0.0.15
|
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:
|
13
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdoc
|
@@ -60,14 +60,14 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '3.
|
63
|
+
version: '3.15'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: '3.
|
70
|
+
version: '3.15'
|
71
71
|
description: ruby-opencv is a wrapper of OpenCV for Ruby. It helps you to write computer
|
72
72
|
vision programs (e.g. detecting faces from pictures) with Ruby.
|
73
73
|
email:
|
@@ -346,54 +346,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
346
346
|
version: '0'
|
347
347
|
requirements: []
|
348
348
|
rubyforge_project:
|
349
|
-
rubygems_version: 2.
|
349
|
+
rubygems_version: 2.6.2
|
350
350
|
signing_key:
|
351
351
|
specification_version: 4
|
352
352
|
summary: OpenCV wrapper for Ruby
|
353
|
-
test_files:
|
354
|
-
- test/test_trackbar.rb
|
355
|
-
- test/test_cvhistogram.rb
|
356
|
-
- test/test_cvpoint.rb
|
357
|
-
- test/test_cvmat_dxt.rb
|
358
|
-
- test/test_iplconvkernel.rb
|
359
|
-
- test/test_cvconnectedcomp.rb
|
360
|
-
- test/test_curve.rb
|
361
|
-
- test/test_mouseevent.rb
|
362
|
-
- test/test_cvsurfpoint.rb
|
363
|
-
- test/test_eigenfaces.rb
|
364
|
-
- test/test_cvtwopoints.rb
|
365
|
-
- test/test_cvbox2d.rb
|
366
|
-
- test/test_cvmat_imageprocessing.rb
|
367
|
-
- test/test_cvtermcriteria.rb
|
368
|
-
- test/test_fisherfaces.rb
|
369
|
-
- test/test_cvvideowriter.rb
|
370
|
-
- test/test_cvmoments.rb
|
371
|
-
- test/test_cvsize2d32f.rb
|
372
|
-
- test/test_cvsize.rb
|
373
|
-
- test/test_cvcircle32f.rb
|
374
|
-
- test/test_cvavgcomp.rb
|
375
|
-
- test/test_cvscalar.rb
|
376
|
-
- test/test_cvhaarclassifiercascade.rb
|
377
|
-
- test/test_cvrect.rb
|
378
|
-
- test/test_cvfont.rb
|
379
|
-
- test/test_cvmat_drawing.rb
|
380
|
-
- test/test_cvhumoments.rb
|
381
|
-
- test/test_cvmat.rb
|
382
|
-
- test/test_cvcapture.rb
|
383
|
-
- test/test_pointset.rb
|
384
|
-
- test/test_cvcontour.rb
|
385
|
-
- test/test_opencv.rb
|
386
|
-
- test/test_cvline.rb
|
387
|
-
- test/test_lbph.rb
|
388
|
-
- test/test_iplimage.rb
|
389
|
-
- test/test_cvcontourtree.rb
|
390
|
-
- test/test_window.rb
|
391
|
-
- test/test_cvpoint3d32f.rb
|
392
|
-
- test/test_cvseq.rb
|
393
|
-
- test/test_preliminary.rb
|
394
|
-
- test/test_cvsurfparams.rb
|
395
|
-
- test/test_cvchain.rb
|
396
|
-
- test/test_cvfeaturetree.rb
|
397
|
-
- test/test_cvpoint2d32f.rb
|
398
|
-
- test/test_cverror.rb
|
399
|
-
- test/test_cvslice.rb
|
353
|
+
test_files: []
|