panomosity 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/panomosity/runner.rb +21 -12
- data/lib/panomosity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 960aaa7a596d0b4a03dd08035f2ba977f213611ec966c854377d50e6579d6bc9
|
4
|
+
data.tar.gz: 31897c3519e3dc653663da142195af8098c70227498c7a78c557f58829038f56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6257b5e9f06245063f35a7c9c5694100022b589af83c2c8804c7c244d4025437af8be95d16d0508363107479d7895f822b133f2c0bff9bd220ff37fd04b41180
|
7
|
+
data.tar.gz: 84838c53dc43d6e071223fedee1ea2c1f8a957a966d77f2867ad8cfc77a345e73bd72e05403b74484fdd17b086d4d1aba92bea58163aed1c526410ff25ede68b
|
data/Gemfile.lock
CHANGED
data/lib/panomosity/runner.rb
CHANGED
@@ -394,6 +394,25 @@ module Panomosity
|
|
394
394
|
def merge_image_parameters
|
395
395
|
logger.info 'merging image parameters'
|
396
396
|
control_points = ControlPoint.parse(@compare_file)
|
397
|
+
images = Image.parse(@compare_file)
|
398
|
+
|
399
|
+
# sort images
|
400
|
+
logger.info 'sorting images in case they get out of order'
|
401
|
+
lexically_sorted_images = images
|
402
|
+
numerically_sorted_images = images.sort_by { |image| [image.column, image.row] }
|
403
|
+
image_map = {}
|
404
|
+
lexically_sorted_images.each_with_index do |image_l, i|
|
405
|
+
image_map[image_l.name] = numerically_sorted_images[i]
|
406
|
+
image_map[numerically_sorted_images[i].id.to_i] = image_l.id.to_i
|
407
|
+
end
|
408
|
+
|
409
|
+
# fix control points
|
410
|
+
control_points.each do |control_point|
|
411
|
+
logger.debug "#{control_point[:n]} => #{image_map[control_point[:n].to_i]} | #{control_point[:N]} => #{image_map[control_point[:N].to_i]}"
|
412
|
+
control_point[:n] = image_map[control_point[:n].to_i]
|
413
|
+
control_point[:N] = image_map[control_point[:N].to_i]
|
414
|
+
end
|
415
|
+
|
397
416
|
v_lines_started = false
|
398
417
|
@lines = @input_file.each_line.map do |line|
|
399
418
|
if line[0] == 'v'
|
@@ -416,20 +435,10 @@ module Panomosity
|
|
416
435
|
optimizer = Optimizer.new(panorama)
|
417
436
|
optimizer.run
|
418
437
|
|
419
|
-
# sort images
|
420
|
-
logger.info 'sorting images in case they get out of order'
|
421
|
-
lexically_sorted_images = optimizer.images
|
422
|
-
numerically_sorted_images = optimizer.images.sort_by { |image| [image.column, image.row] }
|
423
|
-
image_map = {}
|
424
|
-
lexically_sorted_images.each_with_index do |image_l, i|
|
425
|
-
image_map[image_l.name] = numerically_sorted_images[i]
|
426
|
-
end
|
427
|
-
|
428
438
|
@lines = @input_file.each_line.map do |line|
|
429
439
|
image = optimizer.images.find { |i| i.raw == line }
|
430
440
|
if image
|
431
|
-
|
432
|
-
sorted_image.to_s
|
441
|
+
image.to_s
|
433
442
|
else
|
434
443
|
next line
|
435
444
|
end
|
@@ -450,7 +459,7 @@ module Panomosity
|
|
450
459
|
i.n = "c#{ds.reverse.index(i.d)}_r#{es.reverse.index(i.e)}.jpg"
|
451
460
|
i.v = fov
|
452
461
|
end
|
453
|
-
images = images.sort_by
|
462
|
+
images = images.sort_by { |image| [image.column, image.row] }
|
454
463
|
|
455
464
|
index = -1
|
456
465
|
@lines = @input_file.each_line.map do |line|
|
data/lib/panomosity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panomosity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|