资源简介
毕业设计和课程设计全套资料,主程序代码
clc; clear all; close all;
warning off all;
I = imread('images\\1.jpg');
I1 = Image_Normalize(I, 0);%图像归一化
hsize = [3 3];
sigma = 0.5;
I2 = Image_Smooth(I1, hsize, sigma, 0);
I3 = Gray_Convert(I2, 0);
bw2 = Image_Binary(I3, 0);%二值化处理
[~, ~, xy_long] = Hough_Process(bw2, I1, 0);%霍夫变换
angle = Compute_Angle(xy_long);%计算角度
[I4, bw3] = Image_Rotate(I1, bw2, angle*1.8, 0);%图像旋转
[bw4, Loc1] = Morph_Process(bw3, 0);%形态处理
[Len, XYn, xy_long] = Hough_Process(bw4, I4, 0);
[bw5, bw6] = Region_Segmation(XYn, bw4, I4, 0);
[stats1, stats2, Line] = Location_Label(bw5, bw6, I4, XYn, Loc1, 1);
[Dom, Aom, Answer, Bn] = Analysis(stats1, stats2, Line, I4);
代码片段和文件信息
function [Dom Aom Answer Bn] = Analysis(stats1 stats2 Line Img flag)
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)));
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];
% 定位竖直网格分割线
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.73*(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.32*(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.95*(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.25*(Linen2_1(1 2)-Linen1_1(1 2)));
ym2_2 = round(Linen1_1(1 2) + 0.40*(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*(Linen3_1(1 2)-Linen2_1(1 2)));
ym2_3 = round(Linen2_1(1 2) + 0.40*(Linen3_1(1 2)-Linen2_1(1 2)));
ym3_3 = round(Linen2_1(1 2) + 0.60*(Linen3_1(1 2)-Linen2_1(1 2)));
ym4_3 = round(Linen2_1(1 2) + 0.75*(Linen3_1(1 2)-Linen2_1(1 2)));
ym5_3 = round(Linen2_1(1 2) + 0.90*(Linen3_1(1 2)-Linen2_1(1 2)));
Linem1_3 = [Line1(1 1) ym1_3; Line1(2 1) ym1_3];
Linem2_3 = [Line1(1 1) ym2_3; Line1(2 1) ym2_3];
Linem3_3 = [Line1(1 1) ym3_3; Line1(2 1) ym3_3];
Linem
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 16715 2014-12-30 19:47 Analysis.m
文件 145 2014-12-30 19:45 Compute_Angle.m
文件 368 2014-12-30 19:45 Gray_Convert.m
文件 1422 2014-12-30 19:45 Hough_Process.m
文件 442 2014-12-30 19:45 Image_Binary.m
文件 412 2014-12-30 19:45 Image_Normalize.m
文件 573 2014-12-30 19:45 Image_Rotate.m
文件 461 2014-12-30 19:44 Image_Smooth.m
文件 995 2014-12-30 19:44 Location_Label.m
文件 627 2014-12-30 19:43 main.m
文件 527 2014-12-30 19:44 Morph_Process.m
文件 927 2014-12-30 19:44 Region_Segmation.m
文件 161 2014-12-30 19:43 Write_Results.m
文件 5441029 2011-05-09 13:55 images\1.JPG
目录 0 2014-12-30 19:42 images
..AD... 0 2015-01-03 20:36 results
----------- --------- ---------- ----- ----
5464804 16
- 上一篇:delphi 写的自动更新控件源码
- 下一篇:深圳地图PSD源文件
相关资源
- 人 车 路 闭环的汽车稳定性控制模拟
- 语音识别系统源程序
- 基于分割的立体匹配及算法-Segment_b
- 历年数学建模论文-历年优秀论文Wor
- 光伏模拟系统建模与控制器参数优化
- 关于泊松点过程的生成方法-Report1_P
- PWM整流器及其控制PDF-PWM整流器及其控
- 图像去雾.zip
- 数字信号处理 理论算法与实现(第三
- SimPowerSystems教程
- 基于小波的图像拼接
- 6轴机器人正解、反解例程
- eigenface 人脸表情识别源代码
- 数学建模最短路问题
-
Targetli
nk 使用手册 - lenet-5训练MNIST
- 基于DSP_Builder的FIR滤波器设计
- Stateflow流程图
- EEGLAB中文手册
- 全国二等奖“华为杯”第十四届中国
- 深度图-人脸姿态-特征提取.zip
- 答题卡识别小程序
- RS编码verilog代码与参考文章
- 光伏蓄电池的仿真模型,用在微电网
- 捷联惯导算法与组合导航原理 严
- 基于PCA的人脸识别
- VMD原代码.zip
-
Modified GFDM(Eigendecomposition-ba
sed GF - 马尔科夫链转移矩阵
- 交流伺服电机PID速度智能控制
评论
共有 条评论