tracksperanto 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/export/pftrack.rb +3 -3
- data/lib/import/pftrack.rb +11 -3
- data/lib/pipeline/base.rb +0 -1
- data/lib/tracksperanto.rb +1 -1
- data/test/export/test_pftrack5_export.rb +19 -0
- data/test/export/test_pftrack_export.rb +3 -3
- data/test/import/test_pftrack_import.rb +9 -0
- data/test/import/test_syntheyes_import.rb +0 -15
- metadata +2 -1
data/History.txt
CHANGED
data/lib/export/pftrack.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Export for PFTrack .2dt files
|
2
|
-
class Tracksperanto::Export::
|
2
|
+
class Tracksperanto::Export::PFTrack4 < Tracksperanto::Export::Base
|
3
3
|
|
4
4
|
KEYFRAME_TEMPLATE = "%s %.3f %.3f %.3f"
|
5
5
|
|
6
6
|
def self.desc_and_extension
|
7
|
-
"
|
7
|
+
"pftrack_v4.2dt"
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.human_name
|
11
|
-
"PFTrack .2dt file"
|
11
|
+
"PFTrack v4 .2dt file"
|
12
12
|
end
|
13
13
|
|
14
14
|
def start_tracker_segment(tracker_name)
|
data/lib/import/pftrack.rb
CHANGED
@@ -7,13 +7,15 @@ class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
|
|
7
7
|
".2dt"
|
8
8
|
end
|
9
9
|
|
10
|
+
CHARACTERS = /[AZaz]/
|
11
|
+
|
10
12
|
def parse(io)
|
11
13
|
trackers = []
|
12
14
|
until io.eof?
|
13
15
|
line = io.gets
|
14
|
-
next
|
16
|
+
next if (!line || line =~ /^#/)
|
15
17
|
|
16
|
-
if line =~
|
18
|
+
if line =~ CHARACTERS # Tracker with a name
|
17
19
|
t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
|
18
20
|
report_progress("Reading tracker #{t.name}")
|
19
21
|
parse_tracker(t, io)
|
@@ -26,7 +28,13 @@ class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
|
|
26
28
|
|
27
29
|
private
|
28
30
|
def parse_tracker(t, io)
|
29
|
-
|
31
|
+
first_tracker_line = io.gets.chomp
|
32
|
+
|
33
|
+
if first_tracker_line =~ CHARACTERS # PFTrack version 5 format
|
34
|
+
first_tracker_line = io.gets.chomp
|
35
|
+
end
|
36
|
+
|
37
|
+
num_of_keyframes = first_tracker_line.to_i
|
30
38
|
t.keyframes = (1..num_of_keyframes).map do
|
31
39
|
report_progress("Reading keyframe")
|
32
40
|
Tracksperanto::Keyframe.new do |k|
|
data/lib/pipeline/base.rb
CHANGED
data/lib/tracksperanto.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../helper'
|
2
|
+
|
3
|
+
class PFTrack5ExportTest < Test::Unit::TestCase
|
4
|
+
include ParabolicTracks
|
5
|
+
|
6
|
+
def test_human_name
|
7
|
+
assert_equal "PFTrack v5 .2dt file", Tracksperanto::Export::PFTrack5.human_name
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_desc_and_ext
|
11
|
+
assert_equal "pftrack_v5.2dt", Tracksperanto::Export::PFTrack5.desc_and_extension
|
12
|
+
end
|
13
|
+
|
14
|
+
P = File.dirname(__FILE__) + "/samples/ref_PFTrack5.2dt"
|
15
|
+
|
16
|
+
def test_export_output_written
|
17
|
+
create_reference_output Tracksperanto::Export::PFTrack5, P
|
18
|
+
end
|
19
|
+
end
|
@@ -4,16 +4,16 @@ class PFTrackExportTest < Test::Unit::TestCase
|
|
4
4
|
include ParabolicTracks
|
5
5
|
|
6
6
|
def test_human_name
|
7
|
-
assert_equal "PFTrack .2dt file", Tracksperanto::Export::
|
7
|
+
assert_equal "PFTrack v4 .2dt file", Tracksperanto::Export::PFTrack4.human_name
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_desc_and_ext
|
11
|
-
assert_equal "
|
11
|
+
assert_equal "pftrack_v4.2dt", Tracksperanto::Export::PFTrack4.desc_and_extension
|
12
12
|
end
|
13
13
|
|
14
14
|
P = File.dirname(__FILE__) + "/samples/ref_PFTrack.2dt"
|
15
15
|
|
16
16
|
def test_export_output_written
|
17
|
-
ensure_same_output Tracksperanto::Export::
|
17
|
+
ensure_same_output Tracksperanto::Export::PFTrack4, P
|
18
18
|
end
|
19
19
|
end
|
@@ -36,4 +36,13 @@ class PFTrackImportTest < Test::Unit::TestCase
|
|
36
36
|
assert_equal "Tracker41", trackers[-1].name
|
37
37
|
assert_equal 467, trackers[-1].keyframes.length
|
38
38
|
end
|
39
|
+
|
40
|
+
def test_garage_shot
|
41
|
+
fixture = File.open(File.dirname(__FILE__) + '/samples/garage.2dt')
|
42
|
+
parser = Tracksperanto::Import::PFTrack.new(:width => 1920, :height => 1080)
|
43
|
+
trackers = parser.parse(fixture)
|
44
|
+
assert_equal 250, trackers.length
|
45
|
+
assert_equal "Tracker121", trackers[0].name
|
46
|
+
assert_equal 189, trackers[0].length
|
47
|
+
end
|
39
48
|
end
|
@@ -27,19 +27,4 @@ class SyntheyesImportTest < Test::Unit::TestCase
|
|
27
27
|
assert_in_delta 886.212, first_kf.abs_y, DELTA
|
28
28
|
assert_in_delta 30.0, first_kf.residual, DELTA
|
29
29
|
end
|
30
|
-
|
31
|
-
def test_syntheyes_import_from_victorw
|
32
|
-
fixture = File.open(File.dirname(__FILE__) + "/samples/testalltrackers_VictorW.txt")
|
33
|
-
parser = Tracksperanto::Import::Syntheyes.new
|
34
|
-
parser.width = 1920
|
35
|
-
parser.height = 1080
|
36
|
-
|
37
|
-
trackers = parser.parse(fixture)
|
38
|
-
for tracker in trackers
|
39
|
-
puts tracker.inspect
|
40
|
-
STDOUT.flush
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracksperanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
@@ -168,6 +168,7 @@ test_files:
|
|
168
168
|
- test/export/test_match_mover_export.rb
|
169
169
|
- test/export/test_mux.rb
|
170
170
|
- test/export/test_nuke_export.rb
|
171
|
+
- test/export/test_pftrack5_export.rb
|
171
172
|
- test/export/test_pftrack_export.rb
|
172
173
|
- test/export/test_shake_export.rb
|
173
174
|
- test/export/test_syntheyes_export.rb
|