资源简介
与“基于图像的答题卡判定与成绩统计”论文配套,源码参考了刘衍琦、詹福宇的“MATLAB图像与视频处理实用案例详解”一书,并做了改进。
代码片段和文件信息
function [Dom Aom Answer Bn] = Analysis(stats1 stats2 Line Img flag)
%%下区域分析
%答题区域默认为六个大区:1~20,21~40,41~60,61~75,76~90,91~105
if nargin < 5
flag = 1;
end
Line1 = Line{1};
Line2 = Line{2};
Line3 = Line{3};
Line4 = Line{4};
yn1 = round(Line1(1 2) + 0.18*(Line2(1 2)-Line1(1 2)));
yn2 = round(Line1(1 2) + 0.34*(Line2(1 2)-Line1(1 2)));
yn3 = round(Line1(1 2) + 0.50*(Line2(1 2)-Line1(1 2)));
yn4 = round(Line1(1 2) + 0.66*(Line2(1 2)-Line1(1 2)));
yn5 = round(Line1(1 2) + 0.82*(Line2(1 2)-Line1(1 2)));
yn6 = round(Line1(1 2) + 0.98*(Line2(1 2)-Line1(1 2)));
%下区域六条横线
Linen1_1 = [Line1(1 1) yn1; Line1(2 1) yn1];
Linen2_1 = [Line1(1 1) yn2; Line1(2 1) yn2];
Linen3_1 = [Line1(1 1) yn3; Line1(2 1) yn3];
Linen4_1 = [Line1(1 1) yn4; Line1(2 1) yn4];
Linen5_1 = [Line1(1 1) yn5; Line1(2 1) yn5];
Linen6_1 = [Line1(1 1) yn6; Line1(2 1) yn6];
% 定位竖直网格分割线
xn1 = round(Line3(1 1) + 0.22*(Line4(1 1)-Line3(1 1)));
xn2 = round(Line3(1 1) + 0.26*(Line4(1 1)-Line3(1 1)));
xn3 = round(Line3(1 1) + 0.48*(Line4(1 1)-Line3(1 1)));
xn4 = round(Line3(1 1) + 0.52*(Line4(1 1)-Line3(1 1)));
xn5 = round(Line3(1 1) + 0.72*(Line4(1 1)-Line3(1 1)));
xn6 = round(Line3(1 1) + 0.77*(Line4(1 1)-Line3(1 1)));
xn7 = round(Line3(1 1) + 0.98*(Line4(1 1)-Line3(1 1)));
Linen1_2 = [xn1 Line3(1 2); xn1 Line3(2 2)];
Linen2_2 = [xn2 Line3(1 2); xn2 Line3(2 2)];
Linen3_2 = [xn3 Line3(1 2); xn3 Line3(2 2)];
Linen4_2 = [xn4 Line3(1 2); xn4 Line3(2 2)];
Linen5_2 = [xn5 Line3(1 2); xn5 Line3(2 2)];
Linen6_2 = [xn6 Line3(1 2); xn6 Line3(2 2)];
Linen7_2 = [xn7 Line3(1 2); xn7 Line3(2 2)];
%下区域一定位横网格线坐标计算
ym1_1 = round(Line1(1 2) + 0.38*(Linen1_1(1 2)-Line1(1 2)));
ym2_1 = round(Line1(1 2) + 0.5*(Linen1_1(1 2)-Line1(1 2)));
ym3_1 = round(Line1(1 2) + 0.65*(Linen1_1(1 2)-Line1(1 2)));
ym4_1 = round(Line1(1 2) + 0.80*(Linen1_1(1 2)-Line1(1 2)));
ym5_1 = round(Line1(1 2) + 0.93*(Linen1_1(1 2)-Line1(1 2)));
%下区域一定位横网格线
Linem1_1 = [Line1(1 1) ym1_1; Line1(2 1) ym1_1];
Linem2_1 = [Line1(1 1) ym2_1; Line1(2 1) ym2_1];
Linem3_1 = [Line1(1 1) ym3_1; Line1(2 1) ym3_1];
Linem4_1 = [Line1(1 1) ym4_1; Line1(2 1) ym4_1];
Linem5_1 = [Line1(1 1) ym5_1; Line1(2 1) ym5_1];
%下区域二定位横网格线坐标计算
ym1_2 = round(Linen1_1(1 2) + 0.30*(Linen2_1(1 2)-Linen1_1(1 2)));
ym2_2 = round(Linen1_1(1 2) + 0.43*(Linen2_1(1 2)-Linen1_1(1 2)));
ym3_2 = round(Linen1_1(1 2) + 0.60*(Linen2_1(1 2)-Linen1_1(1 2)));
ym4_2 = round(Linen1_1(1 2) + 0.75*(Linen2_1(1 2)-Linen1_1(1 2)));
ym5_2 = round(Linen1_1(1 2) + 0.90*(Linen2_1(1 2)-Linen1_1(1 2)));
%下区域二定位横网格线
Linem1_2 = [Line1(1 1) ym1_2; Line1(2 1) ym1_2];
Linem2_2 = [Line1(1 1) ym2_2; Line1(2 1) ym2_2];
Linem3_2 = [Line1(1 1) ym3_2; Line1(2 1) ym3_2];
Linem4_2 = [Line1(1 1) ym4_2; Line1(2 1) ym4_2];
Linem5_2 = [Line1(1 1) ym5_2; Line1(2 1) ym5_2];
%下区域三定位横网格线坐标计算
ym1_3 = round(Linen2_1(1 2) + 0.25*(Linen
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 24677 2017-05-29 21:04 MyProgram3.0\Analysis.m
文件 4281 2017-06-16 13:04 MyProgram3.0\AnswerCardJudgment.prj
文件 280 2017-04-03 18:37 MyProgram3.0\Compute_Angle.m
文件 1287 2017-06-14 16:40 MyProgram3.0\contrastAnswers.m
文件 335 2017-06-14 15:15 MyProgram3.0\gaussianFilter.m
文件 368 2017-04-03 09:28 MyProgram3.0\Gray_Convert.m
文件 46428 2017-06-14 16:12 MyProgram3.0\GUI1.fig
文件 10413 2017-06-14 16:36 MyProgram3.0\GUI1.m
文件 1731 2017-04-03 18:33 MyProgram3.0\Hough_Process.m
文件 25070 2017-04-11 17:28 MyProgram3.0\html\GUI1.html
文件 1928 2017-04-11 17:28 MyProgram3.0\html\GUI1.png
文件 20655 2017-04-11 17:28 MyProgram3.0\html\GUI1_01.png
文件 5441029 2011-05-09 13:55 MyProgram3.0\images\1.JPG
文件 1796312 2017-05-29 20:38 MyProgram3.0\images\2.JPG
文件 3204274 2017-04-03 12:23 MyProgram3.0\images\3.jpg
文件 442 2017-04-03 09:29 MyProgram3.0\Image_Binary.m
文件 412 2014-12-30 19:45 MyProgram3.0\Image_Normalize.m
文件 697 2017-04-03 18:39 MyProgram3.0\Image_Rotate.m
文件 457 2017-06-14 17:53 MyProgram3.0\Image_Smooth.m
文件 1530 2017-04-05 14:37 MyProgram3.0\Location_Label.m
文件 128704 2017-04-06 17:26 MyProgram3.0\matlab.mat
文件 525 2017-04-03 18:49 MyProgram3.0\Morph_Process.m
文件 1657 2017-06-14 16:49 MyProgram3.0\Paper_Inspection.m
文件 795 2017-06-08 10:20 MyProgram3.0\Readme.txt
文件 1486 2017-04-03 18:52 MyProgram3.0\Region_Segmation.m
文件 285393 2017-06-14 16:53 MyProgram3.0\results\1.png
文件 102116 2017-06-14 16:53 MyProgram3.0\results\2.png
文件 198856 2017-06-14 16:53 MyProgram3.0\results\306030306.png
文件 25088 2017-06-14 16:53 MyProgram3.0\results\grades.xls
文件 1039 2017-06-14 16:18 MyProgram3.0\runme.m
............此处省略12个文件信息
评论
共有 条评论