class Imatcher::Result

Object containing comparison score and diff image

Attributes

diff[R]
image[RW]
mode[R]
score[RW]
threshold[R]

Public Class Methods

new(mode, threshold) click to toggle source
# File lib/imatcher/result.rb, line 7
def initialize(mode, threshold)
  @score = 0.0
  @diff = []
  @threshold = threshold
  @mode = mode
end

Public Instance Methods

difference_image() click to toggle source
# File lib/imatcher/result.rb, line 14
def difference_image
  @diff_image ||= mode.diff(image, diff)
end
match?() click to toggle source

Returns true iff score less or equals to threshold

# File lib/imatcher/result.rb, line 19
def match?
  score <= threshold
end