mork 0.0.12 → 0.1.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 +2 -1
- data/LICENSE +22 -0
- data/README.md +104 -83
- data/lib/mork/grid.rb +23 -30
- data/lib/mork/grid_const.rb +4 -4
- data/lib/mork/mimage.rb +10 -0
- data/lib/mork/sheet_omr.rb +0 -3
- data/lib/mork/version.rb +1 -1
- data/mork.gemspec +4 -5
- data/spec/mork/grid_omr_spec.rb +1 -1
- data/spec/mork/grid_spec.rb +1 -1
- data/spec/mork/sheet_omr_spec.rb +2 -2
- data/spec/mork/sheet_pdf_spec.rb +1 -1
- data/spec/samples/grid160.yml +3 -3
- data/spec/samples/layout.yml +51 -0
- data/spec/samples/sheet.jpg +0 -0
- metadata +11 -51
- data/cucu.jpg +0 -0
- data/spec/samples/code_sample.pdf +0 -85
- data/spec/samples/code_sample.png +0 -0
- data/spec/samples/code_zero.pdf +0 -79
- data/spec/samples/content01.yml +0 -0
- data/spec/samples/grid01.yml +0 -57
- data/spec/samples/grid02.yml +0 -57
- data/spec/samples/grid_omr_01.yml +0 -28
- data/spec/samples/sample04.jpg +0 -0
- data/spec/samples/sample_color.pdf +0 -0
- data/spec/samples/sheet666.pdf +0 -12566
data/spec/mork/grid_omr_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module Mork
|
4
4
|
describe GridOMR do
|
5
|
-
let(:grom) { GridOMR.new 1601, 2281, 'spec/samples/
|
5
|
+
let(:grom) { GridOMR.new 1601, 2281, 'spec/samples/layout.yml' }
|
6
6
|
|
7
7
|
describe '#choice_cell_area' do
|
8
8
|
it 'returns the coordinates of the first choice cell' do
|
data/spec/mork/grid_spec.rb
CHANGED
data/spec/mork/sheet_omr_spec.rb
CHANGED
@@ -5,7 +5,7 @@ module Mork
|
|
5
5
|
context 'highlighting' do
|
6
6
|
# since these specs change the @crop, they must be run in isolation
|
7
7
|
# with the SheetOMR rebuilt each time, even though it is time consuming!
|
8
|
-
let(:sheet) { SheetOMR.new 'spec/samples/sample_gray.jpg', 'spec/samples/
|
8
|
+
let(:sheet) { SheetOMR.new 'spec/samples/sample_gray.jpg', 'spec/samples/layout.yml' }
|
9
9
|
|
10
10
|
it 'highlights the registration areas and frame' do
|
11
11
|
sheet.highlight_reg_area
|
@@ -56,7 +56,7 @@ module Mork
|
|
56
56
|
|
57
57
|
context 'marking a nicely printed and scanned sheet' do
|
58
58
|
before(:all) do
|
59
|
-
@sheet = SheetOMR.new('spec/samples/sample_gray.jpg', 'spec/samples/
|
59
|
+
@sheet = SheetOMR.new('spec/samples/sample_gray.jpg', 'spec/samples/layout.yml')
|
60
60
|
end
|
61
61
|
|
62
62
|
describe '#valid?' do
|
data/spec/mork/sheet_pdf_spec.rb
CHANGED
data/spec/samples/grid160.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
page_size:
|
2
2
|
width: 210
|
3
3
|
height: 297
|
4
|
-
|
4
|
+
reg_marks:
|
5
5
|
margin: 10
|
6
6
|
radius: 2.5
|
7
7
|
search: 12
|
@@ -33,8 +33,8 @@ items:
|
|
33
33
|
columns: 4
|
34
34
|
column_width: 44
|
35
35
|
rows: 40
|
36
|
-
|
37
|
-
|
36
|
+
left: 10.5
|
37
|
+
top: 40
|
38
38
|
x_spacing: 7.0
|
39
39
|
y_spacing: 5.5
|
40
40
|
cell_width: 6.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
page_size: # all measurements in mm
|
2
|
+
width: 210 # width of the paper sheet
|
3
|
+
height: 297 # height of the paper sheet
|
4
|
+
reg_marks:
|
5
|
+
margin: 10 # distance from each page border to registration mark center
|
6
|
+
radius: 2.5 # registration mark radius
|
7
|
+
search: 12 # initial size of the registration mark search area (*)
|
8
|
+
offset: 2 # distance between the search area and each page border (*)
|
9
|
+
header:
|
10
|
+
name: # ‘name’ is just a label; you can add arbitrary header elements
|
11
|
+
top: 5 # margin relative to registration frame top side
|
12
|
+
left: 7.5 # margin relative to registration frame left side
|
13
|
+
width: 170 # text will be fitted to this width
|
14
|
+
size: 14 # font size
|
15
|
+
title:
|
16
|
+
top: 15
|
17
|
+
left: 7.5
|
18
|
+
width: 180
|
19
|
+
size: 12
|
20
|
+
code:
|
21
|
+
top: 5
|
22
|
+
left: 165
|
23
|
+
width: 20
|
24
|
+
size: 14
|
25
|
+
signature:
|
26
|
+
top: 30
|
27
|
+
left: 7.5
|
28
|
+
width: 120
|
29
|
+
height: 15
|
30
|
+
size: 7
|
31
|
+
box: true # header element will be enclosed in a box
|
32
|
+
items:
|
33
|
+
top: 55.5 # response area margin, relative to reg frame
|
34
|
+
left: 10.5 # response area margin, relative to reg frame
|
35
|
+
rows: 30 # number of items per column
|
36
|
+
columns: 4 # number of columns
|
37
|
+
column_width: 44 #
|
38
|
+
x_spacing: 7 # horizontal distance between ajacent cell centers
|
39
|
+
y_spacing: 7 # vertical distance between ajacent cell centers
|
40
|
+
cell_width: 6 # width of each choice and calibration cell
|
41
|
+
cell_height: 5 # height of each choice and calibration cell
|
42
|
+
max_cells: 5 # maximum number of choices per item
|
43
|
+
font_size: 9 # size of both the item number and choice cell letter
|
44
|
+
number_width: 8 #
|
45
|
+
number_margin: 2 # margin between
|
46
|
+
barcode:
|
47
|
+
bits: 40 # the maximum sheet identifier is 2 to the power or bits
|
48
|
+
left: 15 # distance between registration frame side and the first barcode bit
|
49
|
+
width: 3 # width of each barcode bit
|
50
|
+
height: 2.5 # height of each barcode bit from the registration frame bottom side
|
51
|
+
spacing: 4 # horizontal distance between adjacent barcode bit centers
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giuseppe Bertini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: narray
|
@@ -136,7 +136,8 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '1.2'
|
139
|
-
description:
|
139
|
+
description: Producing response sheets as PDF files and automatically scoring manually
|
140
|
+
filled-out sheets
|
140
141
|
email:
|
141
142
|
- giuseppe.bertini@gmail.com
|
142
143
|
executables: []
|
@@ -144,14 +145,11 @@ extensions: []
|
|
144
145
|
extra_rdoc_files: []
|
145
146
|
files:
|
146
147
|
- ".gitignore"
|
147
|
-
- ".rspec"
|
148
|
-
- ".ruby-gemset"
|
149
|
-
- ".ruby-version"
|
150
148
|
- Gemfile
|
151
149
|
- Guardfile
|
150
|
+
- LICENSE
|
152
151
|
- README.md
|
153
152
|
- Rakefile
|
154
|
-
- cucu.jpg
|
155
153
|
- lib/mork.rb
|
156
154
|
- lib/mork/extensions.rb
|
157
155
|
- lib/mork/grid.rb
|
@@ -174,28 +172,20 @@ files:
|
|
174
172
|
- spec/mork/sheet_omr_spec.rb
|
175
173
|
- spec/mork/sheet_pdf_spec.rb
|
176
174
|
- spec/out/.gitignore
|
177
|
-
- spec/samples/code_sample.pdf
|
178
|
-
- spec/samples/code_sample.png
|
179
|
-
- spec/samples/code_zero.pdf
|
180
|
-
- spec/samples/content01.yml
|
181
|
-
- spec/samples/grid01.yml
|
182
|
-
- spec/samples/grid02.yml
|
183
175
|
- spec/samples/grid160.yml
|
184
|
-
- spec/samples/grid_omr_01.yml
|
185
176
|
- spec/samples/info.yml
|
177
|
+
- spec/samples/layout.yml
|
186
178
|
- spec/samples/qzc013.jpg
|
187
179
|
- spec/samples/reg_mark.jpg
|
188
180
|
- spec/samples/sample01.jpg
|
189
181
|
- spec/samples/sample02.jpg
|
190
182
|
- spec/samples/sample03.jpg
|
191
|
-
- spec/samples/sample04.jpg
|
192
|
-
- spec/samples/sample_color.pdf
|
193
183
|
- spec/samples/sample_gray.jpg
|
184
|
+
- spec/samples/sheet.jpg
|
194
185
|
- spec/samples/sheet666.jpg
|
195
|
-
- spec/samples/sheet666.pdf
|
196
186
|
- spec/samples/two_pages.pdf
|
197
187
|
- spec/spec_helper.rb
|
198
|
-
homepage:
|
188
|
+
homepage: https://github.com/giuseb/mork
|
199
189
|
licenses:
|
200
190
|
- MIT
|
201
191
|
metadata: {}
|
@@ -214,40 +204,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
204
|
- !ruby/object:Gem::Version
|
215
205
|
version: '0'
|
216
206
|
requirements: []
|
217
|
-
rubyforge_project:
|
207
|
+
rubyforge_project:
|
218
208
|
rubygems_version: 2.1.11
|
219
209
|
signing_key:
|
220
210
|
specification_version: 4
|
221
|
-
summary: Optical mark recognition of multiple-choice
|
222
|
-
test_files:
|
223
|
-
- spec/mork/extensions_spec.rb
|
224
|
-
- spec/mork/grid_omr_spec.rb
|
225
|
-
- spec/mork/grid_spec.rb
|
226
|
-
- spec/mork/mimage_list_spec.rb
|
227
|
-
- spec/mork/mimage_spec.rb
|
228
|
-
- spec/mork/npatch_spec.rb
|
229
|
-
- spec/mork/sheet_omr_spec.rb
|
230
|
-
- spec/mork/sheet_pdf_spec.rb
|
231
|
-
- spec/out/.gitignore
|
232
|
-
- spec/samples/code_sample.pdf
|
233
|
-
- spec/samples/code_sample.png
|
234
|
-
- spec/samples/code_zero.pdf
|
235
|
-
- spec/samples/content01.yml
|
236
|
-
- spec/samples/grid01.yml
|
237
|
-
- spec/samples/grid02.yml
|
238
|
-
- spec/samples/grid160.yml
|
239
|
-
- spec/samples/grid_omr_01.yml
|
240
|
-
- spec/samples/info.yml
|
241
|
-
- spec/samples/qzc013.jpg
|
242
|
-
- spec/samples/reg_mark.jpg
|
243
|
-
- spec/samples/sample01.jpg
|
244
|
-
- spec/samples/sample02.jpg
|
245
|
-
- spec/samples/sample03.jpg
|
246
|
-
- spec/samples/sample04.jpg
|
247
|
-
- spec/samples/sample_color.pdf
|
248
|
-
- spec/samples/sample_gray.jpg
|
249
|
-
- spec/samples/sheet666.jpg
|
250
|
-
- spec/samples/sheet666.pdf
|
251
|
-
- spec/samples/two_pages.pdf
|
252
|
-
- spec/spec_helper.rb
|
211
|
+
summary: Optical mark recognition of multiple-choice tests and surveys
|
212
|
+
test_files: []
|
253
213
|
has_rdoc:
|
data/cucu.jpg
DELETED
Binary file
|
@@ -1,85 +0,0 @@
|
|
1
|
-
%PDF-1.3
|
2
|
-
%����
|
3
|
-
1 0 obj
|
4
|
-
<< /Creator <feff0050007200610077006e>
|
5
|
-
/Producer <feff0050007200610077006e>
|
6
|
-
>>
|
7
|
-
endobj
|
8
|
-
2 0 obj
|
9
|
-
<< /Type /Catalog
|
10
|
-
/Pages 3 0 R
|
11
|
-
>>
|
12
|
-
endobj
|
13
|
-
3 0 obj
|
14
|
-
<< /Type /Pages
|
15
|
-
/Count 1
|
16
|
-
/Kids [5 0 R]
|
17
|
-
>>
|
18
|
-
endobj
|
19
|
-
4 0 obj
|
20
|
-
<< /Length 1109
|
21
|
-
>>
|
22
|
-
stream
|
23
|
-
q
|
24
|
-
28.346 21.260 m
|
25
|
-
28.346 25.174 25.174 28.346 21.260 28.346 c
|
26
|
-
17.346 28.346 14.173 25.174 14.173 21.260 c
|
27
|
-
14.173 17.346 17.346 14.173 21.260 14.173 c
|
28
|
-
25.174 14.173 28.346 17.346 28.346 21.260 c
|
29
|
-
21.260 21.260 m
|
30
|
-
28.346 820.630 m
|
31
|
-
28.346 824.544 25.174 827.717 21.260 827.717 c
|
32
|
-
17.346 827.717 14.173 824.544 14.173 820.630 c
|
33
|
-
14.173 816.716 17.346 813.543 21.260 813.543 c
|
34
|
-
25.174 813.543 28.346 816.716 28.346 820.630 c
|
35
|
-
21.260 820.630 m
|
36
|
-
581.102 820.630 m
|
37
|
-
581.102 824.544 577.930 827.717 574.016 827.717 c
|
38
|
-
570.102 827.717 566.929 824.544 566.929 820.630 c
|
39
|
-
566.929 816.716 570.102 813.543 574.016 813.543 c
|
40
|
-
577.930 813.543 581.102 816.716 581.102 820.630 c
|
41
|
-
574.016 820.630 m
|
42
|
-
581.102 21.260 m
|
43
|
-
581.102 25.174 577.930 28.346 574.016 28.346 c
|
44
|
-
570.102 28.346 566.929 25.174 566.929 21.260 c
|
45
|
-
566.929 17.346 570.102 14.173 574.016 14.173 c
|
46
|
-
577.930 14.173 581.102 17.346 581.102 21.260 c
|
47
|
-
574.016 21.260 m
|
48
|
-
f
|
49
|
-
42.520 14.173 5.669 14.173 re
|
50
|
-
49.606 14.173 5.669 14.173 re
|
51
|
-
77.953 14.173 5.669 14.173 re
|
52
|
-
92.126 14.173 5.669 14.173 re
|
53
|
-
120.472 14.173 5.669 14.173 re
|
54
|
-
127.559 14.173 5.669 14.173 re
|
55
|
-
134.646 14.173 5.669 14.173 re
|
56
|
-
f
|
57
|
-
Q
|
58
|
-
|
59
|
-
endstream
|
60
|
-
endobj
|
61
|
-
5 0 obj
|
62
|
-
<< /Type /Page
|
63
|
-
/Parent 3 0 R
|
64
|
-
/MediaBox [0 0 595.2755905511815 841.889763779528]
|
65
|
-
/Contents 4 0 R
|
66
|
-
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
67
|
-
>>
|
68
|
-
>>
|
69
|
-
endobj
|
70
|
-
xref
|
71
|
-
0 6
|
72
|
-
0000000000 65535 f
|
73
|
-
0000000015 00000 n
|
74
|
-
0000000109 00000 n
|
75
|
-
0000000158 00000 n
|
76
|
-
0000000215 00000 n
|
77
|
-
0000001376 00000 n
|
78
|
-
trailer
|
79
|
-
<< /Size 6
|
80
|
-
/Root 2 0 R
|
81
|
-
/Info 1 0 R
|
82
|
-
>>
|
83
|
-
startxref
|
84
|
-
1553
|
85
|
-
%%EOF
|
Binary file
|
data/spec/samples/code_zero.pdf
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
%PDF-1.3
|
2
|
-
%����
|
3
|
-
1 0 obj
|
4
|
-
<< /Creator <feff0050007200610077006e>
|
5
|
-
/Producer <feff0050007200610077006e>
|
6
|
-
>>
|
7
|
-
endobj
|
8
|
-
2 0 obj
|
9
|
-
<< /Type /Catalog
|
10
|
-
/Pages 3 0 R
|
11
|
-
>>
|
12
|
-
endobj
|
13
|
-
3 0 obj
|
14
|
-
<< /Type /Pages
|
15
|
-
/Count 1
|
16
|
-
/Kids [5 0 R]
|
17
|
-
>>
|
18
|
-
endobj
|
19
|
-
4 0 obj
|
20
|
-
<< /Length 926
|
21
|
-
>>
|
22
|
-
stream
|
23
|
-
q
|
24
|
-
28.346 21.260 m
|
25
|
-
28.346 25.174 25.174 28.346 21.260 28.346 c
|
26
|
-
17.346 28.346 14.173 25.174 14.173 21.260 c
|
27
|
-
14.173 17.346 17.346 14.173 21.260 14.173 c
|
28
|
-
25.174 14.173 28.346 17.346 28.346 21.260 c
|
29
|
-
21.260 21.260 m
|
30
|
-
28.346 820.630 m
|
31
|
-
28.346 824.544 25.174 827.717 21.260 827.717 c
|
32
|
-
17.346 827.717 14.173 824.544 14.173 820.630 c
|
33
|
-
14.173 816.716 17.346 813.543 21.260 813.543 c
|
34
|
-
25.174 813.543 28.346 816.716 28.346 820.630 c
|
35
|
-
21.260 820.630 m
|
36
|
-
581.102 820.630 m
|
37
|
-
581.102 824.544 577.930 827.717 574.016 827.717 c
|
38
|
-
570.102 827.717 566.929 824.544 566.929 820.630 c
|
39
|
-
566.929 816.716 570.102 813.543 574.016 813.543 c
|
40
|
-
577.930 813.543 581.102 816.716 581.102 820.630 c
|
41
|
-
574.016 820.630 m
|
42
|
-
581.102 21.260 m
|
43
|
-
581.102 25.174 577.930 28.346 574.016 28.346 c
|
44
|
-
570.102 28.346 566.929 25.174 566.929 21.260 c
|
45
|
-
566.929 17.346 570.102 14.173 574.016 14.173 c
|
46
|
-
577.930 14.173 581.102 17.346 581.102 21.260 c
|
47
|
-
574.016 21.260 m
|
48
|
-
f
|
49
|
-
42.520 14.173 5.669 14.173 re
|
50
|
-
f
|
51
|
-
Q
|
52
|
-
|
53
|
-
endstream
|
54
|
-
endobj
|
55
|
-
5 0 obj
|
56
|
-
<< /Type /Page
|
57
|
-
/Parent 3 0 R
|
58
|
-
/MediaBox [0 0 595.2755905511815 841.889763779528]
|
59
|
-
/Contents 4 0 R
|
60
|
-
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
61
|
-
>>
|
62
|
-
>>
|
63
|
-
endobj
|
64
|
-
xref
|
65
|
-
0 6
|
66
|
-
0000000000 65535 f
|
67
|
-
0000000015 00000 n
|
68
|
-
0000000109 00000 n
|
69
|
-
0000000158 00000 n
|
70
|
-
0000000215 00000 n
|
71
|
-
0000001192 00000 n
|
72
|
-
trailer
|
73
|
-
<< /Size 6
|
74
|
-
/Root 2 0 R
|
75
|
-
/Info 1 0 R
|
76
|
-
>>
|
77
|
-
startxref
|
78
|
-
1369
|
79
|
-
%%EOF
|
data/spec/samples/content01.yml
DELETED
File without changes
|
data/spec/samples/grid01.yml
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
page_size:
|
2
|
-
width: 210
|
3
|
-
height: 297
|
4
|
-
regmarks:
|
5
|
-
margin: 10
|
6
|
-
radius: 2.5
|
7
|
-
search: 12
|
8
|
-
offset: 2
|
9
|
-
header:
|
10
|
-
name:
|
11
|
-
top: 5
|
12
|
-
left: 7.5
|
13
|
-
width: 170
|
14
|
-
size: 14
|
15
|
-
title:
|
16
|
-
top: 15
|
17
|
-
left: 7.5
|
18
|
-
width: 180
|
19
|
-
size: 12
|
20
|
-
code:
|
21
|
-
top: 5
|
22
|
-
left: 165
|
23
|
-
width: 20
|
24
|
-
size: 14
|
25
|
-
signature:
|
26
|
-
top: 30
|
27
|
-
left: 7.5
|
28
|
-
width: 120
|
29
|
-
height: 15
|
30
|
-
size: 7
|
31
|
-
box: true
|
32
|
-
items:
|
33
|
-
columns: 4
|
34
|
-
column_width: 44
|
35
|
-
rows: 30
|
36
|
-
first_x: 10.5
|
37
|
-
first_y: 55.5
|
38
|
-
x_spacing: 7.0
|
39
|
-
y_spacing: 7.0
|
40
|
-
cell_width: 6.0
|
41
|
-
cell_height: 5.0
|
42
|
-
max_cells: 5
|
43
|
-
font_size: 9
|
44
|
-
number_width: 8
|
45
|
-
number_margin: 2
|
46
|
-
barcode:
|
47
|
-
bits: 40
|
48
|
-
left: 15
|
49
|
-
width: 3.0
|
50
|
-
height: 2.5
|
51
|
-
spacing: 4
|
52
|
-
control:
|
53
|
-
top: 40
|
54
|
-
left: 123
|
55
|
-
width: 50
|
56
|
-
size: 9
|
57
|
-
margin: 2.5
|