Class: CVFFI::ImagePatch::Mask

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

Direct Known Subclasses

CircularMask, SquareMask

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ Mask

Returns a new instance of Mask.



12
13
14
# File 'lib/opencv-ffi-wrappers/features2d/image_patch.rb', line 12

def initialize(size)
  @size = size
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



11
12
13
# File 'lib/opencv-ffi-wrappers/features2d/image_patch.rb', line 11

def size
  @size
end

Class Method Details

.make(params) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/opencv-ffi-wrappers/features2d/image_patch.rb', line 16

def self.make( params )
  case params.shape
  when :square
    SquareMask.new( params.size )
  when :circle, :circular
    CircularMask.new(params.size )
  else 
    raise "Don't know how to make shape #{params.shape}"
  end
end