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, #initialize

Methods included from ConstName

#const_name

Methods included from SimpleExport

#just_export

Constructor Details

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

Class Method Details

.desc_and_extensionObject


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

def self.desc_and_extension
  "syntheyes_2dt.txt"
end

.human_nameObject


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

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


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

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


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

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

#start_tracker_segment(tracker_name) ⇒ Object


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

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