ruby-opencv 0.0.11 → 0.0.12.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.yardopts +3 -0
  4. data/Gemfile +1 -0
  5. data/Manifest.txt +2 -14
  6. data/README.md +1 -1
  7. data/Rakefile +10 -1
  8. data/examples/facerec/facerec_lbph.rb +1 -1
  9. data/ext/opencv/algorithm.cpp +6 -1
  10. data/ext/opencv/algorithm.h +1 -1
  11. data/ext/opencv/curve.cpp +48 -33
  12. data/ext/opencv/curve.h +1 -1
  13. data/ext/opencv/cvavgcomp.cpp +22 -25
  14. data/ext/opencv/cvavgcomp.h +1 -1
  15. data/ext/opencv/cvbox2d.cpp +56 -58
  16. data/ext/opencv/cvbox2d.h +1 -1
  17. data/ext/opencv/cvcapture.cpp +210 -109
  18. data/ext/opencv/cvcapture.h +1 -1
  19. data/ext/opencv/cvchain.cpp +71 -71
  20. data/ext/opencv/cvchain.h +1 -1
  21. data/ext/opencv/cvcircle32f.cpp +37 -27
  22. data/ext/opencv/cvcircle32f.h +1 -1
  23. data/ext/opencv/cvconnectedcomp.cpp +49 -36
  24. data/ext/opencv/cvconnectedcomp.h +1 -1
  25. data/ext/opencv/cvcontour.cpp +117 -81
  26. data/ext/opencv/cvcontour.h +1 -1
  27. data/ext/opencv/cvcontourtree.cpp +37 -32
  28. data/ext/opencv/cvcontourtree.h +1 -1
  29. data/ext/opencv/cvconvexitydefect.cpp +33 -44
  30. data/ext/opencv/cvconvexitydefect.h +1 -1
  31. data/ext/opencv/cverror.cpp +22 -66
  32. data/ext/opencv/cverror.h +1 -1
  33. data/ext/opencv/cvfeaturetree.cpp +31 -33
  34. data/ext/opencv/cvfeaturetree.h +1 -1
  35. data/ext/opencv/cvfont.cpp +98 -78
  36. data/ext/opencv/cvfont.h +1 -1
  37. data/ext/opencv/cvhaarclassifiercascade.cpp +39 -59
  38. data/ext/opencv/cvhaarclassifiercascade.h +1 -1
  39. data/ext/opencv/cvhistogram.cpp +259 -90
  40. data/ext/opencv/cvhistogram.h +1 -1
  41. data/ext/opencv/cvhumoments.cpp +99 -60
  42. data/ext/opencv/cvhumoments.h +1 -1
  43. data/ext/opencv/cvline.cpp +45 -40
  44. data/ext/opencv/cvline.h +1 -1
  45. data/ext/opencv/cvmat.cpp +1894 -1829
  46. data/ext/opencv/cvmat.h +2 -3
  47. data/ext/opencv/cvmemstorage.cpp +19 -14
  48. data/ext/opencv/cvmemstorage.h +1 -1
  49. data/ext/opencv/cvmoments.cpp +51 -45
  50. data/ext/opencv/cvmoments.h +1 -1
  51. data/ext/opencv/cvpoint.cpp +32 -26
  52. data/ext/opencv/cvpoint.h +1 -1
  53. data/ext/opencv/cvpoint2d32f.cpp +31 -26
  54. data/ext/opencv/cvpoint2d32f.h +1 -1
  55. data/ext/opencv/cvpoint3d32f.cpp +36 -29
  56. data/ext/opencv/cvpoint3d32f.h +1 -1
  57. data/ext/opencv/cvrect.cpp +38 -33
  58. data/ext/opencv/cvrect.h +1 -1
  59. data/ext/opencv/cvscalar.cpp +50 -45
  60. data/ext/opencv/cvscalar.h +1 -1
  61. data/ext/opencv/cvseq.cpp +53 -47
  62. data/ext/opencv/cvseq.h +1 -1
  63. data/ext/opencv/cvsize.cpp +32 -26
  64. data/ext/opencv/cvsize.h +1 -1
  65. data/ext/opencv/cvsize2d32f.cpp +31 -25
  66. data/ext/opencv/cvsize2d32f.h +1 -1
  67. data/ext/opencv/cvslice.cpp +28 -22
  68. data/ext/opencv/cvslice.h +1 -1
  69. data/ext/opencv/cvsurfparams.cpp +37 -28
  70. data/ext/opencv/cvsurfparams.h +1 -1
  71. data/ext/opencv/cvsurfpoint.cpp +76 -53
  72. data/ext/opencv/cvsurfpoint.h +1 -1
  73. data/ext/opencv/cvtermcriteria.cpp +32 -26
  74. data/ext/opencv/cvtermcriteria.h +1 -1
  75. data/ext/opencv/cvtwopoints.cpp +28 -22
  76. data/ext/opencv/cvtwopoints.h +1 -1
  77. data/ext/opencv/cvvideowriter.cpp +25 -20
  78. data/ext/opencv/cvvideowriter.h +1 -1
  79. data/ext/opencv/eigenfaces.cpp +10 -2
  80. data/ext/opencv/eigenfaces.h +1 -1
  81. data/ext/opencv/facerecognizer.cpp +15 -8
  82. data/ext/opencv/facerecognizer.h +2 -2
  83. data/ext/opencv/fisherfaces.cpp +10 -2
  84. data/ext/opencv/fisherfaces.h +1 -1
  85. data/ext/opencv/gui.cpp +26 -23
  86. data/ext/opencv/gui.h +1 -1
  87. data/ext/opencv/iplconvkernel.cpp +30 -24
  88. data/ext/opencv/iplconvkernel.h +1 -1
  89. data/ext/opencv/iplimage.cpp +49 -42
  90. data/ext/opencv/iplimage.h +1 -1
  91. data/ext/opencv/lbph.cpp +10 -2
  92. data/ext/opencv/lbph.h +1 -1
  93. data/ext/opencv/mouseevent.cpp +30 -25
  94. data/ext/opencv/mouseevent.h +1 -1
  95. data/ext/opencv/opencv.cpp +59 -60
  96. data/ext/opencv/opencv.h +1 -5
  97. data/ext/opencv/pointset.cpp +31 -25
  98. data/ext/opencv/pointset.h +1 -1
  99. data/ext/opencv/trackbar.cpp +27 -21
  100. data/ext/opencv/trackbar.h +1 -1
  101. data/ext/opencv/window.cpp +77 -57
  102. data/ext/opencv/window.h +1 -1
  103. data/lib/opencv/version.rb +2 -1
  104. data/ruby-opencv.gemspec +19 -18
  105. data/test/test_opencv.rb +5 -3
  106. data/yard_extension.rb +5 -0
  107. metadata +13 -27
  108. data/examples/matching_to_many_images/matching_to_many_images.rb +0 -16
  109. data/examples/matching_to_many_images/query.png +0 -0
  110. data/examples/matching_to_many_images/train/1.png +0 -0
  111. data/examples/matching_to_many_images/train/2.png +0 -0
  112. data/examples/matching_to_many_images/train/3.png +0 -0
  113. data/examples/matching_to_many_images/train/trainImages.txt +0 -3
  114. data/ext/opencv/cvcondensation.cpp +0 -282
  115. data/ext/opencv/cvcondensation.h +0 -49
  116. data/ext/opencv/cvmatnd.cpp +0 -44
  117. data/ext/opencv/cvmatnd.h +0 -28
  118. data/ext/opencv/cvsparsemat.cpp +0 -44
  119. data/ext/opencv/cvsparsemat.h +0 -28
  120. data/images/face_detect_from_lena.jpg +0 -0
  121. data/test/test_cvmat_matching.rb +0 -57
@@ -1,49 +0,0 @@
1
- /************************************************************
2
-
3
- cvcondensation.h -
4
-
5
- $Author: lsxi $
6
-
7
- Copyright (C) 2005-2006 Masakazu Yonekura
8
-
9
- ************************************************************/
10
- #ifndef RUBY_OPENCV_CVCONDENSATION_H
11
- #define RUBY_OPENCV_CVCONDENSATION_H
12
-
13
- #include "opencv.h"
14
-
15
- #define __NAMESPACE_BEGIN_CVCONDENSATION namespace cCvConDensation {
16
- #define __NAMESPACE_END_CVCONDENSATION }
17
-
18
- __NAMESPACE_BEGIN_OPENCV
19
- __NAMESPACE_BEGIN_CVCONDENSATION
20
-
21
- VALUE rb_class();
22
- void define_ruby_class();
23
-
24
- VALUE rb_dp(VALUE self);
25
- VALUE rb_mp(VALUE self);
26
- VALUE rb_dynamic_matrix(VALUE self);
27
- VALUE rb_state(VALUE self);
28
- VALUE rb_confidence(VALUE self);
29
- VALUE rb_cumulative(VALUE self);
30
- VALUE rb_samples_num(VALUE self);
31
-
32
- VALUE rb_init_sample_set(VALUE self, VALUE lower, VALUE upper);
33
- VALUE rb_update_by_time(VALUE self);
34
- VALUE rb_each_sample(VALUE self);
35
- VALUE rb_calculate_confidence(VALUE self);
36
-
37
- __NAMESPACE_END_CVCONDENSATION
38
-
39
- inline CvConDensation*
40
- CVCONDENSATION(VALUE object)
41
- {
42
- CvConDensation *ptr;
43
- Data_Get_Struct(object, CvConDensation, ptr);
44
- return ptr;
45
- }
46
-
47
- __NAMESPACE_END_OPENCV
48
-
49
- #endif // RUBY_OPENCV_CVCONDENSATION_H
@@ -1,44 +0,0 @@
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
-
@@ -1,28 +0,0 @@
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
@@ -1,44 +0,0 @@
1
- /***********************************************************
2
-
3
- cvsparse.cpp -
4
-
5
- $Author: lsxi $
6
-
7
- Copyright (C) 2007 Masakazu Yonekura
8
-
9
- ************************************************************/
10
- #include "cvsparsemat.h"
11
- /*
12
- * Document-class: OpenCV::CvSparseMat
13
- *
14
- */
15
- __NAMESPACE_BEGIN_OPENCV
16
- __NAMESPACE_BEGIN_CVSPARSEMAT
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, "CvSparseMat", cvmat);
40
- }
41
-
42
- __NAMESPACE_END_CVSPARSEMAT
43
- __NAMESPACE_END_OPENCV
44
-
@@ -1,28 +0,0 @@
1
- /************************************************************
2
-
3
- cvsparsemat.h -
4
-
5
- $Author: lsxi $
6
-
7
- Copyright (C) 2005-2006 Masakazu Yonekura
8
-
9
- ************************************************************/
10
- #ifndef RUBY_OPENCV_CVSPARSEMAT_H
11
- #define RUBY_OPENCV_CVSPARSEMAT_H
12
-
13
- #include "opencv.h"
14
-
15
- #define __NAMESPACE_BEGIN_CVSPARSEMAT namespace cCvSparseMat {
16
- #define __NAMESPACE_END_CVSPARSEMAT }
17
-
18
- __NAMESPACE_BEGIN_OPENCV
19
- __NAMESPACE_BEGIN_CVSPARSEMAT
20
-
21
- VALUE rb_class();
22
-
23
- void define_ruby_class();
24
-
25
- __NAMESPACE_END_CVSPARSEMAT
26
- __NAMESPACE_END_OPENCV
27
-
28
- #endif // RUBY_OPENCV_CVSPARSEMAT_H
@@ -1,57 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- mode: ruby; coding: utf-8 -*-
3
- require 'test/unit'
4
- require 'opencv'
5
- require File.expand_path(File.dirname(__FILE__)) + '/helper'
6
-
7
- include OpenCV
8
-
9
- # Tests for matching functions of OpenCV::CvMat
10
- class TestCvMat_matching < OpenCVTestCase
11
- def setup
12
- @query = read_test_image('query.png')
13
- @images = ['1.png', '2.png', '3.png'].map{|f| read_test_image('train', f)}
14
- end
15
-
16
- def data_dir
17
- File.join(File.dirname(__FILE__), '..', 'examples', 'matching_to_many_images')
18
- end
19
-
20
- def read_test_image(*path)
21
- CvMat.load File.join(data_dir, *path), CV_LOAD_IMAGE_GRAYSCALE
22
- end
23
-
24
- def test_match_descriptors
25
- matchs = @query.match_descriptors(@images)
26
- match_index, count = matchs.max_by {|image_index, count| count}
27
- assert_equal 2, match_index
28
- end
29
-
30
- def test_match_descriptors_with_empty_image_array
31
- assert_equal({}, @query.match_descriptors([]))
32
- end
33
-
34
- def test_match_descriptors_with_wrong_detector_type_argument
35
- assert_raise ArgumentError do
36
- @query.match_descriptors(@images, "Wrong")
37
- end
38
- end
39
-
40
- def test_match_descriptors_with_wrong_descriptor_type_argument
41
- assert_raise ArgumentError do
42
- @query.match_descriptors(@images, "SURF", "wrong")
43
- end
44
- end
45
-
46
- def test_match_descriptors_with_wrong_matcher_type_argument
47
- assert_raise ArgumentError do
48
- @query.match_descriptors(@images, "SURF", "SURF", "wrong")
49
- end
50
- end
51
-
52
- def test_match_descriptors_with_invalid_image_array
53
- assert_raise TypeError do
54
- @query.match_descriptors([DUMMY_OBJ, DUMMY_OBJ])
55
- end
56
- end
57
- end