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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4600b58a8dca4c59c21e0fcaa08c63e7564a56f4
4
- data.tar.gz: f1f96f8e93e988bd53ca354c4fe3a67f359b1368
3
+ metadata.gz: f028e306ff2c2f95b9caaf8b1cfbc29416fce995
4
+ data.tar.gz: 4e560b1fb92746dbfb61ee62183555eea10cfdab
5
5
  SHA512:
6
- metadata.gz: d7cb582b1d6db468617a132ce67a0dccab2315911eb650468ef6d0e756333cfcca710969d9d845dbe8c3149059499c486845072a053f5674412af268928e2f72
7
- data.tar.gz: 9a24446ca6fb5caf9d7a9c436013e31cc6ceeb09e4c06f1968ee4cb5a2d544bd939d7b59e3bda023b2cfea38c4eb0cb1182e0971290738c44c8135a33d046b08
6
+ metadata.gz: a9c86658dcfecb19ac3529107637c51f313c9107fb38b801d1840932a7688eaf873e1b66674df99a7bec56ffcc662c2965b255e47d6eabd1f842fbd9efb746dd
7
+ data.tar.gz: af43d2974fa17ab3ce6d5c0b1fd32af0ab87f417f3faffbc393b11b06b991dc29c72508dde58f81e701fbc840d02512d9a3c09dd2a94a5f1c50f4019fcdc1d09
@@ -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
@@ -1,22 +1,17 @@
1
- Copyright (c) 2014 Matt Yoder
1
+ The University of Illinois/NCSA Open Source License (NCSA)
2
2
 
3
- MIT License
3
+ Copyright (c) 2014-onwwards Species File Group
4
+ All rights reserved.
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
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
- The above copyright notice and this permission notice shall be
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
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
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.
@@ -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 "RMagick"
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: :right_t, image: image)
14
+ # a = Sqed.new(pattern: :offset_cross, image: image)
16
15
  # b = a.result # => Sqed::Result instance
17
16
  #
18
17
  class Sqed
@@ -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, true)
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, true)
55
+ j = image.crop(s * sample_subdivision_size, 0, 1, image.rows)
58
56
  else
59
57
  raise
60
58
  end
@@ -1,4 +1,4 @@
1
- require 'RMagick'
1
+ require 'rmagick'
2
2
 
3
3
  # This was "green" line finder attempting to be agnostic; now it is reworked to be color-specific line finder
4
4
  #
@@ -1,4 +1,4 @@
1
- require 'RMagick'
1
+ require 'rmagick'
2
2
 
3
3
  # Return four equal quadrants, no parsing through the image
4
4
  #
@@ -1,4 +1,4 @@
1
- require 'RMagick'
1
+ require 'rmagick'
2
2
 
3
3
  # Some of this code was originally inspired by Emmanuel Oga's gist https://gist.github.com/EmmanuelOga/2476153.
4
4
  #
@@ -1,4 +1,4 @@
1
- require 'RMagick'
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)
@@ -39,7 +39,7 @@ class Sqed::Result
39
39
  end
40
40
 
41
41
  # return [Hash]
42
- # a map of layout_section_type => Image
42
+ # a map of layout_section_type => Rmagick::Image
43
43
  def images
44
44
  result = {}
45
45
  SqedConfig::LAYOUT_SECTION_TYPES.each do |k|
@@ -1,3 +1,3 @@
1
1
  class Sqed
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
- require 'RMagick'
2
+
3
3
  describe Sqed do
4
4
 
5
5
  let(:s) {Sqed.new}
@@ -7,7 +7,7 @@ require 'support/image_helpers'
7
7
  require 'byebug'
8
8
  require 'awesome_print'
9
9
  require 'fileutils'
10
- require 'RMagick'
10
+ require 'rmagick'
11
11
 
12
12
  FileUtils::mkdir_p 'tmp'
13
13
 
@@ -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.0
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-08 00:00:00.000000000 Z
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: bundler
71
+ name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: '1.5'
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: '1.5'
83
+ version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
- name: did_you_mean
85
+ name: bundler
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0.9'
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: '0.9'
97
+ version: '1.5'
98
98
  - !ruby/object:Gem::Dependency
99
- name: byebug
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: rspec
113
+ name: byebug
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="