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 +4 -4
- data/lib/panomosity/image.rb +2 -1
- data/lib/panomosity/panorama.rb +2 -2
- data/lib/panomosity/runner.rb +7 -1
- data/lib/panomosity/utils.rb +5 -1
- 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: 03fdb416c8d39656632189a9880aa52e3e60fff0dfc56b50183b59b3102f2f24
|
4
|
+
data.tar.gz: 6c52de6b53ca852186783e9dc20245b54b4cf1c1b36aaf58bc7604d396bd922f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 077a3ad888b535c4c0d6a0602122e96a9cd23569ec9488dd699e3ef0a6bedc05f91df3e7780075b554e7447d10927ab9a48d257369a8de900653911ac1cf426c
|
7
|
+
data.tar.gz: 5362b8ad8a925074425e0df89397e2eb488a904553e9369eb4b94594df0f5f49a1210f54296ec9624d47b17039b1bcf7dd75ad6497ba139ab8bca38c59bc9612
|
data/lib/panomosity/image.rb
CHANGED
@@ -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
|
-
|
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}"
|
data/lib/panomosity/panorama.rb
CHANGED
@@ -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
|
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
|
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(:+)
|
data/lib/panomosity/runner.rb
CHANGED
@@ -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)
|
data/lib/panomosity/utils.rb
CHANGED
@@ -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
|
-
|
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
|
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.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-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|