panomosity 0.1.14 → 0.1.15

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: 960aaa7a596d0b4a03dd08035f2ba977f213611ec966c854377d50e6579d6bc9
4
- data.tar.gz: 31897c3519e3dc653663da142195af8098c70227498c7a78c557f58829038f56
3
+ metadata.gz: 03fdb416c8d39656632189a9880aa52e3e60fff0dfc56b50183b59b3102f2f24
4
+ data.tar.gz: 6c52de6b53ca852186783e9dc20245b54b4cf1c1b36aaf58bc7604d396bd922f
5
5
  SHA512:
6
- metadata.gz: 6257b5e9f06245063f35a7c9c5694100022b589af83c2c8804c7c244d4025437af8be95d16d0508363107479d7895f822b133f2c0bff9bd220ff37fd04b41180
7
- data.tar.gz: 84838c53dc43d6e071223fedee1ea2c1f8a957a966d77f2867ad8cfc77a345e73bd72e05403b74484fdd17b086d4d1aba92bea58163aed1c526410ff25ede68b
6
+ metadata.gz: 077a3ad888b535c4c0d6a0602122e96a9cd23569ec9488dd699e3ef0a6bedc05f91df3e7780075b554e7447d10927ab9a48d257369a8de900653911ac1cf426c
7
+ data.tar.gz: 5362b8ad8a925074425e0df89397e2eb488a904553e9369eb4b94594df0f5f49a1210f54296ec9624d47b17039b1bcf7dd75ad6497ba139ab8bca38c59bc9612
@@ -110,7 +110,8 @@ module Panomosity
110
110
  subline_values = (@@attributes - %i(Vm n)).map do |attribute|
111
111
  value = self.send(attribute)
112
112
  if @@equaled_attributes.include?(attribute) && !options[:without_equal_signs]
113
- if value == 0.0
113
+ # Floats are distinctly not equaled attributes
114
+ if value == 0 && value.is_a?(Integer)
114
115
  "#{attribute}=#{value.to_i}"
115
116
  else
116
117
  "#{attribute}#{value}"
@@ -107,9 +107,9 @@ module Panomosity
107
107
 
108
108
  logger.debug "twice reducing #{name} neighborhood std outliers"
109
109
  avg, std = *calculate_average_and_std(values: total_neighborhoods.map { |n| n[:prdist_std] })
110
- total_neighborhoods.select! { |n| (avg - n[:prdist_std]).abs < std }
110
+ total_neighborhoods.select! { |n| (avg - n[:prdist_std]).abs <= std }
111
111
  avg, std = *calculate_average_and_std(values: total_neighborhoods.map { |n| n[:prdist_std] })
112
- total_neighborhoods.select! { |n| (avg - n[:prdist_std]).abs < std }
112
+ total_neighborhoods.select! { |n| (avg - n[:prdist_std]).abs <= std }
113
113
  neighborhood_group = total_neighborhoods.map do |neighborhood|
114
114
  ns_total = total_neighborhoods.select { |n| (n[:prdist_avg] - neighborhood[:prdist_avg]).abs < neighborhood[:prdist_std] }
115
115
  cps_total = ns_total.map { |n| n[:neighborhood_within_std].count }.reduce(:+)
@@ -18,6 +18,7 @@ module Panomosity
18
18
  generate_border_line_control_points
19
19
  get_detailed_control_point_info
20
20
  merge_image_parameters
21
+ nona_grid
21
22
  optimize
22
23
  prepare_for_pr0ntools
23
24
  remove_anchor_variables
@@ -408,7 +409,6 @@ module Panomosity
408
409
 
409
410
  # fix control points
410
411
  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
412
  control_point[:n] = image_map[control_point[:n].to_i]
413
413
  control_point[:N] = image_map[control_point[:N].to_i]
414
414
  end
@@ -429,6 +429,12 @@ module Panomosity
429
429
  save_file
430
430
  end
431
431
 
432
+ def nona_grid
433
+ logger.info 'running nona and generated column and row based stitch sections'
434
+ images = Image.parse(@input_file)
435
+
436
+ end
437
+
432
438
  def optimize
433
439
  logger.info 'optimizing'
434
440
  panorama = Panorama.new(@input_file, logger)
@@ -3,7 +3,11 @@ module Panomosity
3
3
  def calculate_average_and_std(name: 'value', values: [], logger: nil)
4
4
  average_value = values.reduce(:+).to_f / values.count
5
5
  logger.debug "average #{name}: #{average_value}" if logger
6
- value_std = Math.sqrt(values.map { |v| (v - average_value) ** 2 }.reduce(:+) / (values.count - 1))
6
+ if values.count == 1
7
+ value_std = 0.0
8
+ else
9
+ value_std = Math.sqrt(values.map { |v| (v - average_value) ** 2 }.reduce(:+) / (values.count - 1))
10
+ end
7
11
  logger.debug "#{name} std: #{value_std}" if logger
8
12
  [average_value, value_std]
9
13
  end
@@ -1,3 +1,3 @@
1
1
  module Panomosity
2
- VERSION = '0.1.14'
2
+ VERSION = '0.1.15'
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.14
4
+ version: 0.1.15
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-28 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler