Class: Hornetseye::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/hornetseye-opencv/node.rb

Instance Method Summary collapse

Instance Method Details

#orig_to_cvmatObject


20
# File 'lib/hornetseye-opencv/node.rb', line 20

alias_method :orig_to_cvmat, :to_cvmat

#to_cvmatObject


22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/hornetseye-opencv/node.rb', line 22

def to_cvmat
  data = memorise
  if typecode < Composite
    MultiArray.import(data.typecode.basetype, data.memory,
                      data.typecode.num_elements, *data.shape).orig_to_cvmat
  elsif dimension == 2
    MultiArray.import(data.typecode.basetype, data.memory,
                      1, *data.shape).orig_to_cvmat
  else
    data.orig_to_cvmat
  end
end