Class: OpenCV::CvAvgComp

Inherits:
Object
  • Object
show all
Defined in:
lib/opencv_ext.rb

Instance Method Summary collapse

Instance Method Details

#collide?(comp) ⇒ Boolean

collide?

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/opencv_ext.rb', line 7

def collide?(comp)
  if (self.x < comp.x + comp.width && comp.x < self.x + self.width && self.y < comp.y + comp.height)
    return comp.y < self.y + self.height
  end
  return false
end

#to_sObject



14
15
16
# File 'lib/opencv_ext.rb', line 14

def to_s
  "#{self.x},#{self.y}-#{self.width}x#{self.height}"
end