pano 0.0.6 → 0.0.7
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.
- data/bin/pntool +1 -1
- data/lib/pano.rb +1 -1
- data/lib/pano/image.rb +1 -0
- data/lib/pano/image_file.rb +5 -10
- data/lib/pano/image_file_set.rb +9 -7
- data/lib/pano/version.rb +3 -0
- metadata +13 -23
data/bin/pntool
CHANGED
data/lib/pano.rb
CHANGED
data/lib/pano/image.rb
CHANGED
data/lib/pano/image_file.rb
CHANGED
@@ -7,10 +7,10 @@ module Pano
|
|
7
7
|
def initialize path
|
8
8
|
if path =~ /\.jpg$/i
|
9
9
|
@jpg_path = path
|
10
|
-
@raw_path = path.sub(/\.jpg$/i, ".
|
10
|
+
@raw_path = path.sub(/\.jpg$/i, ".NEF")
|
11
11
|
else
|
12
12
|
@raw_path = path
|
13
|
-
@jpg_path = path.sub(/\.
|
13
|
+
@jpg_path = path.sub(/\.nef$/i, ".JPG")
|
14
14
|
end
|
15
15
|
|
16
16
|
if File.exist?(@jpg_path)
|
@@ -23,16 +23,11 @@ module Pano
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def for_pano?
|
26
|
-
@for_pano ||= @info[:fov] > 95 &&
|
26
|
+
@for_pano ||= @info[:fov] > 95 && bracketed?
|
27
27
|
end
|
28
28
|
|
29
29
|
def bracketed?
|
30
|
-
@bracketed ||= @info["
|
31
|
-
end
|
32
|
-
|
33
|
-
def bracketing_number
|
34
|
-
b = @info["BracketValue"]
|
35
|
-
b == 0 ? 0 : b < 0 ? 1 : 2
|
30
|
+
@bracketed ||= @info["ShootingMode"] =~ /Bracketing/i
|
36
31
|
end
|
37
32
|
|
38
33
|
def list_info
|
@@ -46,7 +41,7 @@ module Pano
|
|
46
41
|
end
|
47
42
|
|
48
43
|
def copy_to dest_dir
|
49
|
-
FileUtils.mkpath dest_dir
|
44
|
+
FileUtils.mkpath dest_dir
|
50
45
|
FileUtils.cp(@raw_path, dest_dir) if File.exist?(@raw_path)
|
51
46
|
FileUtils.cp(@jpg_path, dest_dir) if File.exist?(@jpg_path)
|
52
47
|
end
|
data/lib/pano/image_file_set.rb
CHANGED
@@ -2,6 +2,7 @@ module Pano
|
|
2
2
|
|
3
3
|
class ImageFileSet
|
4
4
|
|
5
|
+
BRACKETS = 5
|
5
6
|
attr_reader :base_path, :files
|
6
7
|
|
7
8
|
def initialize dir_path
|
@@ -19,7 +20,7 @@ module Pano
|
|
19
20
|
while i < @files.length
|
20
21
|
file = @files[i]
|
21
22
|
if file.for_pano?
|
22
|
-
if pano.length < 13 *
|
23
|
+
if pano.length < 13 * BRACKETS
|
23
24
|
pano << file
|
24
25
|
else
|
25
26
|
last = pano.last
|
@@ -54,7 +55,7 @@ module Pano
|
|
54
55
|
file.copy_to pano_dir
|
55
56
|
end
|
56
57
|
i = 0
|
57
|
-
pano.each_slice(
|
58
|
+
pano.each_slice(BRACKETS) do |files|
|
58
59
|
i+=1
|
59
60
|
fused = enfuse(File.join(pano_dir, "fused"), "%02d" % i, files)
|
60
61
|
if apply_mask
|
@@ -84,13 +85,14 @@ module Pano
|
|
84
85
|
def enfuse dir, name, files = []
|
85
86
|
return if files.blank?
|
86
87
|
FileUtils.mkpath dir
|
87
|
-
contrast_weight = 0.6
|
88
|
-
entropy_weight = 0.4
|
89
|
-
exposure_weight = 0.5
|
90
|
-
saturation_weight = 0.2
|
88
|
+
# contrast_weight = 0.6
|
89
|
+
# entropy_weight = 0.4
|
90
|
+
# exposure_weight = 0.5
|
91
|
+
# saturation_weight = 0.2
|
91
92
|
target = File.join(dir, name + ".tif")
|
92
93
|
input = files.map {|file| file.jpg_path }.join(" ")
|
93
|
-
options = "--contrast-weight=#{contrast_weight} --entropy-weight=#{entropy_weight} --exposure-weight=#{exposure_weight} --saturation-weight=#{saturation_weight} --compression=LZW"
|
94
|
+
#options = "--contrast-weight=#{contrast_weight} --entropy-weight=#{entropy_weight} --exposure-weight=#{exposure_weight} --saturation-weight=#{saturation_weight} --compression=LZW"
|
95
|
+
options = "--compression=LZW"
|
94
96
|
system "enfuse #{options} -o #{target} #{input}"
|
95
97
|
|
96
98
|
target
|
data/lib/pano/version.rb
ADDED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 7
|
9
|
+
version: 0.0.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Yury Korolev
|
@@ -16,21 +16,8 @@ cert_chain: []
|
|
16
16
|
|
17
17
|
date: 2009-12-28 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
|
-
dependencies:
|
20
|
-
|
21
|
-
name: activesupport
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 2
|
29
|
-
- 3
|
30
|
-
- 5
|
31
|
-
version: 2.3.5
|
32
|
-
type: :runtime
|
33
|
-
version_requirements: *id001
|
19
|
+
dependencies: []
|
20
|
+
|
34
21
|
description: Split and fuse images for pano
|
35
22
|
email:
|
36
23
|
- yury.korolev@gmail.com
|
@@ -44,12 +31,13 @@ files:
|
|
44
31
|
- lib/pano/image.rb
|
45
32
|
- lib/pano/image_file.rb
|
46
33
|
- lib/pano/image_file_set.rb
|
34
|
+
- lib/pano/version.rb
|
47
35
|
- lib/pano.rb
|
48
36
|
- bin/pntool
|
49
37
|
- lib/mask.png
|
50
38
|
- lib/mask_last.png
|
51
39
|
has_rdoc: true
|
52
|
-
homepage: http://
|
40
|
+
homepage: http://github.com/yury/pano
|
53
41
|
licenses: []
|
54
42
|
|
55
43
|
post_install_message:
|
@@ -58,6 +46,7 @@ rdoc_options: []
|
|
58
46
|
require_paths:
|
59
47
|
- lib
|
60
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
61
50
|
requirements:
|
62
51
|
- - ">="
|
63
52
|
- !ruby/object:Gem::Version
|
@@ -65,20 +54,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
54
|
- 0
|
66
55
|
version: "0"
|
67
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
68
58
|
requirements:
|
69
59
|
- - ">="
|
70
60
|
- !ruby/object:Gem::Version
|
71
61
|
segments:
|
72
62
|
- 1
|
73
63
|
- 3
|
74
|
-
-
|
75
|
-
version: 1.3.
|
64
|
+
- 6
|
65
|
+
version: 1.3.6
|
76
66
|
requirements: []
|
77
67
|
|
78
|
-
rubyforge_project:
|
79
|
-
rubygems_version: 1.3.
|
68
|
+
rubyforge_project: rubyfish
|
69
|
+
rubygems_version: 1.3.7
|
80
70
|
signing_key:
|
81
71
|
specification_version: 3
|
82
|
-
summary:
|
72
|
+
summary: Just prepare photos for pano
|
83
73
|
test_files: []
|
84
74
|
|