Class: Matrix

Inherits:
Object
  • Object
show all
Defined in:
lib/opencv-ffi-wrappers/matrix.rb

Instance Method Summary collapse

Instance Method Details

#to_CvMat(opts = {}) ⇒ Object

Painful but that’s OK…



9
10
11
12
13
14
15
16
# File 'lib/opencv-ffi-wrappers/matrix.rb', line 9

def to_CvMat( opts = {} )
  type = opts[:type] || :CV_32F
  a = CVFFI::cvCreateMat( row_size, column_size, type )
  each_with_index { |e,i,j|
    a.set_f( i, j, e )
  }
  a
end

#to_MatrixObject



4
5
6
# File 'lib/opencv-ffi-wrappers/matrix.rb', line 4

def to_Matrix
  self
end