Class: Tracksperanto::Export::SynthEyes

Inherits:
Base
  • Object
show all
Includes:
UVCoordinates
Defined in:
lib/export/syntheyes.rb

Overview

Export for Syntheyes tracker UVs.

Instance Attribute Summary

Attributes inherited from Base

#io

Class Method Summary collapse

Instance Method Summary collapse

Methods included from UVCoordinates

#absolute_to_uv, #convert_from_uv, #convert_to_uv

Methods inherited from Base

#end_export, #end_tracker_segment, inherited, #initialize

Methods included from ConstName

#const_name, included

Methods included from SimpleExport

#just_export

Constructor Details

This class inherits a constructor from Tracksperanto::Export::Base

Class Method Details

.desc_and_extensionObject



6
7
8
# File 'lib/export/syntheyes.rb', line 6

def self.desc_and_extension
  "syntheyes_2dt.txt"
end

.human_nameObject



10
11
12
# File 'lib/export/syntheyes.rb', line 10

def self.human_name
  "Syntheyes 2D tracker paths file"
end

Instance Method Details

#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/export/syntheyes.rb', line 22

def export_point(frame, abs_float_x, abs_float_y, float_residual)
  values = [
      @tracker_name,  frame, convert_to_uv(abs_float_x, @width), 
      convert_to_uv(abs_float_y, @height) * -1, 
      get_outcome_code(frame)
  ]
  @io.puts(LINE_TEMPLATE % values)
end

#start_export(img_width, img_height) ⇒ Object



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

def start_export( img_width, img_height)
  @width, @height = img_width, img_height
end

#start_tracker_segment(tracker_name) ⇒ Object



18
19
20
# File 'lib/export/syntheyes.rb', line 18

def start_tracker_segment(tracker_name)
  @last_registered_frame, @tracker_name = nil, camelize(tracker_name)
end