Class: Tracksperanto::Tool::LensDisto

Inherits:
Base
  • Object
show all
Includes:
UVCoordinates
Defined in:
lib/tools/lens_disto.rb

Defined Under Namespace

Classes: RF, Vector2

Constant Summary collapse

STEPS =
256

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

inherited, #initialize

Methods included from Parameters

#parameter, #parameters

Methods included from SimpleExport

#just_export

Methods included from ConstName

#const_name

Methods included from BlockInit

#initialize

Methods included from Casts

#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string

Constructor Details

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

Class Method Details

.action_descriptionObject



11
12
13
# File 'lib/tools/lens_disto.rb', line 11

def self.action_description
  "Apply or remove lens distortion with the Syntheyes algorithm"
end

Instance Method Details

#export_point(frame, float_x, float_y, float_residual) ⇒ Object



23
24
25
26
# File 'lib/tools/lens_disto.rb', line 23

def export_point(frame, float_x, float_y, float_residual)
  x, y =  remove ? undisto(float_x, float_y) : disto(float_x, float_y)
  super(frame, x, y, float_residual)
end

#start_export(w, h) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/tools/lens_disto.rb', line 15

def start_export(w, h)
  @width, @height = w, h
  @aspect = @width.to_f / @height
  
  generate_lut
  super
end