sqed 0.1.9 → 0.2.0
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/.gitignore +1 -1
- data/.ruby-version +1 -0
- data/lib/sqed.rb +14 -14
- data/lib/sqed/boundary_finder.rb +16 -16
- data/lib/sqed/boundary_finder/color_line_finder.rb +40 -40
- data/lib/sqed/boundary_finder/cross_finder.rb +4 -4
- data/lib/sqed/boundary_finder/stage_finder.rb +9 -9
- data/lib/sqed/extractor.rb +13 -7
- data/lib/sqed/parser/barcode_parser.rb +3 -4
- data/lib/sqed/version.rb +1 -1
- data/lib/sqed_config.rb +1 -1
- data/spec/lib/sqed/boundaries_spec.rb +1 -1
- data/spec/lib/sqed/boundary_finder/color_line_finder_spec.rb +9 -9
- data/spec/lib/sqed/boundary_finder/cross_finder_spec.rb +1 -1
- data/spec/lib/sqed/boundary_finder/stage_finder_spec.rb +1 -1
- data/spec/lib/sqed/boundary_finder_spec.rb +19 -19
- data/spec/lib/sqed/extractor_spec.rb +4 -4
- data/spec/lib/sqed_spec.rb +2 -2
- data/spec/lib/stage_handling/seven_slot_spec.rb +1 -1
- data/sqed.gemspec +6 -4
- metadata +10 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a7fe6566fc76b5738f737ac760e511d1f360fe8
|
4
|
+
data.tar.gz: cd8b334216292a26934dbcbefcededcc74286504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc748be67d623a0e9f2675387ca555d71c5667729dae43ad6c40a32ed920795e32ef9ec39a6c80cdabea7631e4f8a7492f02de223f3d7aa02835686020c8082c
|
7
|
+
data.tar.gz: 89755069a82bc70380dca99e637379da4b2bf16ad0c61b2f2d0b985d1fe3d1247e1b5242ccfc41fa30ff270963d8c203eab1ed52dc612212c37dc6df2f312510
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/lib/sqed.rb
CHANGED
@@ -53,16 +53,16 @@ class Sqed
|
|
53
53
|
# Provide a boundary_finder, overrides metadata taken from pattern
|
54
54
|
attr_accessor :boundary_finder
|
55
55
|
|
56
|
-
def initialize(
|
57
|
-
raise 'extraction pattern not defined' if
|
56
|
+
def initialize(target_image: image, target_pattern: pattern, has_border: true, boundary_color: :green, use_thumbnail: true, boundary_finder: nil, target_layout: nil, metadata_map: nil)
|
57
|
+
raise 'extraction pattern not defined' if target_pattern && !SqedConfig::EXTRACTION_PATTERNS.keys.include?(target_pattern)
|
58
58
|
|
59
59
|
# data, and stubs for results
|
60
|
-
@image =
|
60
|
+
@image = target_image
|
61
61
|
@boundaries = nil
|
62
62
|
@stage_boundary = Sqed::Boundaries.new(:internal_box)
|
63
63
|
|
64
64
|
# extraction metadata
|
65
|
-
@pattern = (
|
65
|
+
@pattern = (target_pattern || :cross)
|
66
66
|
@has_border = has_border
|
67
67
|
@boundary_finder = boundary_finder.constantize if boundary_finder
|
68
68
|
@layout = layout
|
@@ -76,13 +76,13 @@ class Sqed
|
|
76
76
|
# @return [Hash]
|
77
77
|
# federate extraction options and apply user provided over-rides
|
78
78
|
def extraction_metadata
|
79
|
-
data = SqedConfig::EXTRACTION_PATTERNS[
|
79
|
+
data = SqedConfig::EXTRACTION_PATTERNS[pattern]
|
80
80
|
|
81
81
|
data.merge!(boundary_color: boundary_color)
|
82
82
|
data.merge!(boundary_finder: @boundary_finder) if boundary_finder
|
83
83
|
data.merge!(has_border: has_border)
|
84
|
-
data.merge!(
|
85
|
-
data.merge!(
|
84
|
+
data.merge!(target_layout: layout) if layout
|
85
|
+
data.merge!(target_metadata_map: metadata_map) if metadata_map
|
86
86
|
data.merge!(use_thumbnail: use_thumbnail)
|
87
87
|
data
|
88
88
|
end
|
@@ -136,16 +136,16 @@ class Sqed
|
|
136
136
|
# pattern.nil? is no longer true -> must have values for all extraction_metadata keys
|
137
137
|
return false if image.nil? || pattern.nil?
|
138
138
|
extractor = Sqed::Extractor.new(
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
target_boundaries: boundaries,
|
140
|
+
target_metadata_map: extraction_metadata[:metadata_map],
|
141
|
+
target_image: stage_image)
|
142
142
|
extractor.result
|
143
143
|
end
|
144
144
|
|
145
145
|
# @return [Hash]
|
146
146
|
# an overview of data/metadata, for debugging purposes only
|
147
147
|
def attributes
|
148
|
-
{
|
148
|
+
{ target_image: image,
|
149
149
|
boundaries: boundaries,
|
150
150
|
stage_boundary: stage_boundary
|
151
151
|
}.merge!(extraction_metadata)
|
@@ -155,7 +155,7 @@ class Sqed
|
|
155
155
|
|
156
156
|
def set_stage_boundary
|
157
157
|
if has_border
|
158
|
-
boundary = Sqed::BoundaryFinder::StageFinder.new(
|
158
|
+
boundary = Sqed::BoundaryFinder::StageFinder.new(target_image: image).boundaries
|
159
159
|
if boundary.populated?
|
160
160
|
@stage_boundary.set(0, boundary.for(0))
|
161
161
|
else
|
@@ -167,8 +167,8 @@ class Sqed
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def get_section_boundaries
|
170
|
-
options = {
|
171
|
-
options.merge!(
|
170
|
+
options = {target_image: stage_image, use_thumbnail: use_thumbnail}
|
171
|
+
options.merge!( target_layout: extraction_metadata[:layout] ) unless extraction_metadata[:boundary_finder].name == 'Sqed::BoundaryFinder::CrossFinder'
|
172
172
|
options.merge!( boundary_color: boundary_color) if extraction_metadata[:boundary_finder].name == 'Sqed::BoundaryFinder::ColorLineFinder'
|
173
173
|
|
174
174
|
extraction_metadata[:boundary_finder].new(options).boundaries
|
data/lib/sqed/boundary_finder.rb
CHANGED
@@ -7,7 +7,7 @@ class Sqed::BoundaryFinder
|
|
7
7
|
COLOR_DELTA = 1.3 # color (e.g. red) must be this much be *COLOR_DELTA > than other values (e.g. blue/green)
|
8
8
|
|
9
9
|
# the passed image
|
10
|
-
attr_reader :
|
10
|
+
attr_reader :image
|
11
11
|
|
12
12
|
# a symbol from SqedConfig::LAYOUTS
|
13
13
|
attr_reader :layout
|
@@ -21,14 +21,14 @@ class Sqed::BoundaryFinder
|
|
21
21
|
# when we compute using a derived thumbnail we temporarily store the full size image here
|
22
22
|
attr_reader :original_image
|
23
23
|
|
24
|
-
def initialize(
|
25
|
-
raise 'No layout provided.' if
|
26
|
-
raise 'No image provided.' if
|
24
|
+
def initialize(target_image: image, target_layout: layout, use_thumbnail: true)
|
25
|
+
raise 'No layout provided.' if target_layout.nil?
|
26
|
+
raise 'No image provided.' if target_image.nil? || target_image.class.name != 'Magick::Image'
|
27
27
|
|
28
28
|
@use_thumbnail = use_thumbnail
|
29
29
|
|
30
|
-
@layout =
|
31
|
-
@
|
30
|
+
@layout = target_layout
|
31
|
+
@image = target_image
|
32
32
|
true
|
33
33
|
end
|
34
34
|
|
@@ -38,14 +38,14 @@ class Sqed::BoundaryFinder
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def longest_thumbnail_axis
|
41
|
-
|
41
|
+
image.columns > image.rows ? :width : :height
|
42
42
|
end
|
43
43
|
|
44
44
|
def thumbnail_height
|
45
45
|
if longest_thumbnail_axis == :height
|
46
46
|
THUMB_SIZE
|
47
47
|
else
|
48
|
-
(
|
48
|
+
(image.rows.to_f * (THUMB_SIZE.to_f / image.columns.to_f)).round.to_i
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -53,21 +53,21 @@ class Sqed::BoundaryFinder
|
|
53
53
|
if longest_thumbnail_axis == :width
|
54
54
|
THUMB_SIZE
|
55
55
|
else
|
56
|
-
(
|
56
|
+
(image.columns.to_f * (THUMB_SIZE.to_f / image.rows.to_f)).round.to_i
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
# see https://rmagick.github.io/image3.html#thumbnail
|
61
61
|
def thumbnail
|
62
|
-
|
62
|
+
image.thumbnail(thumbnail_width, thumbnail_height)
|
63
63
|
end
|
64
64
|
|
65
65
|
def width_factor
|
66
|
-
|
66
|
+
image.columns.to_f / thumbnail_width.to_f
|
67
67
|
end
|
68
68
|
|
69
69
|
def height_factor
|
70
|
-
|
70
|
+
image.rows.to_f / thumbnail_height.to_f
|
71
71
|
end
|
72
72
|
|
73
73
|
def zoom_boundaries
|
@@ -114,9 +114,9 @@ class Sqed::BoundaryFinder
|
|
114
114
|
# @param scan
|
115
115
|
# (:rows|:columns), :rows finds vertical borders, :columns finds horizontal borders
|
116
116
|
#
|
117
|
-
def self.color_boundary_finder(
|
117
|
+
def self.color_boundary_finder(target_image: image, sample_subdivision_size: nil, sample_cutoff_factor: nil, scan: :rows, boundary_color: :green)
|
118
118
|
|
119
|
-
image_width =
|
119
|
+
image_width = target_image.send(scan)
|
120
120
|
sample_subdivision_size = get_subdivision_size(image_width) if sample_subdivision_size.nil?
|
121
121
|
samples_to_take = (image_width / sample_subdivision_size).to_i - 1
|
122
122
|
|
@@ -125,9 +125,9 @@ class Sqed::BoundaryFinder
|
|
125
125
|
(0..samples_to_take).each do |s|
|
126
126
|
# Create a sample image a single pixel tall
|
127
127
|
if scan == :rows
|
128
|
-
j =
|
128
|
+
j = target_image.crop(0, s * sample_subdivision_size, target_image.columns, 1, true)
|
129
129
|
elsif scan == :columns
|
130
|
-
j =
|
130
|
+
j = target_image.crop(s * sample_subdivision_size, 0, 1, target_image.rows, true)
|
131
131
|
else
|
132
132
|
raise
|
133
133
|
end
|
@@ -4,14 +4,14 @@ require 'rmagick'
|
|
4
4
|
#
|
5
5
|
class Sqed::BoundaryFinder::ColorLineFinder < Sqed::BoundaryFinder
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
super(
|
7
|
+
def initialize(target_image: image, target_layout: layout, boundary_color: :green, use_thumbnail: true)
|
8
|
+
super(target_image: target_image, target_layout: target_layout, use_thumbnail: use_thumbnail)
|
9
9
|
raise 'No layout provided.' if @layout.nil?
|
10
10
|
@boundary_color = boundary_color
|
11
11
|
|
12
12
|
if use_thumbnail
|
13
|
-
@original_image = @
|
14
|
-
@
|
13
|
+
@original_image = @image.copy
|
14
|
+
@image = thumbnail
|
15
15
|
end
|
16
16
|
find_bands
|
17
17
|
end
|
@@ -19,64 +19,64 @@ class Sqed::BoundaryFinder::ColorLineFinder < Sqed::BoundaryFinder
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def find_bands
|
22
|
-
case
|
22
|
+
case layout # boundaries.coordinates are referenced from stage image
|
23
23
|
|
24
24
|
# No specs for this yet
|
25
25
|
when :seven_slot
|
26
|
-
top_bottom_split = Sqed::BoundaryFinder.color_boundary_finder(
|
27
|
-
left_right_split = Sqed::BoundaryFinder.color_boundary_finder(
|
26
|
+
top_bottom_split = Sqed::BoundaryFinder.color_boundary_finder(target_image: image, scan: :columns, boundary_color: @boundary_color) # detect vertical division [array]
|
27
|
+
left_right_split = Sqed::BoundaryFinder.color_boundary_finder(target_image: image, sample_subdivision_size: 2, boundary_color: @boundary_color) # detect horizontal division [array]
|
28
28
|
|
29
29
|
boundaries.set(0, [0, 0, left_right_split[0], top_bottom_split[0] ])
|
30
|
-
boundaries.set(6, [0, top_bottom_split[2], left_right_split[0],
|
30
|
+
boundaries.set(6, [0, top_bottom_split[2], left_right_split[0], image.rows - top_bottom_split[2] ] )
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
right_top_image = image.crop( left_right_split[2], 0, image.columns - left_right_split[2], top_bottom_split[0] , true) # sections 1,2
|
33
|
+
right_bottom_image = image.crop(left_right_split[2], top_bottom_split[2], image.columns - left_right_split[2], image.rows - top_bottom_split[2], true) # sections 3,4,5
|
34
34
|
|
35
|
-
right_top_split = corrected_frequency(Sqed::BoundaryFinder.color_boundary_finder(
|
35
|
+
right_top_split = corrected_frequency(Sqed::BoundaryFinder.color_boundary_finder(target_image: right_top_image, boundary_color: @boundary_color)) # vertical line b/w 1 & 2, use "corrected_frequency" to account for color bleed from previous crop
|
36
36
|
|
37
37
|
boundaries.set(1, [left_right_split[2], 0, right_top_split[0], top_bottom_split[0] ])
|
38
|
-
boundaries.set(2, [left_right_split[2] + right_top_split[2], 0,
|
38
|
+
boundaries.set(2, [left_right_split[2] + right_top_split[2], 0, right_top_image.columns - right_top_split[2], top_bottom_split[0] ] )
|
39
39
|
|
40
|
-
right_bottom_split = corrected_frequency(Sqed::BoundaryFinder.color_boundary_finder(
|
40
|
+
right_bottom_split = corrected_frequency(Sqed::BoundaryFinder.color_boundary_finder(target_image: right_bottom_image, scan: :columns, sample_subdivision_size: 2, boundary_color: @boundary_color)) # horizontal line b/w (5,3) & 4, use "corrected_frequency" to account for color bleed from previous crop
|
41
41
|
|
42
|
-
|
42
|
+
bottom_right_top_image = right_bottom_image.crop(0,0, image.columns - left_right_split[2], right_bottom_split[2], true) # 3,5
|
43
43
|
|
44
|
-
boundaries.set(3, [ left_right_split[2] + right_top_split[2], top_bottom_split[2], left_right_split[2] + right_top_split[2],
|
45
|
-
boundaries.set(5, [ left_right_split[2], top_bottom_split[2], right_top_split[0],
|
44
|
+
boundaries.set(3, [ left_right_split[2] + right_top_split[2], top_bottom_split[2], left_right_split[2] + right_top_split[2], bottom_right_top_image.rows ] )
|
45
|
+
boundaries.set(5, [ left_right_split[2], top_bottom_split[2], right_top_split[0], bottom_right_top_image.rows ] )
|
46
46
|
|
47
|
-
boundaries.set(4, [ left_right_split[2], top_bottom_split[2] + right_top_split[2],
|
47
|
+
boundaries.set(4, [ left_right_split[2], top_bottom_split[2] + right_top_split[2], image.columns - left_right_split[2], right_bottom_image.rows - right_top_split[2] ] )
|
48
48
|
|
49
49
|
when :vertical_split
|
50
|
-
t = Sqed::BoundaryFinder.color_boundary_finder(
|
50
|
+
t = Sqed::BoundaryFinder.color_boundary_finder(target_image: image, boundary_color: @boundary_color) #detect vertical division
|
51
51
|
return if t.nil?
|
52
|
-
boundaries.set(0, [0, 0, t[0],
|
53
|
-
boundaries.set(1, [t[2], 0,
|
52
|
+
boundaries.set(0, [0, 0, t[0], image.rows]) # left section of image
|
53
|
+
boundaries.set(1, [t[2], 0, image.columns - t[2], image.rows]) # right section of image
|
54
54
|
|
55
55
|
when :horizontal_split
|
56
|
-
t = Sqed::BoundaryFinder.color_boundary_finder(
|
56
|
+
t = Sqed::BoundaryFinder.color_boundary_finder(target_image: image, scan: :columns, boundary_color: @boundary_color) # set to detect horizontal division
|
57
57
|
return if t.nil?
|
58
58
|
|
59
|
-
boundaries.set(0, [0, 0,
|
60
|
-
boundaries.set(1, [0, t[2],
|
59
|
+
boundaries.set(0, [0, 0, image.columns, t[0]]) # upper section of image
|
60
|
+
boundaries.set(1, [0, t[2], image.columns, image.rows - t[2]]) # lower section of image
|
61
61
|
|
62
62
|
when :right_t # only 3 zones expected, with horizontal division in right-side of vertical division
|
63
|
-
vertical = self.class.new(
|
63
|
+
vertical = self.class.new(target_image: @image, target_layout: :vertical_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries
|
64
64
|
|
65
|
-
irt =
|
66
|
-
right = self.class.new(
|
65
|
+
irt = image.crop(*vertical.for(1), true)
|
66
|
+
right = self.class.new(target_image: irt, target_layout: :horizontal_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries
|
67
67
|
|
68
68
|
boundaries.set(0, vertical.for(0))
|
69
69
|
boundaries.set(1, [ vertical.x_for(1), 0, right.width_for(0), right.height_for(0) ] )
|
70
70
|
boundaries.set(2, [ vertical.x_for(1), right.y_for(1), right.width_for(1), right.height_for(1)] )
|
71
71
|
|
72
72
|
when :vertical_offset_cross # 4 zones expected, with (varying) horizontal division in left- and right- sides of vertical division
|
73
|
-
vertical = self.class.new(
|
73
|
+
vertical = self.class.new(target_image: @image, target_layout: :vertical_split, boundary_color: @boundary_color, use_thumbnail: false).boundaries
|
74
74
|
|
75
|
-
ilt =
|
76
|
-
irt =
|
75
|
+
ilt = image.crop(*vertical.for(0), true)
|
76
|
+
irt = image.crop(*vertical.for(1), true)
|
77
77
|
|
78
|
-
left = self.class.new(
|
79
|
-
right = self.class.new(
|
78
|
+
left = self.class.new(target_image: ilt, target_layout: :horizontal_split, boundary_color: @boundary_color, use_thumbnail: false).boundaries # fails
|
79
|
+
right = self.class.new(target_image: irt, target_layout: :horizontal_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries # OK
|
80
80
|
|
81
81
|
boundaries.set(0, [0, 0, left.width_for(0), left.height_for(0) ])
|
82
82
|
boundaries.set(1, [vertical.x_for(1), 0, right.width_for(0), right.height_for(0) ])
|
@@ -85,13 +85,13 @@ class Sqed::BoundaryFinder::ColorLineFinder < Sqed::BoundaryFinder
|
|
85
85
|
|
86
86
|
# No specs for this yet
|
87
87
|
when :horizontal_offset_cross
|
88
|
-
horizontal = self.class.new(
|
88
|
+
horizontal = self.class.new(target_image: @image, target_layout: :horizontal_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries
|
89
89
|
|
90
|
-
itop =
|
91
|
-
ibottom =
|
90
|
+
itop = image.crop(*horizontal.for(0), true)
|
91
|
+
ibottom = image.crop(*horizontal.for(1), true)
|
92
92
|
|
93
|
-
top = self.class.new(
|
94
|
-
bottom = self.class.new(
|
93
|
+
top = self.class.new(target_image: ilt, target_layout: :vertical_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries
|
94
|
+
bottom = self.class.new(target_image: irt, target_layout: :vertical_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries
|
95
95
|
|
96
96
|
boundaries.set(0, [0, 0, top.width_for(0), top.height_for(0) ])
|
97
97
|
boundaries.set(1, [top.x_for(1), 0, top.width_for(1), top.height_for(1) ])
|
@@ -99,8 +99,8 @@ class Sqed::BoundaryFinder::ColorLineFinder < Sqed::BoundaryFinder
|
|
99
99
|
boundaries.set(3, [0, horizontal.y_for(1), bottom.width_for(0), bottom.height_for(0) ])
|
100
100
|
|
101
101
|
when :cross # 4 zones, with perfectly intersected horizontal and vertical division
|
102
|
-
v = self.class.new(
|
103
|
-
h = self.class.new(
|
102
|
+
v = self.class.new(target_image: @image, target_layout: :vertical_split, boundary_color: @boundary_color, use_thumbnail: false ).boundaries
|
103
|
+
h = self.class.new(target_image: @image, target_layout: :horizontal_split, boundary_color: @boundary_color, use_thumbnail: false).boundaries
|
104
104
|
|
105
105
|
return if v.nil? || h.nil?
|
106
106
|
|
@@ -111,13 +111,13 @@ class Sqed::BoundaryFinder::ColorLineFinder < Sqed::BoundaryFinder
|
|
111
111
|
|
112
112
|
else # no @layout provided !?
|
113
113
|
|
114
|
-
boundaries.set(0, [0, 0,
|
114
|
+
boundaries.set(0, [0, 0, image.columns, image.rows]) # totality of image as default
|
115
115
|
end
|
116
116
|
|
117
117
|
boundaries.complete = true if boundaries.populated?
|
118
118
|
|
119
119
|
if use_thumbnail
|
120
|
-
@
|
120
|
+
@image = @original_image
|
121
121
|
zoom_boundaries
|
122
122
|
@original_image = nil
|
123
123
|
end
|
@@ -4,14 +4,14 @@ require 'rmagick'
|
|
4
4
|
#
|
5
5
|
class Sqed::BoundaryFinder::CrossFinder < Sqed::BoundaryFinder
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
@
|
7
|
+
def initialize(target_image: image)
|
8
|
+
@image = target_image
|
9
9
|
find_edges
|
10
10
|
end
|
11
11
|
|
12
12
|
def find_edges
|
13
|
-
width =
|
14
|
-
height =
|
13
|
+
width = image.columns / 2
|
14
|
+
height = image.rows / 2
|
15
15
|
|
16
16
|
boundaries.coordinates[0] = [0, 0, width, height]
|
17
17
|
boundaries.coordinates[1] = [width, 0, width, height]
|
@@ -15,20 +15,20 @@ class Sqed::BoundaryFinder::StageFinder < Sqed::BoundaryFinder
|
|
15
15
|
|
16
16
|
attr_reader :x0, :y0, :x1, :y1, :min_width, :min_height, :rows, :columns
|
17
17
|
|
18
|
-
def initialize(
|
19
|
-
super(
|
18
|
+
def initialize(target_image: image, is_border_proc: nil, min_ratio: MIN_CROP_RATIO)
|
19
|
+
super(target_image: target_image, target_layout: :internal_box)
|
20
20
|
|
21
21
|
@min_ratio = min_ratio
|
22
22
|
|
23
23
|
# Initial co-ordinates
|
24
24
|
@x0, @y0 = 0, 0
|
25
|
-
@x1, @y1 =
|
26
|
-
@min_width, @min_height =
|
27
|
-
@columns, @rows =
|
25
|
+
@x1, @y1 = image.columns, image.rows
|
26
|
+
@min_width, @min_height = image.columns * @min_ratio, image.rows * @min_ratio # minimum resultant area
|
27
|
+
@columns, @rows = image.columns, image.rows
|
28
28
|
|
29
29
|
|
30
30
|
# We need a border finder proc. Provide one if none was given.
|
31
|
-
@is_border = is_border_proc || self.class.default_border_finder(
|
31
|
+
@is_border = is_border_proc || self.class.default_border_finder(image) # if no proc specified, use default below
|
32
32
|
|
33
33
|
@x00 = @x0
|
34
34
|
@y00 = @y0
|
@@ -53,7 +53,7 @@ class Sqed::BoundaryFinder::StageFinder < Sqed::BoundaryFinder
|
|
53
53
|
# fails for 0.75, (0.18, 0.17,0.16,0.15); 0.70, 0.18;
|
54
54
|
#
|
55
55
|
# this sets variables (locally) for find_edges
|
56
|
-
def self.default_border_finder(
|
56
|
+
def self.default_border_finder(image, samples = 5, threshold = 0.75, fuzz_factor = 0.40) # working on non-synthetic images 04-dec-2014
|
57
57
|
fuzz = ((Magick::QuantumRange + 1) * fuzz_factor).to_i
|
58
58
|
# Returns true if the edge is a border (border meaning outer region to be cropped)
|
59
59
|
lambda do |edge|
|
@@ -122,11 +122,11 @@ class Sqed::BoundaryFinder::StageFinder < Sqed::BoundaryFinder
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def vline(x)
|
125
|
-
|
125
|
+
image.get_pixels x, @y00, 1, @height0 - 1
|
126
126
|
end
|
127
127
|
|
128
128
|
def hline(y)
|
129
|
-
|
129
|
+
image.get_pixels @x00, y, @width0 - 1, 1
|
130
130
|
end
|
131
131
|
|
132
132
|
# actually + 1 (starting at zero?)
|
data/lib/sqed/extractor.rb
CHANGED
@@ -4,6 +4,8 @@ require 'rmagick'
|
|
4
4
|
#
|
5
5
|
class Sqed::Extractor
|
6
6
|
|
7
|
+
class Error < StandardError; end;
|
8
|
+
|
7
9
|
# a Sqed::Boundaries instance
|
8
10
|
attr_accessor :boundaries
|
9
11
|
|
@@ -14,14 +16,14 @@ class Sqed::Extractor
|
|
14
16
|
# a Magick::Image file
|
15
17
|
attr_accessor :image
|
16
18
|
|
17
|
-
def initialize(
|
18
|
-
raise 'boundaries not provided or provided boundary is not a Sqed::Boundaries' if
|
19
|
-
raise 'metadata_map not provided or metadata_map not a Hash' if
|
20
|
-
raise 'image not provided' if
|
19
|
+
def initialize(target_boundaries: boundaries, target_metadata_map: metadata_map, target_image: image)
|
20
|
+
raise Error, 'boundaries not provided or provided boundary is not a Sqed::Boundaries' if target_boundaries.nil? || !target_boundaries.class == Sqed::Boundaries
|
21
|
+
raise Error, 'metadata_map not provided or metadata_map not a Hash' if target_metadata_map.nil? || !target_metadata_map.class == Hash
|
22
|
+
raise Error, 'image not provided' if target_image.nil? || !target_image.class.name == 'Magick::Image'
|
21
23
|
|
22
|
-
@metadata_map =
|
23
|
-
@boundaries =
|
24
|
-
@image =
|
24
|
+
@metadata_map = target_metadata_map
|
25
|
+
@boundaries = target_boundaries
|
26
|
+
@image = target_image
|
25
27
|
end
|
26
28
|
|
27
29
|
def result
|
@@ -32,6 +34,10 @@ class Sqed::Extractor
|
|
32
34
|
# assign the images to the result
|
33
35
|
boundaries.each do |section_index, coords|
|
34
36
|
section_type = metadata_map[section_index]
|
37
|
+
|
38
|
+
# TODO: raise this higher up the chain
|
39
|
+
raise Error, "invalid section_type [#{section_type}]" if !SqedConfig::LAYOUT_SECTION_TYPES.include?(section_type)
|
40
|
+
|
35
41
|
r.send("#{section_type}_image=", extract_image(coords))
|
36
42
|
r.boundary_coordinates[section_type] = coords
|
37
43
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# Given an image, return an ordered array of detectable barcodes
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
#
|
3
|
+
#
|
5
4
|
class Sqed::Parser::BarcodeParser < Sqed::Parser
|
6
5
|
|
7
6
|
TYPE = :barcode
|
@@ -23,7 +22,7 @@ class Sqed::Parser::BarcodeParser < Sqed::Parser
|
|
23
22
|
# Uses the same enging as zbarimg that you can install with brew (zbarimg)
|
24
23
|
#
|
25
24
|
def get_code_128
|
26
|
-
ZXing.decode @image.filename
|
25
|
+
nil # ZXing.decode @image.filename
|
27
26
|
end
|
28
27
|
|
29
28
|
# try a bunch of options, organized by most common, give the first hit
|
data/lib/sqed/version.rb
CHANGED
data/lib/sqed_config.rb
CHANGED
@@ -33,7 +33,7 @@ describe Sqed::Boundaries do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
context '#offset' do
|
36
|
-
let(:s) { Sqed.new(
|
36
|
+
let(:s) { Sqed.new(target_image: ImageHelpers.crossy_green_line_specimen, target_pattern: :vertical_offset_cross) }
|
37
37
|
let(:offset_boundaries) {
|
38
38
|
s.crop_image
|
39
39
|
s.boundaries.offset(s.stage_boundary)
|
@@ -4,29 +4,29 @@ describe Sqed::BoundaryFinder::ColorLineFinder do
|
|
4
4
|
|
5
5
|
let(:image) { ImageHelpers.crossy_green_line_specimen }
|
6
6
|
|
7
|
-
let(:b) { Sqed::BoundaryFinder::StageFinder.new(
|
7
|
+
let(:b) { Sqed::BoundaryFinder::StageFinder.new(target_image: image) }
|
8
8
|
let(:c) {b.boundaries}
|
9
9
|
let(:d) { image.crop(*c.for(0), true) }
|
10
10
|
|
11
|
-
let(:e) { Sqed::BoundaryFinder::ColorLineFinder.new(
|
11
|
+
let(:e) { Sqed::BoundaryFinder::ColorLineFinder.new(target_image: d, target_layout: :right_t, use_thumbnail: false) }
|
12
12
|
let(:f) { e.boundaries }
|
13
|
-
let(:g) { Sqed::BoundaryFinder::ColorLineFinder.new(
|
13
|
+
let(:g) { Sqed::BoundaryFinder::ColorLineFinder.new(target_image: d, target_layout: :vertical_offset_cross, use_thumbnail: false)}
|
14
14
|
let(:h) { g.boundaries }
|
15
|
-
let(:gv) { Sqed::BoundaryFinder::ColorLineFinder.new(
|
15
|
+
let(:gv) { Sqed::BoundaryFinder::ColorLineFinder.new(target_image: d, target_layout: :vertical_split, use_thumbnail: false) }
|
16
16
|
let(:hv) { gv.boundaries }
|
17
17
|
|
18
18
|
let(:ah) { ImageHelpers.vertical_offset_cross_red }
|
19
|
-
let(:bh) { Sqed::BoundaryFinder::StageFinder.new(
|
19
|
+
let(:bh) { Sqed::BoundaryFinder::StageFinder.new(target_image: ah) }
|
20
20
|
let(:ch) { bh.boundaries }
|
21
21
|
let(:dh) { ah.crop(*ch.for(0), true) }
|
22
|
-
let(:gh) { Sqed::BoundaryFinder::ColorLineFinder.new(
|
22
|
+
let(:gh) { Sqed::BoundaryFinder::ColorLineFinder.new(target_image: dh, target_layout: :horizontal_split, boundary_color: :red, use_thumbnail: false) } # was :horizontal_split
|
23
23
|
let(:hh) { gh.boundaries }
|
24
24
|
|
25
25
|
let(:ibs) { ImageHelpers.black_stage_green_line_specimen }
|
26
|
-
let(:bbs) { Sqed::BoundaryFinder::StageFinder.new(
|
26
|
+
let(:bbs) { Sqed::BoundaryFinder::StageFinder.new(target_image: ibs) }
|
27
27
|
let(:cbs) { bbs.boundaries }
|
28
28
|
let(:dbs) { ibs.crop(*cbs.for(0), true) }
|
29
|
-
let(:gbs) { Sqed::BoundaryFinder::ColorLineFinder.new(
|
29
|
+
let(:gbs) { Sqed::BoundaryFinder::ColorLineFinder.new(target_image: dbs, target_layout: :vertical_offset_cross, use_thumbnail: false) }
|
30
30
|
let(:hbs) { gbs.boundaries }
|
31
31
|
|
32
32
|
specify 'initial image columns are as expected for :image above' do
|
@@ -167,7 +167,7 @@ describe Sqed::BoundaryFinder::ColorLineFinder do
|
|
167
167
|
context 'thumbnail processing finds reasonable boundaries' do
|
168
168
|
|
169
169
|
let(:thumb) { ImageHelpers.frost_stage_thumb }
|
170
|
-
let(:finder) { Sqed::BoundaryFinder::ColorLineFinder.new(
|
170
|
+
let(:finder) { Sqed::BoundaryFinder::ColorLineFinder.new(target_image: thumb, target_layout: :cross, use_thumbnail: false)}
|
171
171
|
let(:finder_boundaries) { finder.boundaries }
|
172
172
|
|
173
173
|
let(:pct) { 0.08 }
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Sqed::BoundaryFinder::CrossFinder do
|
4
4
|
let(:image) { ImageHelpers.of_size(800, 600) }
|
5
|
-
let(:b) {Sqed::BoundaryFinder::CrossFinder.new(
|
5
|
+
let(:b) {Sqed::BoundaryFinder::CrossFinder.new(target_image: image)}
|
6
6
|
let(:c) {b.boundaries}
|
7
7
|
|
8
8
|
specify '#boundaries returns a Sqed::Boundaries instance' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Sqed::BoundaryFinder::StageFinder do
|
4
|
-
let(:b) {Sqed::BoundaryFinder::StageFinder.new(
|
4
|
+
let(:b) {Sqed::BoundaryFinder::StageFinder.new(target_image: ImageHelpers.cross_green )}
|
5
5
|
|
6
6
|
specify '#is border contains a proc' do
|
7
7
|
expect(b.is_border.class).to eq(Proc)
|
@@ -7,11 +7,11 @@ describe Sqed::BoundaryFinder do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
context 'when initiated with an image' do
|
10
|
-
let(:b) {Sqed::BoundaryFinder.new(
|
10
|
+
let(:b) {Sqed::BoundaryFinder.new(target_image: ImageHelpers.cross_green, target_layout: :vertical_offset_cross)}
|
11
11
|
|
12
12
|
context 'attributes' do
|
13
|
-
specify '#
|
14
|
-
expect(b).to respond_to(:
|
13
|
+
specify '#image' do
|
14
|
+
expect(b).to respond_to(:image)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -20,16 +20,16 @@ describe Sqed::BoundaryFinder do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
context '.color_boundary_finder(
|
23
|
+
context '.color_boundary_finder(target_image: image)' do
|
24
24
|
context 'with sample_subdivision_size: 10' do
|
25
25
|
specify 'finds the vertical dividing line in a standard cross, with border still present' do
|
26
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
26
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.cross_green, sample_subdivision_size: 10 )[1]
|
27
27
|
expect(center).to be > 492
|
28
28
|
expect(center).to be < 504
|
29
29
|
end
|
30
30
|
|
31
31
|
specify 'finds the vertical dividing line in a right t green cross, with border still present' do
|
32
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
32
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.right_t_green, sample_subdivision_size: 10)[1]
|
33
33
|
expect(center).to be > 695
|
34
34
|
expect(center).to be < 705
|
35
35
|
end
|
@@ -37,59 +37,59 @@ describe Sqed::BoundaryFinder do
|
|
37
37
|
|
38
38
|
context 'with sample_subdivision_size auto set' do
|
39
39
|
specify 'finds the vertical dividing line in a standard cross, with border still present, when more precise' do
|
40
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
40
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.cross_green, sample_cutoff_factor: 0.7)[1]
|
41
41
|
expect(center).to be > 492
|
42
42
|
expect(center).to be < 504
|
43
43
|
end
|
44
44
|
|
45
45
|
specify 'finds the vertical dividing line a real image, with border still present' do
|
46
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
46
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.crossy_green_line_specimen)[1]
|
47
47
|
expect(center).to be > 2452
|
48
48
|
expect(center).to be < 2495
|
49
49
|
end
|
50
50
|
|
51
51
|
specify 'finds the vertical dividing line a real image, with border still present, with 10x fewer subsamples' do
|
52
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
52
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.crossy_green_line_specimen, sample_subdivision_size: 100 )[1]
|
53
53
|
expect(center).to be > 2452
|
54
54
|
expect(center).to be < 2495
|
55
55
|
end
|
56
56
|
|
57
57
|
specify 'finds the vertical dividing line a real image, with border still present, with 50x fewer subsamples' do
|
58
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
58
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.crossy_green_line_specimen, sample_subdivision_size: 500 )[1]
|
59
59
|
expect(center).to be > 2452
|
60
60
|
expect(center).to be < 2495
|
61
61
|
end
|
62
62
|
|
63
63
|
specify 'FAILS to find the vertical dividing line a real image, with border still present, with 200x fewer subsamples' do
|
64
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
64
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.crossy_green_line_specimen, sample_subdivision_size: 2000 )
|
65
65
|
expect(center).to be nil
|
66
66
|
end
|
67
67
|
|
68
68
|
specify 'finds the vertical dividing line another real image, with border still present' do
|
69
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
69
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.greenline_image)[1]
|
70
70
|
expect(center).to be > 2445
|
71
71
|
expect(center).to be < 2495
|
72
72
|
end
|
73
73
|
|
74
74
|
specify 'finds the vertical dividing line another real image, with border still present, and 20x fewer subsamples' do
|
75
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
75
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.greenline_image, sample_subdivision_size: 200)[1]
|
76
76
|
expect(center).to be > 2445
|
77
77
|
expect(center).to be < 2495
|
78
78
|
end
|
79
79
|
|
80
80
|
specify 'finds the vertical dividing line another real image, with border still present, and 50x fewer subsamples' do
|
81
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
81
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.greenline_image, sample_subdivision_size: 500)[1]
|
82
82
|
expect(center).to be > 2445
|
83
83
|
expect(center).to be < 2495
|
84
84
|
end
|
85
85
|
|
86
86
|
specify 'FAILS to find the vertical dividing line in a standard cross, with border still present, when even more precise' do
|
87
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
87
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.cross_green, sample_cutoff_factor: 1)
|
88
88
|
expect(center).to be nil
|
89
89
|
end
|
90
90
|
|
91
91
|
specify 'finds the horizontal dividing line another real image, with border still present' do
|
92
|
-
center = Sqed::BoundaryFinder.color_boundary_finder(
|
92
|
+
center = Sqed::BoundaryFinder.color_boundary_finder(target_image: ImageHelpers.greenline_image, scan: :columns)[1]
|
93
93
|
expect(center).to be > 1282
|
94
94
|
expect(center).to be < 1332
|
95
95
|
end
|
@@ -116,7 +116,7 @@ describe Sqed::BoundaryFinder do
|
|
116
116
|
|
117
117
|
context 'offset boundaries from crossy_black_line_specimen image ' do
|
118
118
|
before(:all) {
|
119
|
-
@s = Sqed.new(
|
119
|
+
@s = Sqed.new(target_image: ImageHelpers.crossy_black_line_specimen, target_pattern: :vertical_offset_cross, boundary_color: :black)
|
120
120
|
@s.crop_image
|
121
121
|
@offset_boundaries = @s.boundaries.offset(@s.stage_boundary)
|
122
122
|
true
|
@@ -145,7 +145,7 @@ describe Sqed::BoundaryFinder do
|
|
145
145
|
|
146
146
|
context 'offset boundaries from black_green_line_specimen image ' do
|
147
147
|
before(:all) {
|
148
|
-
@s = Sqed.new(
|
148
|
+
@s = Sqed.new(target_image: ImageHelpers.black_stage_green_line_specimen, target_pattern: :vertical_offset_cross)
|
149
149
|
@s.crop_image
|
150
150
|
@offset_boundaries = @s.boundaries.offset(@s.stage_boundary)
|
151
151
|
true
|
@@ -173,7 +173,7 @@ describe Sqed::BoundaryFinder do
|
|
173
173
|
|
174
174
|
context 'offset boundaries from original red_line image ' do
|
175
175
|
before(:all) {
|
176
|
-
@s = Sqed.new(
|
176
|
+
@s = Sqed.new(target_image: ImageHelpers.vertical_offset_cross_red, target_pattern: :right_t, boundary_color: :red)
|
177
177
|
@s.crop_image
|
178
178
|
@offset_boundaries = @s.boundaries.offset(@s.stage_boundary)
|
179
179
|
}
|
@@ -9,15 +9,15 @@ describe Sqed::Extractor do
|
|
9
9
|
|
10
10
|
let(:boundaries) {
|
11
11
|
Sqed::BoundaryFinder::CrossFinder.new(
|
12
|
-
|
12
|
+
target_image: image
|
13
13
|
).boundaries
|
14
14
|
}
|
15
15
|
|
16
16
|
let(:e) {
|
17
17
|
Sqed::Extractor.new(
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
target_boundaries: boundaries,
|
19
|
+
target_image: image,
|
20
|
+
target_metadata_map: metadata_map
|
21
21
|
)
|
22
22
|
}
|
23
23
|
|
data/spec/lib/sqed_spec.rb
CHANGED
@@ -70,7 +70,7 @@ describe Sqed do
|
|
70
70
|
context 'all together, without border' do
|
71
71
|
let(:image) { ImageHelpers.frost_stage }
|
72
72
|
let(:pattern) { :vertical_offset_cross }
|
73
|
-
let(:s) { Sqed.new(
|
73
|
+
let(:s) { Sqed.new(target_image: image, target_pattern: pattern, has_border: false) }
|
74
74
|
|
75
75
|
specify '#boundaries returns a Sqed::Boundaries instance' do
|
76
76
|
expect(s.boundaries.class.name).to eq('Sqed::Boundaries')
|
@@ -115,7 +115,7 @@ describe Sqed do
|
|
115
115
|
context 'all together, with border' do
|
116
116
|
let(:image) { ImageHelpers.greenline_image }
|
117
117
|
let(:pattern) { :right_t }
|
118
|
-
let(:s) { Sqed.new(
|
118
|
+
let(:s) { Sqed.new(target_image: image, target_pattern: pattern, has_border: true) }
|
119
119
|
|
120
120
|
specify '#boundaries returns a Sqed::Boundaries instance' do
|
121
121
|
expect(s.boundaries.class.name).to eq('Sqed::Boundaries')
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe 'handling 7 slot stages' do
|
4
4
|
|
5
5
|
let(:image) { ImageHelpers.inhs_stage_7_slot }
|
6
|
-
let(:sqed) { Sqed.new(
|
6
|
+
let(:sqed) { Sqed.new(target_image: image, target_pattern: :seven_slot, boundary_color: :red, has_border: false ) }
|
7
7
|
|
8
8
|
context 'parses' do
|
9
9
|
specify 'new() without errors' do
|
data/sqed.gemspec
CHANGED
@@ -18,14 +18,16 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency 'rake'
|
21
|
+
spec.add_dependency 'rake', '~> 11.1.2'
|
22
22
|
spec.add_dependency 'rmagick', '~> 2.14'
|
23
23
|
spec.add_dependency 'rtesseract', '~> 1.2.6'
|
24
|
-
spec.add_dependency 'zxing_cpp', '~> 0.1.0'
|
25
24
|
|
26
|
-
|
25
|
+
# A qrcode reader, too many problems with compiling, dependencies
|
26
|
+
# spec.add_dependency 'zxing_cpp', '~> 0.1.0'
|
27
|
+
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
27
29
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
28
|
-
spec.add_development_dependency 'did_you_mean', '~> 0.9'
|
30
|
+
# spec.add_development_dependency 'did_you_mean', '~> 0.9'
|
29
31
|
spec.add_development_dependency 'byebug'
|
30
32
|
spec.add_development_dependency 'awesome_print', '~> 1.6'
|
31
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Yoder
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 11.1.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 11.1.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rmagick
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,34 +53,20 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.2.6
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: zxing_cpp
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.1.0
|
63
|
-
type: :runtime
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 0.1.0
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
57
|
name: rspec
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
73
59
|
requirements:
|
74
60
|
- - "~>"
|
75
61
|
- !ruby/object:Gem::Version
|
76
|
-
version: '3.
|
62
|
+
version: '3.4'
|
77
63
|
type: :development
|
78
64
|
prerelease: false
|
79
65
|
version_requirements: !ruby/object:Gem::Requirement
|
80
66
|
requirements:
|
81
67
|
- - "~>"
|
82
68
|
- !ruby/object:Gem::Version
|
83
|
-
version: '3.
|
69
|
+
version: '3.4'
|
84
70
|
- !ruby/object:Gem::Dependency
|
85
71
|
name: bundler
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,20 +81,6 @@ dependencies:
|
|
95
81
|
- - "~>"
|
96
82
|
- !ruby/object:Gem::Version
|
97
83
|
version: '1.5'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: did_you_mean
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
101
|
-
requirements:
|
102
|
-
- - "~>"
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version: '0.9'
|
105
|
-
type: :development
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
requirements:
|
109
|
-
- - "~>"
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '0.9'
|
112
84
|
- !ruby/object:Gem::Dependency
|
113
85
|
name: byebug
|
114
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +119,7 @@ extra_rdoc_files: []
|
|
147
119
|
files:
|
148
120
|
- ".gitignore"
|
149
121
|
- ".rspec"
|
122
|
+
- ".ruby-version"
|
150
123
|
- ".travis.yml"
|
151
124
|
- Gemfile
|
152
125
|
- LICENSE.txt
|
@@ -228,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
201
|
version: '0'
|
229
202
|
requirements: []
|
230
203
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.5.1
|
232
205
|
signing_key:
|
233
206
|
specification_version: 4
|
234
207
|
summary: Specimens Quickly Extracted and Digitized, or just "squid". A ruby gem for
|