sqed 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/LICENSE.txt +13 -18
- data/lib/sqed.rb +2 -3
- data/lib/sqed/boundary_finder.rb +3 -5
- data/lib/sqed/boundary_finder/color_line_finder.rb +1 -1
- data/lib/sqed/boundary_finder/cross_finder.rb +1 -1
- data/lib/sqed/boundary_finder/stage_finder.rb +1 -1
- data/lib/sqed/extractor.rb +2 -2
- data/lib/sqed/parser/ocr_parser.rb +0 -1
- data/lib/sqed/result.rb +1 -1
- data/lib/sqed/version.rb +1 -1
- data/spec/lib/sqed_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/sqed.gemspec +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f028e306ff2c2f95b9caaf8b1cfbc29416fce995
|
4
|
+
data.tar.gz: 4e560b1fb92746dbfb61ee62183555eea10cfdab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9c86658dcfecb19ac3529107637c51f313c9107fb38b801d1840932a7688eaf873e1b66674df99a7bec56ffcc662c2965b255e47d6eabd1f842fbd9efb746dd
|
7
|
+
data.tar.gz: af43d2974fa17ab3ce6d5c0b1fd32af0ab87f417f3faffbc393b11b06b991dc29c72508dde58f81e701fbc840d02512d9a3c09dd2a94a5f1c50f4019fcdc1d09
|
data/.travis.yml
CHANGED
@@ -8,6 +8,9 @@ rvm:
|
|
8
8
|
# - sudo apt-get update
|
9
9
|
# - sudo apt-get -y --reinstall install imagemagick
|
10
10
|
# - printf "\n" | pecl install imagick-beta
|
11
|
+
before_install:
|
12
|
+
- sudo apt-get update -qq
|
13
|
+
- sudo apt-get install -qq tesseract-ocr tesseract-ocr-nld
|
11
14
|
branches:
|
12
15
|
only:
|
13
16
|
- master
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,17 @@
|
|
1
|
-
|
1
|
+
The University of Illinois/NCSA Open Source License (NCSA)
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2014-onwwards Species File Group
|
4
|
+
All rights reserved.
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
6
|
+
Developed by: Species File Group
|
7
|
+
Illinois Natural History Survey
|
8
|
+
http://speciesfile.org
|
12
9
|
|
13
|
-
|
14
|
-
included in all copies or substantial portions of the Software.
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
15
11
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
12
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
|
13
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
|
14
|
+
|
15
|
+
Neither the names of Species File Group, Illinois Natural History Survey, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|
data/lib/sqed.rb
CHANGED
@@ -3,8 +3,7 @@
|
|
3
3
|
recent_ruby = RUBY_VERSION >= '2.1.1'
|
4
4
|
raise "IMPORTANT: sqed gem requires ruby >= 2.1.1" unless recent_ruby
|
5
5
|
|
6
|
-
require "
|
7
|
-
include Magick
|
6
|
+
require "rmagick"
|
8
7
|
|
9
8
|
# Instants take the following
|
10
9
|
# 1) A base image @image
|
@@ -12,7 +11,7 @@ include Magick
|
|
12
11
|
#
|
13
12
|
# Return a Sqed::Result
|
14
13
|
#
|
15
|
-
# a = Sqed.new(pattern: :
|
14
|
+
# a = Sqed.new(pattern: :offset_cross, image: image)
|
16
15
|
# b = a.result # => Sqed::Result instance
|
17
16
|
#
|
18
17
|
class Sqed
|
data/lib/sqed/boundary_finder.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'RMagick'
|
2
|
-
|
3
1
|
# Sqed Boundary Finders find boundaries on images and return co-ordinates of those boundaries. They do not
|
4
2
|
# return derivative images. Finders operate on cropped images, i.e. only the "stage".
|
5
3
|
#
|
@@ -15,7 +13,7 @@ class Sqed::BoundaryFinder
|
|
15
13
|
|
16
14
|
def initialize(image: image, layout: layout)
|
17
15
|
raise 'No layout provided.' if layout.nil?
|
18
|
-
raise 'No image provided.' if image.nil? || image.class != Magick::Image
|
16
|
+
raise 'No image provided.' if image.nil? || image.class.name != 'Magick::Image'
|
19
17
|
|
20
18
|
@layout = layout
|
21
19
|
@img = image
|
@@ -52,9 +50,9 @@ class Sqed::BoundaryFinder
|
|
52
50
|
(0..samples_to_take).each do |s|
|
53
51
|
# Create a sample image a single pixel tall
|
54
52
|
if scan == :rows
|
55
|
-
j = image.crop(0, s * sample_subdivision_size, image.columns, 1
|
53
|
+
j = image.crop(0, s * sample_subdivision_size, image.columns, 1)
|
56
54
|
elsif scan == :columns
|
57
|
-
j = image.crop(s * sample_subdivision_size, 0, 1, image.rows
|
55
|
+
j = image.crop(s * sample_subdivision_size, 0, 1, image.rows)
|
58
56
|
else
|
59
57
|
raise
|
60
58
|
end
|
data/lib/sqed/extractor.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rmagick'
|
2
2
|
|
3
3
|
# An Extractor takes Boundries object and a metadata_map pattern and returns a Sqed::Result
|
4
4
|
#
|
@@ -17,7 +17,7 @@ class Sqed::Extractor
|
|
17
17
|
def initialize(boundaries: boundaries, metadata_map: metadata_map, image: image)
|
18
18
|
raise 'boundaries not provided or provided boundary is not a Sqed::Boundaries' if boundaries.nil? || !boundaries.class == Sqed::Boundaries
|
19
19
|
raise 'metadata_map not provided or metadata_map not a Hash' if metadata_map.nil? || !metadata_map.class == Hash
|
20
|
-
raise 'image not provided' if image.nil? || !image.class == Magick::Image
|
20
|
+
raise 'image not provided' if image.nil? || !image.class.name == 'Magick::Image'
|
21
21
|
|
22
22
|
@metadata_map = metadata_map
|
23
23
|
@boundaries = boundaries
|
@@ -18,7 +18,6 @@ class Sqed::Parser::OcrParser < Sqed::Parser
|
|
18
18
|
img = @image #.white_threshold(245)
|
19
19
|
|
20
20
|
# @jrflood: this is where you will have to do some research, tuning images so that they can be better ocr-ed,
|
21
|
-
# all of these methods are from RMagick.
|
22
21
|
# get potential border pixel color (based on quadrant?)
|
23
22
|
new_color = img.pixel_color(1, 1)
|
24
23
|
# img = img.scale(2)
|
data/lib/sqed/result.rb
CHANGED
data/lib/sqed/version.rb
CHANGED
data/spec/lib/sqed_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/sqed.gemspec
CHANGED
@@ -23,10 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'rtesseract', '~> 1.2.6'
|
24
24
|
spec.add_dependency 'zxing_cpp', '~> 0.1.0'
|
25
25
|
|
26
|
+
spec.add_development_dependency 'rspec'
|
26
27
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
27
28
|
spec.add_development_dependency 'did_you_mean', '~> 0.9'
|
28
29
|
spec.add_development_dependency 'byebug'
|
29
|
-
spec.add_development_dependency 'rspec'
|
30
30
|
spec.add_development_dependency 'awesome_print', '~> 1.6'
|
31
31
|
end
|
32
32
|
|
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Yoder
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -68,49 +68,49 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 0.1.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
85
|
+
name: bundler
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
90
|
+
version: '1.5'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
97
|
+
version: '1.5'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: did_you_mean
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '0'
|
104
|
+
version: '0.9'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
111
|
+
version: '0.9'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
113
|
+
name: byebug
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - ">="
|