Module: RoiHelper

Included in:
BaseMonitor, SaraMonitor, Stb
Defined in:
lib/helpers/tmc_helpers/roi_helper/roi_helper.rb

Instance Method Summary collapse

Instance Method Details

#roi_resolution(roi_obj, resolutionheight, resolutionwidth) ⇒ Object

Public: Change roi resolution. Should pass it an ROI that was made for 1080 resolution

roi_obj - roi object resolutionheight - set resolution height resolutionwidth - set resolution width

Returns roi, object roi object



9
10
11
12
13
14
15
16
# File 'lib/helpers/tmc_helpers/roi_helper/roi_helper.rb', line 9

def roi_resolution(roi_obj, resolutionheight, resolutionwidth)
  roi_obj.rectangle=({:x => (roi_obj.rectangle[:x]*resolutionwidth/1920), 
                      :y => (roi_obj.rectangle[:y]*resolutionheight/1080),
                      :height => (roi_obj.rectangle[:height]*resolutionheight/1080), 
                      :width => (roi_obj.rectangle[:width]*resolutionwidth/1920)})
  # return roi
  roi_obj
end