Sha256: 62ea2c4faf7d3d490d2b19ca35f5be8c56fac692993980ad43e79e8ac4e85736

Contents?: true

Size: 1.6 KB

Versions: 17

Compression:

Stored size: 1.6 KB

Contents

require File.dirname(__FILE__) + '/../helper'

class SyntheyesImportTest < Test::Unit::TestCase
  DELTA = 0.9 # our SynthEyes sample is somewhat inaccurate :-P
  def test_introspects_properly
    i = Tracksperanto::Import::Syntheyes
    assert_equal "Syntheyes 2D tracker paths file", i.human_name
    assert !i.autodetects_size?
  end
  
  def test_parsing_from_importable
    fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/shake_tracker_nodes_to_syntheyes.txt')
    
    parser = Tracksperanto::Import::Syntheyes.new
    parser.width = 2560
    parser.height = 1080
    
    trackers = parser.parse(fixture)
    assert_equal 50, trackers.length
    
    first_kf = trackers[0].keyframes[0]
    
    assert_equal "Tracker1", trackers[0].name
    
    assert_equal 0, first_kf.frame
    assert_in_delta 715.839, first_kf.abs_x, DELTA
    assert_in_delta 886.212, first_kf.abs_y, DELTA
    assert_in_delta 0.0, first_kf.residual, DELTA
  end
  
  def test_parsing_cola_plate
    fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/cola_plate.txt')
    parser = Tracksperanto::Import::Syntheyes.new
    parser.width = 1920
    parser.height = 1080
    
    trackers = parser.parse(fixture)
    assert_equal 6, trackers.length
  end
  
  def test_parsing_with_one_tracker
    fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/one_tracker.txt')
    parser = Tracksperanto::Import::Syntheyes.new
    parser.width = 1920
    parser.height = 1080
    trackers = parser.parse(fixture)
    assert_equal 1, trackers.length
    assert_equal 49, trackers[0].length
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
tracksperanto-1.9.9 test/import/test_syntheyes_import.rb
tracksperanto-1.9.8 test/import/test_syntheyes_import.rb
tracksperanto-1.9.6 test/import/test_syntheyes_import.rb
tracksperanto-1.9.5 test/import/test_syntheyes_import.rb
tracksperanto-1.9.4 test/import/test_syntheyes_import.rb
tracksperanto-1.9.3 test/import/test_syntheyes_import.rb
tracksperanto-1.9.2 test/import/test_syntheyes_import.rb
tracksperanto-1.9.1 test/import/test_syntheyes_import.rb
tracksperanto-1.9.0 test/import/test_syntheyes_import.rb
tracksperanto-1.8.4 test/import/test_syntheyes_import.rb
tracksperanto-1.8.2 test/import/test_syntheyes_import.rb
tracksperanto-1.8.1 test/import/test_syntheyes_import.rb
tracksperanto-1.8.0 test/import/test_syntheyes_import.rb
tracksperanto-1.7.5 test/import/test_syntheyes_import.rb
tracksperanto-1.7.4 test/import/test_syntheyes_import.rb
tracksperanto-1.7.3 test/import/test_syntheyes_import.rb
tracksperanto-1.7.2 test/import/test_syntheyes_import.rb