Method: ImageRoi#initialize

Defined in:
lib/roi/image/image_roi.rb

#initialize(dut, args = {}) ⇒ ImageRoi

Public: Initializes an image Roi.

dut - Platform (or subclass) instance to which this Roi belongs. x - Integer x coordinate (default: nil). y - Integer y coordinate (default: nil). width - Integer width (default: nil). height - Integer height (default: nil). rectangle - Hash defining rectangle with keys :x, :y, :width, :height (default: nil). element - Hash same as rectangle (default: nil). img_x - Integer secondary Roi x coordinate (default: nil). Required. img_y - Integer secondary Roi y coordinate (default: nil). Required. img_width - Integer secondary Roi width (default: nil). Required. img_height - Integer secondary Roi height (default: nil). Required. ref_img - String path to reference image (default: nil). Required. similarity - Integer image similarity threshold 0 - 100 (default: 80).

Returns nothing.



28
29
30
31
32
33
34
35
36
# File 'lib/roi/image/image_roi.rb', line 28

def initialize(dut, args={})
  args.fetch(:ref_img)  # required

  super(dut, args)
  @img_x = args.fetch(:img_x)
  @img_y = args.fetch(:img_y)
  @img_width = args.fetch(:img_width)
  @img_height = args.fetch(:img_height)
  @similarity = args.fetch(:similarity, 80)
end