opencv-ffi 0.0.1

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 (130) hide show
  1. data/.gitignore +7 -0
  2. data/Gemfile +15 -0
  3. data/README.md +126 -0
  4. data/Rakefile +52 -0
  5. data/docs/DocsIndex.md +1 -0
  6. data/docs/examples/load_image.rb +25 -0
  7. data/ext/Rakefile +13 -0
  8. data/ext/aishack-sift/.gitignore +4 -0
  9. data/ext/aishack-sift/Descriptor.h +34 -0
  10. data/ext/aishack-sift/KeyPoint.h +38 -0
  11. data/ext/aishack-sift/README +20 -0
  12. data/ext/aishack-sift/SIFT.cpp +1036 -0
  13. data/ext/aishack-sift/SIFT.h +84 -0
  14. data/ext/aishack-sift/example/.gitignore +2 -0
  15. data/ext/aishack-sift/example/Makefile +24 -0
  16. data/ext/aishack-sift/example/MySIFT.cpp +29 -0
  17. data/ext/aishack-sift/mkrf_conf.rb +13 -0
  18. data/ext/aishack-sift/siftlib.cpp +85 -0
  19. data/ext/eigen/.gitignore +4 -0
  20. data/ext/eigen/eigen_polynomial.cpp +41 -0
  21. data/ext/eigen/eigen_svd.cpp +100 -0
  22. data/ext/eigen/mkrf_conf.rb +14 -0
  23. data/ext/mkrf-monkey.rb +85 -0
  24. data/ext/mkrf-rakehelper-monkey.rb +52 -0
  25. data/ext/mkrf_conf.rb +3 -0
  26. data/ext/opencv-ffi/.gitignore +4 -0
  27. data/ext/opencv-ffi/matcher_helper.cpp +56 -0
  28. data/ext/opencv-ffi/mkrf_conf.rb +12 -0
  29. data/ext/opencv-ffi/vector_math.cpp +39 -0
  30. data/ext/opensurf/.gitignore +4 -0
  31. data/ext/opensurf/README +38 -0
  32. data/ext/opensurf/fasthessian.cpp +376 -0
  33. data/ext/opensurf/fasthessian.h +108 -0
  34. data/ext/opensurf/integral.cpp +58 -0
  35. data/ext/opensurf/integral.h +55 -0
  36. data/ext/opensurf/ipoint.cpp +108 -0
  37. data/ext/opensurf/ipoint.h +76 -0
  38. data/ext/opensurf/kmeans.h +172 -0
  39. data/ext/opensurf/mkrf_conf.rb +10 -0
  40. data/ext/opensurf/responselayer.h +92 -0
  41. data/ext/opensurf/surf.cpp +317 -0
  42. data/ext/opensurf/surf.h +66 -0
  43. data/ext/opensurf/surflib.cpp +98 -0
  44. data/ext/opensurf/surflib.h +96 -0
  45. data/ext/opensurf/utils.cpp +357 -0
  46. data/ext/opensurf/utils.h +63 -0
  47. data/lib/.gitignore +1 -0
  48. data/lib/opencv-ffi-ext/eigen.rb +84 -0
  49. data/lib/opencv-ffi-ext/features2d.rb +4 -0
  50. data/lib/opencv-ffi-ext/matcher_helper.rb +24 -0
  51. data/lib/opencv-ffi-ext/opensurf.rb +217 -0
  52. data/lib/opencv-ffi-ext/sift.rb +118 -0
  53. data/lib/opencv-ffi-ext/vector_math.rb +115 -0
  54. data/lib/opencv-ffi-wrappers.rb +7 -0
  55. data/lib/opencv-ffi-wrappers/core.rb +24 -0
  56. data/lib/opencv-ffi-wrappers/core/iplimage.rb +50 -0
  57. data/lib/opencv-ffi-wrappers/core/mat.rb +268 -0
  58. data/lib/opencv-ffi-wrappers/core/misc_draw.rb +44 -0
  59. data/lib/opencv-ffi-wrappers/core/point.rb +286 -0
  60. data/lib/opencv-ffi-wrappers/core/rect.rb +40 -0
  61. data/lib/opencv-ffi-wrappers/core/scalar.rb +104 -0
  62. data/lib/opencv-ffi-wrappers/core/size.rb +88 -0
  63. data/lib/opencv-ffi-wrappers/enumerable.rb +10 -0
  64. data/lib/opencv-ffi-wrappers/features2d.rb +17 -0
  65. data/lib/opencv-ffi-wrappers/features2d/image_patch.rb +322 -0
  66. data/lib/opencv-ffi-wrappers/features2d/star.rb +111 -0
  67. data/lib/opencv-ffi-wrappers/features2d/surf.rb +115 -0
  68. data/lib/opencv-ffi-wrappers/highgui.rb +10 -0
  69. data/lib/opencv-ffi-wrappers/imgproc.rb +4 -0
  70. data/lib/opencv-ffi-wrappers/imgproc/features.rb +35 -0
  71. data/lib/opencv-ffi-wrappers/imgproc/geometric.rb +39 -0
  72. data/lib/opencv-ffi-wrappers/matcher.rb +297 -0
  73. data/lib/opencv-ffi-wrappers/matrix.rb +37 -0
  74. data/lib/opencv-ffi-wrappers/misc.rb +41 -0
  75. data/lib/opencv-ffi-wrappers/misc/params.rb +34 -0
  76. data/lib/opencv-ffi-wrappers/sequence.rb +37 -0
  77. data/lib/opencv-ffi-wrappers/vectors.rb +38 -0
  78. data/lib/opencv-ffi.rb +12 -0
  79. data/lib/opencv-ffi/calib3d.rb +26 -0
  80. data/lib/opencv-ffi/core.rb +15 -0
  81. data/lib/opencv-ffi/core/draw.rb +68 -0
  82. data/lib/opencv-ffi/core/dynamic.rb +13 -0
  83. data/lib/opencv-ffi/core/library.rb +5 -0
  84. data/lib/opencv-ffi/core/operations.rb +122 -0
  85. data/lib/opencv-ffi/core/point.rb +22 -0
  86. data/lib/opencv-ffi/core/types.rb +172 -0
  87. data/lib/opencv-ffi/cvffi.rb +8 -0
  88. data/lib/opencv-ffi/features2d.rb +7 -0
  89. data/lib/opencv-ffi/features2d/library.rb +6 -0
  90. data/lib/opencv-ffi/features2d/star.rb +30 -0
  91. data/lib/opencv-ffi/features2d/surf.rb +38 -0
  92. data/lib/opencv-ffi/highgui.rb +31 -0
  93. data/lib/opencv-ffi/imgproc.rb +9 -0
  94. data/lib/opencv-ffi/imgproc/features.rb +37 -0
  95. data/lib/opencv-ffi/imgproc/geometric.rb +42 -0
  96. data/lib/opencv-ffi/imgproc/library.rb +6 -0
  97. data/lib/opencv-ffi/imgproc/misc.rb +39 -0
  98. data/lib/opencv-ffi/version.rb +3 -0
  99. data/opencv-ffi.gemspec +26 -0
  100. data/test/core/test_draw.rb +46 -0
  101. data/test/core/test_operations.rb +135 -0
  102. data/test/core/test_size.rb +14 -0
  103. data/test/core/test_text.rb +52 -0
  104. data/test/ext/test_eigen.rb +105 -0
  105. data/test/ext/test_opensurf.rb +35 -0
  106. data/test/ext/test_sift.rb +26 -0
  107. data/test/ext/test_vector_math.rb +85 -0
  108. data/test/features2d/test_surf.rb +63 -0
  109. data/test/imgproc/test_goodfeatures.rb +18 -0
  110. data/test/setup.rb +65 -0
  111. data/test/test_calib3d.rb +38 -0
  112. data/test/test_core.rb +26 -0
  113. data/test/test_ext.rb +8 -0
  114. data/test/test_features2d.rb +9 -0
  115. data/test/test_files/images/IMG_7088.JPG +0 -0
  116. data/test/test_files/images/IMG_7088_small.JPG +0 -0
  117. data/test/test_files/images/IMG_7089.JPG +0 -0
  118. data/test/test_highgui.rb +26 -0
  119. data/test/test_imgproc.rb +35 -0
  120. data/test/test_wrappers.rb +8 -0
  121. data/test/wrappers/core/test_draw.rb +41 -0
  122. data/test/wrappers/core/test_mat.rb +40 -0
  123. data/test/wrappers/core/test_operations.rb +35 -0
  124. data/test/wrappers/core/test_types.rb +235 -0
  125. data/test/wrappers/features2d/test_image_patch.rb +108 -0
  126. data/test/wrappers/test_imgproc.rb +87 -0
  127. data/test/wrappers/test_matcher.rb +96 -0
  128. data/test/wrappers/test_star.rb +28 -0
  129. data/test/wrappers/test_surf.rb +36 -0
  130. metadata +234 -0
@@ -0,0 +1,37 @@
1
+
2
+ class Matrix
3
+
4
+ def to_Matrix
5
+ self
6
+ end
7
+
8
+ # Painful but that's OK...
9
+ def to_CvMat( opts = {} )
10
+ type = opts[:type] || :CV_32F
11
+ a = CVFFI::cvCreateMat( row_size, column_size, type )
12
+ each_with_index { |e,i,j|
13
+ a.set_f( i, j, e )
14
+ }
15
+ a
16
+ end
17
+
18
+ end
19
+
20
+ class Vector
21
+
22
+ def to_Vector
23
+ self
24
+ end
25
+
26
+ def to_CvMat( opts = {} )
27
+ type = opts[:type] || :CV_32F
28
+ a = CVFFI::cvCreateMat( size, 1, type )
29
+ size.times { |i|
30
+ CVFFI::cvSetReal1D( a, i, element(i))
31
+ }
32
+ a
33
+ end
34
+
35
+ end
36
+
37
+
@@ -0,0 +1,41 @@
1
+ require 'opencv-ffi/core/types'
2
+
3
+ module CVFFI
4
+
5
+ def self.print_matrix(m, opts={})
6
+ opts ||= {}
7
+ opts = { :caption=>opts } if opts.is_a? String
8
+ puts opts[:caption] if opts[:caption]
9
+
10
+ # Lots of potential to make this better...
11
+ f = '%'
12
+ case opts[:format]
13
+ when :e, :exp, :exponential
14
+ f += '- 10.5e'
15
+ else
16
+ f += '- 10.5f'
17
+ end
18
+
19
+ nChannels = CVFFI::matChannels(m)
20
+ # puts "#{nChannels} channel data"
21
+
22
+ m.height.times { |i|
23
+ m.width.times {|j|
24
+ scalar = CVFFI::cvGet2D( m, i, j )
25
+ case nChannels
26
+ when 1
27
+ printf "#{f} ", scalar.w
28
+ when 2
29
+ printf "[#{f} #{f}] ", scalar.w, scalar.x
30
+ when 3
31
+ printf "[#{f} #{f} #{f}] ", scalar.w, scalar.x, scalar.y
32
+ when 4
33
+ printf "[#{f} #{f} #{f} #{f}] ", scalar.w, scalar.x, scalar.y, scalar.z
34
+ end
35
+ }
36
+ puts
37
+ }
38
+
39
+ end
40
+
41
+ end
@@ -0,0 +1,34 @@
1
+
2
+ require 'opencv-ffi'
3
+
4
+ module CVFFI
5
+
6
+ class Params
7
+
8
+ def self.defaults; @defaults ||= {}; end
9
+ def defaults; self.class.defaults; end
10
+
11
+ def self.param( *args )
12
+ while args.length > 0
13
+ default,name = [args.pop, args.pop]
14
+ defaults[ name ] = default
15
+ end
16
+ end
17
+
18
+ attr_reader :params
19
+
20
+ def initialize( opts = {} )
21
+ @params = {}
22
+ self.class.defaults.each_key { |k|
23
+ @params[k] = (opts[k] or opts[k.to_s] or self.class.defaults[k])
24
+ define_singleton_method( k ) { @params[k] }
25
+ instance_eval "def #{k}=(a); @params[:#{k}] = a; end"
26
+ }
27
+ end
28
+
29
+ def to_hash
30
+ @params
31
+ end
32
+ end
33
+
34
+ end
@@ -0,0 +1,37 @@
1
+
2
+ require 'opencv-ffi/core/dynamic'
3
+
4
+ module CVFFI
5
+
6
+ class Sequence
7
+ include Enumerable
8
+
9
+ attr_accessor :seq
10
+
11
+ def initialize( seq )
12
+ raise "Don't know how to handle class #{seq.class}" unless seq.is_a?(CvSeq)
13
+ @seq = seq
14
+ end
15
+
16
+ def each
17
+ size.times { |i|
18
+ yield CVFFI::cvGetSeqElem( @seq, i )
19
+ }
20
+ end
21
+
22
+ def push( a )
23
+ CVFFI::cvSeqPush( @seq, a )
24
+ end
25
+
26
+ def size
27
+ @seq.total
28
+ end
29
+ alias :length :size
30
+
31
+ def [](i)
32
+ CVFFI::cvGetSeqElem( @seq, i )
33
+ end
34
+
35
+ end
36
+
37
+ end
@@ -0,0 +1,38 @@
1
+
2
+ require 'nice-ffi'
3
+
4
+ module CVFFI
5
+
6
+ class FloatArrayCommon < NiceFFI::Struct
7
+ include Enumerable
8
+
9
+ class << self; attr_accessor :nElem; end
10
+
11
+ def nElem; self.class.nElem; end
12
+ alias :length :nElem
13
+
14
+ def each
15
+ nElem.times { |i|
16
+ yield d[i]
17
+ }
18
+ end
19
+
20
+ #def [](i)
21
+ # d[i]
22
+ #end
23
+
24
+ #def []=(i)
25
+ # d[i] = i
26
+ #end
27
+ end
28
+
29
+ class Float64 < FloatArrayCommon
30
+ @nElem = 64
31
+ layout :d, [ :float, @nElem ]
32
+ end
33
+
34
+ class Float128 < FloatArrayCommon
35
+ @nElem = 128
36
+ layout :d, [ :float, @nElem ]
37
+ end
38
+ end
@@ -0,0 +1,12 @@
1
+ require "opencv-ffi/version"
2
+ require "opencv-ffi/highgui"
3
+ require "opencv-ffi/core"
4
+ require "opencv-ffi/imgproc"
5
+ require "opencv-ffi/features2d"
6
+ require "opencv-ffi/calib3d"
7
+
8
+ module Opencv
9
+ module Ffi
10
+ # Your code goes here...
11
+ end
12
+ end
@@ -0,0 +1,26 @@
1
+
2
+ require 'opencv-ffi/cvffi'
3
+ require 'opencv-ffi/core'
4
+
5
+ module CVFFI
6
+ load_library("opencv_calib3d", @pathset)
7
+
8
+ enum :cvRansacMethod, [ :CV_FM_7POINT, 1,
9
+ :CV_FM_8POINT, 2,
10
+ :CV_FM_LMEDS, 4,
11
+ :CV_FM_RANSAC, 8 ]
12
+
13
+ # CVAPI(int) cvFindFundamentalMat( const CvMat* points1,
14
+ # const CvMat* points2,
15
+ # CvMat* fundamental_matrix,
16
+ # int method CV_DEFAULT(CV_FM_RANSAC),
17
+ # double param1 CV_DEFAULT(3.),
18
+ # double param2 CV_DEFAULT(0.99),
19
+ # CvMat* status CV_DEFAULT(NULL) );
20
+ attach_function :cvFindFundamentalMat, [ :pointer, :pointer, :pointer,
21
+ :int, :double, :double, :pointer ], :int
22
+
23
+
24
+ end
25
+
26
+
@@ -0,0 +1,15 @@
1
+ ## An omnibus file which brings in all the core/* sub-files
2
+
3
+ require 'opencv-ffi/core/library'
4
+
5
+ module CVFFI
6
+
7
+ enum :cvBoolean, [ :false, 0,
8
+ :true ]
9
+
10
+ end
11
+
12
+ require 'opencv-ffi/core/types'
13
+ require 'opencv-ffi/core/dynamic'
14
+ require 'opencv-ffi/core/draw'
15
+ require 'opencv-ffi/core/operations'
@@ -0,0 +1,68 @@
1
+
2
+ require 'opencv-ffi/core/library'
3
+ require 'opencv-ffi/core/types'
4
+
5
+ module CVFFI
6
+
7
+ CvFontDefines = enum [:CV_FONT_HERSHEY_SIMPLEX, 0,
8
+ :CV_FONT_HERSHEY_PLAIN,
9
+ :CV_FONT_HERSHEY_DUPLEX,
10
+ :CV_FONT_HERSHEY_COMPLEX,
11
+ :CV_FONT_HERSHEY_TRIPLEX,
12
+ :CV_FONT_HERSHEY_COMPLEX_SMALL,
13
+ :CV_FONT_HERSHEY_SCRIPT_SIMPLEX,
14
+ :CV_FONT_HERSHEY_SCRIPT_COMPLEX,
15
+ :CV_FONT_NORMAL, 8,
16
+ :CV_FONT_ITALIC, 16 ]
17
+
18
+ enum [:CV_AA, 16]
19
+
20
+ class CvFont < NiceFFI::Struct
21
+ layout :nameFont, :string,
22
+ :color, CvScalar,
23
+ :font_face, :int,
24
+ :ascii, :pointer,
25
+ :greek, :pointer,
26
+ :cyrillic, :pointer,
27
+ :hscale, :float,
28
+ :vscale, :float,
29
+ :shear, :float,
30
+ :thickness, :int,
31
+ :dx, :float,
32
+ :line_type, :int
33
+ end
34
+
35
+ # CVAPI(void) cvCircle( CvArr* img,
36
+ # CvPoint center,
37
+ # int radius,
38
+ # CvScalar color,
39
+ # int thickness CV_DEFAULT(1),
40
+ # int line_type CV_DEFAULT(8),
41
+ # int shift CV_DEFAULT(0));
42
+ attach_function :cvCircle, [ :pointer, CvPoint.by_value, :int,
43
+ CvScalar.by_value, :int, :int, :int ], :void
44
+
45
+ attach_function :cvGetTextSize, [ :string, :pointer, :pointer, :pointer ], :void
46
+
47
+ # CVAPI(void) cvInitFont( CvFont* font, int font_face,
48
+ # double hscale, double vscale,
49
+ # double shear CV_DEFAULT(0),
50
+ # int thickness CV_DEFAULT(1),
51
+ # int line_type CV_DEFAULT(8));
52
+ attach_function :cvInitFont, [:pointer, CvFontDefines, :double, :double, :double, :int, :int ], :void
53
+ #attach_function :cvFont, [:double, :int ], CvFont.by_value
54
+
55
+ # CVAPI(void) cvLine( CvArr* img,
56
+ # CvPoint pt1,
57
+ # CvPoint pt2,
58
+ # CvScalar color,
59
+ # int thickness CV_DEFAULT(1),
60
+ # int line_type CV_DEFAULT(8),
61
+ # int shift CV_DEFAULT(0) );
62
+ attach_function :cvLine, [ :pointer, CvPoint.by_value, CvPoint.by_value,
63
+ CvScalar.by_value, :int, :int, :int ], :void
64
+
65
+ attach_function :cvPutText, [ :pointer, :string,
66
+ CvPoint.by_value, :pointer,
67
+ CvScalar.by_value ], :void
68
+ end
@@ -0,0 +1,13 @@
1
+
2
+ require 'opencv-ffi/core/library'
3
+ require 'opencv-ffi/core/types'
4
+
5
+ module CVFFI
6
+
7
+ attach_function :cvCreateMemStorage, [ :int ], CvMemStorage.typed_pointer
8
+ attach_function :cvReleaseMemStorage, [:pointer], :void
9
+
10
+ attach_function :cvGetSeqElem, [ :pointer, :int ], :pointer
11
+ attach_function :cvSeqPush, [:pointer, :pointer ], :pointer
12
+
13
+ end
@@ -0,0 +1,5 @@
1
+ require 'opencv-ffi/cvffi'
2
+
3
+ module CVFFI
4
+ load_library("opencv_core", @pathset)
5
+ end
@@ -0,0 +1,122 @@
1
+
2
+ require 'opencv-ffi/core/library'
3
+ require 'opencv-ffi/core/types'
4
+
5
+ module CVFFI
6
+
7
+ CvMatType = enum :cvMatType, [ :CV_8U, 0,
8
+ :CV_8UC1, 0,
9
+ :CV_8S,
10
+ :CV_16U,
11
+ :CV_16S,
12
+ :CV_32S,
13
+ :CV_32F,
14
+ :CV_64F,
15
+ :CV_USRTYPE1,
16
+ :CV_8UC2, 8,
17
+ :CV_8SC2,
18
+ :CV_16UC2,
19
+ :CV_16SC2,
20
+ :CV_32SC2,
21
+ :CV_32FC2,
22
+ :CV_64FC2,
23
+ :CV_8UC3, 16,
24
+ :CV_8SC3,
25
+ :CV_16UC3,
26
+ :CV_16SC3,
27
+ :CV_32SC3,
28
+ :CV_32FC3,
29
+ :CV_64FC3 ]
30
+
31
+ ## As present, the type encodes 9 bits of nChannels and 3 bits of typ
32
+ def self.matMagicType( m )
33
+ type = case m.type
34
+ when Fixnum
35
+ m.type
36
+ when Symbol
37
+ CvMatType[m.type]
38
+ else
39
+ raise "Can't convert #{m.type} to a numberic OpenCV type"
40
+ end
41
+
42
+ type & 0xFFF
43
+ end
44
+
45
+ def self.matChannels( m )
46
+ (matMagicType(m) >> 3) + 1
47
+ end
48
+
49
+ # A bit clumsy
50
+ def self.matType( m )
51
+ case m.type & 0x7
52
+ when :CV_8U; :CV_8U
53
+ else
54
+ assert RuntimeError, "This shouldn't happen!"
55
+ end
56
+ end
57
+
58
+ attach_function :cvAddWeighted, [ :pointer, :double, :pointer, :double, :double, :pointer ], :void
59
+
60
+ attach_function :cvCloneImage, [ :pointer ], IplImage.typed_pointer
61
+ attach_function :cvCloneMat, [ :pointer ], CvMat.typed_pointer
62
+
63
+ enum :cvCmpTypes, [ :CV_CMP_EQ, :CV_CMP_GT, :CV_CMP_GE, :CV_CMP_LT, :CV_CMP_LE, :CV_CMP_NE ]
64
+ attach_function :cvCmp, [:pointer, :pointer, :pointer, :int], :void
65
+
66
+ attach_function :cvCreateMat, [ :int, :int, :cvMatType ], CvMat.typed_pointer
67
+ attach_function :cvCreateImage, [ CvSize.by_value, :int, :int ], IplImage.typed_pointer
68
+
69
+ attach_function :cvCopy, [ :pointer, :pointer, :pointer ], :void
70
+
71
+
72
+ attach_function :cvSetImageROI, [:pointer, CvRect.by_value ], :void
73
+ attach_function :cvGetImageROI, [:pointer], CvRect.by_value
74
+ attach_function :cvResetImageROI, [:pointer], :void
75
+
76
+ # CVAPI(CvScalar) cvGet2D( const CvArr* arr, int idx0, int idx1 );
77
+ attach_function :cvGet1D, [ :pointer, :int ], CvScalar.by_value
78
+ attach_function :cvGet2D, [ :pointer, :int, :int ], CvScalar.by_value
79
+ attach_function :cvGet3D, [ :pointer, :int, :int, :int ], CvScalar.by_value
80
+
81
+ attach_function :cvGetReal1D, [ :pointer, :int ], :double
82
+ attach_function :cvGetReal2D, [ :pointer, :int, :int ], :double
83
+ attach_function :cvGetReal3D, [ :pointer, :int, :int, :int ], :double
84
+
85
+ enum :cvNormTypes, [ :CV_C, 1,
86
+ :CV_L1, 2,
87
+ :CV_L2, 4 ]
88
+ attach_function :real_cvNorm, :cvNorm, [ :pointer, :pointer, :int, :pointer ], :double
89
+ def self.cvNorm( arr1, arr2 = nil, normType = :CV_L2, mask = nil )
90
+ real_cvNorm( arr1, arr2, normType, mask )
91
+ end
92
+
93
+ attach_function :cvSet, [ :pointer, CvScalar.by_value, :pointer ], :void
94
+
95
+ attach_function :cvSet1D, [ :pointer, :int, CvScalar.by_value ], :void
96
+ attach_function :cvSet2D, [ :pointer, :int, :int, CvScalar.by_value ], :void
97
+ attach_function :cvSet3D, [ :pointer, :int, :int, :int, CvScalar.by_value ], :void
98
+
99
+ attach_function :cvSetReal1D, [ :pointer, :int, :double ], :void
100
+ attach_function :cvSetReal2D, [ :pointer, :int, :int, :double ], :void
101
+ attach_function :cvSetReal3D, [ :pointer, :int, :int, :int, :double ], :void
102
+
103
+ attach_function :cvSetIdentity, [ :pointer, CvScalar.by_value ], :void
104
+ attach_function :cvSetZero, [ :pointer ], :void
105
+
106
+ attach_function :cvSolveCubic, [:pointer, :pointer ], :void
107
+
108
+ attach_function :cvSum, [:pointer], CvScalar.by_value
109
+
110
+ attach_function :cvTranspose, [:pointer, :pointer], :void
111
+
112
+ attach_function :cvReleaseMat, [ :pointer ], :void
113
+ attach_function :cvReleaseData, [ :pointer ], :void
114
+
115
+ # cvReleaseImage expects a double-pointer to an IplImage
116
+ attach_function :cvReleaseImageReal, :cvReleaseImage, [ :pointer ], :void
117
+ def self.cvReleaseImage( iplImage )
118
+ #ptr = FFI::MemoryPointer.new :pointer
119
+ #ptr.put_pointer(0, iplImage.to_ptr )
120
+ #cvReleaseImageReal iplImage
121
+ end
122
+ end