ruby_marks 0.3.2 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -328,14 +328,15 @@ module RubyMarks
328
328
  block_height = RubyMarks::ImageUtils.calc_height(block[:y1], block[:y2])
329
329
  lines = @config.default_expected_lines
330
330
  columns = @config.default_marks_options.size
331
- distance_lin = block_height / lines
332
- distance_col = block_width / columns
331
+ distance_lin = @config.default_mark_height
332
+ distance_col = @config.default_mark_width
333
333
  lines.times do |lin|
334
334
  columns.times do |col|
335
- blocks << { :x1 => block[:x1] + (col * distance_col) + @config.edge_level,
336
- :y1 => block[:y1] + (lin * distance_lin) + @config.edge_level,
337
- :x2 => (block[:x1] + (col * distance_col) + distance_col) - @config.edge_level,
338
- :y2 => block[:y1] + (lin * distance_lin) + distance_col - @config.edge_level,
335
+
336
+ blocks << { :x1 => @config.edge_level + block[:x1] + (col * distance_col) + ((col % 2 == 1) ? 0 : 1),
337
+ :y1 => @config.edge_level + block[:y1] + (lin * distance_lin) + ((lin % 2 == 1) ? 0 : 1),
338
+ :x2 => @config.edge_level + block[:x1] + (col * distance_col) + distance_col + ((col % 2 == 1) ? 0 : 1),
339
+ :y2 => @config.edge_level + block[:y1] + (lin * distance_lin) + distance_lin + ((lin % 2 == 1) ? 0 : 1),
339
340
  :line => lin + 1 }
340
341
  end
341
342
  end
@@ -1,3 +1,3 @@
1
1
  module RubyMarks
2
- VERSION = "0.3.2".freeze
2
+ VERSION = "0.3.4".freeze
3
3
  end
@@ -13,7 +13,9 @@ class RubyMarks::RecognizerGridTest < Test::Unit::TestCase
13
13
 
14
14
  config.scan_mode = :grid
15
15
  config.default_expected_lines = 5
16
- config.intensity_percentual = 75
16
+ config.intensity_percentual = 50
17
+ config.default_mark_height = 25
18
+ config.default_mark_width = 25
17
19
  config.auto_ajust_block_width = :right
18
20
  config.default_block_width_tolerance = 10
19
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_marks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -17,17 +17,17 @@ dependencies:
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
- - - ! '>='
20
+ - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: '0'
22
+ version: 2.13.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ! '>='
28
+ - - '='
29
29
  - !ruby/object:Gem::Version
30
- version: '0'
30
+ version: 2.13.1
31
31
  description: A simple OMR tool
32
32
  email:
33
33
  - andrerpbts@gmail.com