panomosity 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a182f799a0789e1a9a3ce30b1bf8936264397aa125b169331039a31436935fad
4
- data.tar.gz: c6409d39cfd42beb780f6c40059316290ff08cf6350b94139134e4857537d53e
3
+ metadata.gz: 960aaa7a596d0b4a03dd08035f2ba977f213611ec966c854377d50e6579d6bc9
4
+ data.tar.gz: 31897c3519e3dc653663da142195af8098c70227498c7a78c557f58829038f56
5
5
  SHA512:
6
- metadata.gz: 56dd5d550d87a277a8bc2778aa9a73dbd373e543cb53718c9ac5015de25ca307283414ffe4bbb28a66e440b9682c7109cb177f7202778f645851ef0fdf46612f
7
- data.tar.gz: cae10bb2101d9e69bccf7ca461fbe7821dce48bc3315c30d84465ddcfd1a8a224a16c242ce8392795601f31eb3d30d8ff984d5ce5a8bc8047b89b39cfa28106f
6
+ metadata.gz: 6257b5e9f06245063f35a7c9c5694100022b589af83c2c8804c7c244d4025437af8be95d16d0508363107479d7895f822b133f2c0bff9bd220ff37fd04b41180
7
+ data.tar.gz: 84838c53dc43d6e071223fedee1ea2c1f8a957a966d77f2867ad8cfc77a345e73bd72e05403b74484fdd17b086d4d1aba92bea58163aed1c526410ff25ede68b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- panomosity (0.1.12)
4
+ panomosity (0.1.14)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
- sorted_image = image_map[image.name]
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(&:n)
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|
@@ -1,3 +1,3 @@
1
1
  module Panomosity
2
- VERSION = '0.1.13'
2
+ VERSION = '0.1.14'
3
3
  end
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.13
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-18 00:00:00.000000000 Z
11
+ date: 2018-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler