Class: Tracksperanto::Keyframe

Inherits:
Object
  • Object
show all
Includes:
BlockInit, Casts
Defined in:
lib/tracksperanto/keyframe.rb

Overview

Internal representation of a keyframe, that carries info on the frame location in the clip, x y and residual Frame numbers start from zero (frame 0 is first frame of the clip). Tracksperanto uses Shake coordinates as base. Image is Y-positive, X-positive, absolute pixel values up and right (zero is in the lower left corner). Some apps use a different coordinate system so translation will take place on import or on export, respectively. We also use residual and not correlation (residual is how far the tracker strolls away, correlation is how sure the tracker is about what it’s doing). Residual is the inverse of correlation (with total correlation of one the residual excursion becomes zero).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BlockInit

#initialize

Methods included from Casts

#cast_to_float, #cast_to_int, #cast_to_string, included

Instance Attribute Details

#abs_xObject

Absolute float X value of the point, zero is lower left



17
18
19
# File 'lib/tracksperanto/keyframe.rb', line 17

def abs_x
  @abs_x
end

#abs_yObject

Absolute float Y value of the point, zero is lower left



20
21
22
# File 'lib/tracksperanto/keyframe.rb', line 20

def abs_y
  @abs_y
end

#frameObject

Absolute integer frame where this keyframe is placed, 0 based



14
15
16
# File 'lib/tracksperanto/keyframe.rb', line 14

def frame
  @frame
end

#residualObject

Absolute float residual (0 is “spot on”)



23
24
25
# File 'lib/tracksperanto/keyframe.rb', line 23

def residual
  @residual
end

Instance Method Details

#inspectObject



28
29
30
# File 'lib/tracksperanto/keyframe.rb', line 28

def inspect
  [frame, abs_x, abs_y].inspect
end