ruby-opencv 0.0.11 → 0.0.12.pre
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.yardopts +3 -0
- data/Gemfile +1 -0
- data/Manifest.txt +2 -14
- data/README.md +1 -1
- data/Rakefile +10 -1
- data/examples/facerec/facerec_lbph.rb +1 -1
- data/ext/opencv/algorithm.cpp +6 -1
- data/ext/opencv/algorithm.h +1 -1
- data/ext/opencv/curve.cpp +48 -33
- data/ext/opencv/curve.h +1 -1
- data/ext/opencv/cvavgcomp.cpp +22 -25
- data/ext/opencv/cvavgcomp.h +1 -1
- data/ext/opencv/cvbox2d.cpp +56 -58
- data/ext/opencv/cvbox2d.h +1 -1
- data/ext/opencv/cvcapture.cpp +210 -109
- data/ext/opencv/cvcapture.h +1 -1
- data/ext/opencv/cvchain.cpp +71 -71
- data/ext/opencv/cvchain.h +1 -1
- data/ext/opencv/cvcircle32f.cpp +37 -27
- data/ext/opencv/cvcircle32f.h +1 -1
- data/ext/opencv/cvconnectedcomp.cpp +49 -36
- data/ext/opencv/cvconnectedcomp.h +1 -1
- data/ext/opencv/cvcontour.cpp +117 -81
- data/ext/opencv/cvcontour.h +1 -1
- data/ext/opencv/cvcontourtree.cpp +37 -32
- data/ext/opencv/cvcontourtree.h +1 -1
- data/ext/opencv/cvconvexitydefect.cpp +33 -44
- data/ext/opencv/cvconvexitydefect.h +1 -1
- data/ext/opencv/cverror.cpp +22 -66
- data/ext/opencv/cverror.h +1 -1
- data/ext/opencv/cvfeaturetree.cpp +31 -33
- data/ext/opencv/cvfeaturetree.h +1 -1
- data/ext/opencv/cvfont.cpp +98 -78
- data/ext/opencv/cvfont.h +1 -1
- data/ext/opencv/cvhaarclassifiercascade.cpp +39 -59
- data/ext/opencv/cvhaarclassifiercascade.h +1 -1
- data/ext/opencv/cvhistogram.cpp +259 -90
- data/ext/opencv/cvhistogram.h +1 -1
- data/ext/opencv/cvhumoments.cpp +99 -60
- data/ext/opencv/cvhumoments.h +1 -1
- data/ext/opencv/cvline.cpp +45 -40
- data/ext/opencv/cvline.h +1 -1
- data/ext/opencv/cvmat.cpp +1894 -1829
- data/ext/opencv/cvmat.h +2 -3
- data/ext/opencv/cvmemstorage.cpp +19 -14
- data/ext/opencv/cvmemstorage.h +1 -1
- data/ext/opencv/cvmoments.cpp +51 -45
- data/ext/opencv/cvmoments.h +1 -1
- data/ext/opencv/cvpoint.cpp +32 -26
- data/ext/opencv/cvpoint.h +1 -1
- data/ext/opencv/cvpoint2d32f.cpp +31 -26
- data/ext/opencv/cvpoint2d32f.h +1 -1
- data/ext/opencv/cvpoint3d32f.cpp +36 -29
- data/ext/opencv/cvpoint3d32f.h +1 -1
- data/ext/opencv/cvrect.cpp +38 -33
- data/ext/opencv/cvrect.h +1 -1
- data/ext/opencv/cvscalar.cpp +50 -45
- data/ext/opencv/cvscalar.h +1 -1
- data/ext/opencv/cvseq.cpp +53 -47
- data/ext/opencv/cvseq.h +1 -1
- data/ext/opencv/cvsize.cpp +32 -26
- data/ext/opencv/cvsize.h +1 -1
- data/ext/opencv/cvsize2d32f.cpp +31 -25
- data/ext/opencv/cvsize2d32f.h +1 -1
- data/ext/opencv/cvslice.cpp +28 -22
- data/ext/opencv/cvslice.h +1 -1
- data/ext/opencv/cvsurfparams.cpp +37 -28
- data/ext/opencv/cvsurfparams.h +1 -1
- data/ext/opencv/cvsurfpoint.cpp +76 -53
- data/ext/opencv/cvsurfpoint.h +1 -1
- data/ext/opencv/cvtermcriteria.cpp +32 -26
- data/ext/opencv/cvtermcriteria.h +1 -1
- data/ext/opencv/cvtwopoints.cpp +28 -22
- data/ext/opencv/cvtwopoints.h +1 -1
- data/ext/opencv/cvvideowriter.cpp +25 -20
- data/ext/opencv/cvvideowriter.h +1 -1
- data/ext/opencv/eigenfaces.cpp +10 -2
- data/ext/opencv/eigenfaces.h +1 -1
- data/ext/opencv/facerecognizer.cpp +15 -8
- data/ext/opencv/facerecognizer.h +2 -2
- data/ext/opencv/fisherfaces.cpp +10 -2
- data/ext/opencv/fisherfaces.h +1 -1
- data/ext/opencv/gui.cpp +26 -23
- data/ext/opencv/gui.h +1 -1
- data/ext/opencv/iplconvkernel.cpp +30 -24
- data/ext/opencv/iplconvkernel.h +1 -1
- data/ext/opencv/iplimage.cpp +49 -42
- data/ext/opencv/iplimage.h +1 -1
- data/ext/opencv/lbph.cpp +10 -2
- data/ext/opencv/lbph.h +1 -1
- data/ext/opencv/mouseevent.cpp +30 -25
- data/ext/opencv/mouseevent.h +1 -1
- data/ext/opencv/opencv.cpp +59 -60
- data/ext/opencv/opencv.h +1 -5
- data/ext/opencv/pointset.cpp +31 -25
- data/ext/opencv/pointset.h +1 -1
- data/ext/opencv/trackbar.cpp +27 -21
- data/ext/opencv/trackbar.h +1 -1
- data/ext/opencv/window.cpp +77 -57
- data/ext/opencv/window.h +1 -1
- data/lib/opencv/version.rb +2 -1
- data/ruby-opencv.gemspec +19 -18
- data/test/test_opencv.rb +5 -3
- data/yard_extension.rb +5 -0
- metadata +13 -27
- data/examples/matching_to_many_images/matching_to_many_images.rb +0 -16
- data/examples/matching_to_many_images/query.png +0 -0
- data/examples/matching_to_many_images/train/1.png +0 -0
- data/examples/matching_to_many_images/train/2.png +0 -0
- data/examples/matching_to_many_images/train/3.png +0 -0
- data/examples/matching_to_many_images/train/trainImages.txt +0 -3
- data/ext/opencv/cvcondensation.cpp +0 -282
- data/ext/opencv/cvcondensation.h +0 -49
- data/ext/opencv/cvmatnd.cpp +0 -44
- data/ext/opencv/cvmatnd.h +0 -28
- data/ext/opencv/cvsparsemat.cpp +0 -44
- data/ext/opencv/cvsparsemat.h +0 -28
- data/images/face_detect_from_lena.jpg +0 -0
- data/test/test_cvmat_matching.rb +0 -57
data/ext/opencv/cvcondensation.h
DELETED
|
@@ -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
|
data/ext/opencv/cvmatnd.cpp
DELETED
|
@@ -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
|
-
|
data/ext/opencv/cvmatnd.h
DELETED
|
@@ -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
|
data/ext/opencv/cvsparsemat.cpp
DELETED
|
@@ -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
|
-
|
data/ext/opencv/cvsparsemat.h
DELETED
|
@@ -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
|
|
Binary file
|
data/test/test_cvmat_matching.rb
DELETED
|
@@ -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
|