Class: OpenCV::CvAvgComp
- Inherits:
-
Object
- Object
- OpenCV::CvAvgComp
- Defined in:
- lib/detectors/opencv_ext.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
Instance Method Summary collapse
- #<(comp) ⇒ Object
- #>(comp) ⇒ Object
- #area ⇒ Object
-
#collide?(comp) ⇒ Boolean
collide?.
- #to_s ⇒ Object
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
3 4 5 |
# File 'lib/detectors/opencv_ext.rb', line 3 def color @color end |
Instance Method Details
#<(comp) ⇒ Object
18 19 20 |
# File 'lib/detectors/opencv_ext.rb', line 18 def <(comp) self.area < comp.area end |
#>(comp) ⇒ Object
14 15 16 |
# File 'lib/detectors/opencv_ext.rb', line 14 def >(comp) self.area > comp.area end |
#area ⇒ Object
23 24 25 |
# File 'lib/detectors/opencv_ext.rb', line 23 def area return self.width * self.height end |
#collide?(comp) ⇒ Boolean
collide?
7 8 9 10 11 12 |
# File 'lib/detectors/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_s ⇒ Object
27 28 29 |
# File 'lib/detectors/opencv_ext.rb', line 27 def to_s "#{self.x},#{self.y}-#{self.width}x#{self.height}" end |