mork 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/lib/mork/coord.rb +58 -0
  4. data/lib/mork/grid.rb +44 -35
  5. data/lib/mork/grid_const.rb +11 -6
  6. data/lib/mork/grid_omr.rb +76 -62
  7. data/lib/mork/magicko.rb +162 -0
  8. data/lib/mork/mimage.rb +102 -177
  9. data/lib/mork/npatch.rb +38 -56
  10. data/lib/mork/sheet_omr.rb +45 -43
  11. data/lib/mork/sheet_pdf.rb +16 -16
  12. data/lib/mork/version.rb +1 -1
  13. data/mork.gemspec +2 -2
  14. data/mork.sublime-project +9 -0
  15. data/spec/mork/coord_spec.rb +55 -0
  16. data/spec/mork/grid_omr_spec.rb +62 -85
  17. data/spec/mork/grid_spec.rb +7 -7
  18. data/spec/mork/magicko_spec.rb +46 -0
  19. data/spec/mork/mimage_spec.rb +30 -20
  20. data/spec/mork/npatch_spec.rb +46 -39
  21. data/spec/mork/sheet_omr_spec.rb +82 -40
  22. data/spec/mork/sheet_pdf_spec.rb +8 -8
  23. data/spec/samples/angolo.jpg +0 -0
  24. data/spec/samples/grid.yml +53 -0
  25. data/spec/samples/info.yml +12 -11
  26. data/spec/samples/layout.yml +9 -5
  27. data/spec/samples/lucrezia/border1.pdf +0 -0
  28. data/spec/samples/lucrezia/border2.pdf +0 -0
  29. data/spec/samples/lucrezia/bw1.pdf +0 -0
  30. data/spec/samples/lucrezia/bw2.pdf +0 -0
  31. data/spec/samples/lucrezia/gray1.pdf +0 -0
  32. data/spec/samples/lucrezia/gray2.pdf +0 -0
  33. data/spec/samples/out-1.jpg +0 -0
  34. data/spec/samples/rm00.jpeg +0 -0
  35. data/spec/samples/slanted.jpg +0 -0
  36. data/spec/samples/slanted.yml +54 -0
  37. data/spec/samples/syst/IMG_20150104_0004.jpg +0 -0
  38. data/spec/samples/syst/IMG_20150104_0004.txt +4955 -0
  39. data/spec/samples/syst/IMG_20150104_0009.jpg +0 -0
  40. data/spec/samples/syst/IMG_20150104_0009.txt +4955 -0
  41. data/spec/samples/syst/IMG_20150104_0011.jpg +0 -0
  42. data/spec/samples/syst/IMG_20150104_0011.txt +4955 -0
  43. data/spec/samples/syst/SCN_0001.jpg +0 -0
  44. data/spec/samples/syst/SCN_0001.txt +4955 -0
  45. data/spec/samples/syst/barr0.jpg +0 -0
  46. data/spec/samples/syst/barr0.txt +4955 -0
  47. data/spec/samples/syst/barr1.jpg +0 -0
  48. data/spec/samples/syst/barr1.txt +4955 -0
  49. data/spec/samples/syst/barr2.jpg +0 -0
  50. data/spec/samples/syst/barr2.txt +4955 -0
  51. data/spec/samples/syst/bell0.jpg +0 -0
  52. data/spec/samples/syst/bell0.txt +4955 -0
  53. data/spec/samples/syst/bell1.jpg +0 -0
  54. data/spec/samples/syst/bell1.txt +4955 -0
  55. data/spec/samples/syst/bell2.jpg +0 -0
  56. data/spec/samples/syst/bell2.txt +4955 -0
  57. data/spec/samples/syst/bila0.jpg +0 -0
  58. data/spec/samples/syst/bila0.txt +4955 -0
  59. data/spec/samples/syst/bila1.jpg +0 -0
  60. data/spec/samples/syst/bila1.txt +4955 -0
  61. data/spec/samples/syst/bila2.jpg +0 -0
  62. data/spec/samples/syst/bila2.txt +4955 -0
  63. data/spec/samples/syst/bila3.jpg +0 -0
  64. data/spec/samples/syst/bila3.txt +4955 -0
  65. data/spec/samples/syst/bila4.jpg +0 -0
  66. data/spec/samples/syst/bila4.txt +4955 -0
  67. data/spec/samples/syst/bone0.jpg +0 -0
  68. data/spec/samples/syst/bone0.txt +4955 -0
  69. data/spec/samples/syst/bone1.jpg +0 -0
  70. data/spec/samples/syst/bone1.txt +4955 -0
  71. data/spec/samples/syst/bone2.jpg +0 -0
  72. data/spec/samples/syst/bone2.txt +4955 -0
  73. data/spec/samples/syst/cost0.jpg +0 -0
  74. data/spec/samples/syst/cost0.txt +4955 -0
  75. data/spec/samples/syst/cost1.jpg +0 -0
  76. data/spec/samples/syst/cost1.txt +4955 -0
  77. data/spec/samples/syst/cost2.jpg +0 -0
  78. data/spec/samples/syst/cost2.txt +4955 -0
  79. data/spec/samples/syst/cost3.jpg +0 -0
  80. data/spec/samples/syst/cost3.txt +4955 -0
  81. data/spec/samples/syst/cost4.jpg +0 -0
  82. data/spec/samples/syst/cost4.txt +4955 -0
  83. data/spec/samples/syst/dald0.jpg +0 -0
  84. data/spec/samples/syst/dald0.txt +4955 -0
  85. data/spec/samples/syst/dald1.jpg +0 -0
  86. data/spec/samples/syst/dald1.txt +4955 -0
  87. data/spec/samples/syst/dald2.jpg +0 -0
  88. data/spec/samples/syst/dald2.txt +4955 -0
  89. data/spec/samples/syst/dald3.jpg +0 -0
  90. data/spec/samples/syst/dald3.txt +4955 -0
  91. data/spec/samples/syst/dald4.jpg +0 -0
  92. data/spec/samples/syst/dald4.txt +4955 -0
  93. data/spec/samples/syst/dign0.jpg +0 -0
  94. data/spec/samples/syst/dign0.txt +4955 -0
  95. data/spec/samples/syst/dign1.jpg +0 -0
  96. data/spec/samples/syst/dign1.txt +4955 -0
  97. data/spec/samples/syst/dign2.jpg +0 -0
  98. data/spec/samples/syst/dign2.txt +4955 -0
  99. data/spec/samples/syst/dive0.jpg +0 -0
  100. data/spec/samples/syst/dive0.txt +4955 -0
  101. data/spec/samples/syst/dive1.jpg +0 -0
  102. data/spec/samples/syst/dive1.txt +4955 -0
  103. data/spec/samples/syst/dive2.jpg +0 -0
  104. data/spec/samples/syst/dive2.txt +4955 -0
  105. data/spec/samples/syst/histo.m +42 -0
  106. data/spec/samples/syst/out0000.jpg +0 -0
  107. data/spec/samples/syst/out0000.txt +4955 -0
  108. data/spec/samples/syst/out0001.jpg +0 -0
  109. data/spec/samples/syst/out0001.txt +4955 -0
  110. data/spec/samples/syst/out0002.jpg +0 -0
  111. data/spec/samples/syst/out0002.txt +4955 -0
  112. data/spec/samples/syst/qzc013.jpg +0 -0
  113. data/spec/samples/syst/qzc013.txt +4955 -0
  114. data/spec/samples/syst/sample_gray.jpg +0 -0
  115. data/spec/samples/syst/sample_gray.txt +4955 -0
  116. data/spec/samples/syst_grid.yml +53 -0
  117. data/spec/spec_helper.rb +18 -10
  118. data/test_reg.m +39 -0
  119. metadata +105 -8
  120. data/spec/samples/io.jpg +0 -0
@@ -0,0 +1,42 @@
1
+ d = dir('*.txt');
2
+
3
+ for i=1:length(d)
4
+ filename = d(i).name;
5
+ f = fopen(filename,'r');
6
+ ink = textscan(f, 'ink:%f', 1);
7
+ drk = textscan(f, 'drk:%f', 1);
8
+ pap = textscan(f, 'pap:%f', 1);
9
+ cal = textscan(f, 'cal:%f', 1);
10
+ cho = textscan(f, 'cho:%f', 1);
11
+
12
+ ink = ink{1};
13
+ drk = drk{1};
14
+ pap = pap{1};
15
+ cal = cal{1};
16
+ cho = cho{1};
17
+
18
+ s = sprintf('%s --> ink %.1f, drk %.1f, pap %.1f, cal %.1f, cho %.1f', filename, ink, drk, pap, cal, cho);
19
+ disp(s);
20
+
21
+ if ink > 240
22
+ disp('invalid ink')
23
+ continue
24
+ end
25
+
26
+ dA = textscan(f, '%f');
27
+ fclose(f);
28
+ data = dA{1};
29
+
30
+ hold off
31
+ edgehist(data, 0:5:255)
32
+ set(gca, 'xlim', [ink 255])
33
+ ylim = get(gca, 'ylim');
34
+ hold on
35
+
36
+
37
+ line([drk drk], ylim, 'color', 'k');
38
+ line([pap pap], ylim, 'color', 'y');
39
+ line([cal cal], ylim, 'color', 'r');
40
+ line([cho cho], ylim, 'color', 'b');
41
+ pause
42
+ end
Binary file