一、获取代码方式(附实验题目说明)

获取代码方式1:
完整代码已上传我的资源:【车牌识别】基于matlab车牌识别【含Matlab源码 417期】

获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、车牌识别简介

基于matlab 国内车牌识别步骤:原图像识别、列过滤、行过滤、分割结果、灰度、水平倾斜校正后、滤波二值化、字符分割。

三、部分源代码

% clear
addpath(genpath(pwd)); %添加子文件夹下的所有文件
%%加载图像
start=6212;
% state=num+1;
% start=6540;
state=1;% for num = state:294close all
num = 1  ;   %读取文件夹下的第num张图片
% 20
% fname=['样本库\IMG_',num2str(start+num),'.jpg'];% 有三个车牌文件夹:'PlateImages/%d.jpg' 或者'PlateImages/Image1/%d.jpg' 或'PlateImages/Image2/%d.jpg'
filename = fullfile(pwd, fname);
Img = imread(filename);
%{figure(5);
subplot(2,2,1);imshow(Img);title('原图');I1=rgb2gray(Img);
subplot(2,2,2);imshow(I1);title('灰度图');
subplot(2,2,3);imhist(I1);title('灰度图直方图');I2=edge(I1,'roberts',0.15,'both');
subplot(2,2,4);imshow(I2);title('roberts算子边缘检测')
se=[1;1;1];
I3=imerode(I2,se);
figure(6);
subplot(2,2,1);imshow(I3);title('腐蚀后图像');se=strel('rectangle',[25,25]);I4=imclose(I3,se);
subplot(2,2,2);imshow(I4);title('平滑图像的轮廓');I5=bwareaopen(I4,2000);
subplot(2,2,3);imshow(I5);title('从对象中移除小对象');
%} GetDB;%% 定位车牌
% 定位车牌:找出车牌在原始图片中的位置
% 输入参数Img:  读取的原始真彩色图像信息
% 输出参数plate:经过定位处理后,从原始真彩色图像(会进行压缩处理)截取到的车牌位置处的真彩色图像信息
plate = Pre_Process(Img);%% 倾斜校正
% 倾斜校正:对待识别数字的倾斜校正,分别使用Radon变换和仿射函数处理水平倾斜校正和垂直倾斜校正
% 输入参数:plate为定位截取的真彩色车牌图像信息
% 输出参数:
plate = radon_repair(plate);%% 车牌滤波
% 车牌滤波:剔除(像素值置0)车牌图片的边界图像信息
% 输入参数:plate为定位截取的真彩色车牌图像信息
% 输出参数:d为原始车牌图像滤波(即剔除上下边界外(和使用多边形区域剔除))后的图片,p为真彩色原始车牌图像plate逆时针旋转后的图片
[d, p] = Plate_Process(plate,fname);%% 分割车牌
% 分割车牌:裁掉(删除)车牌图像信息的边界
% 输入参数:d为原始车牌图像滤波(即剔除上下边界外(和使用多边形区域剔除))后的图片,p为真彩色原始车牌图像plate逆时针旋转后的图片
% 输出参数:根据图像d的非0边界,裁剪出的输入图片:输入图片d裁剪后输出图片e,输入图片p裁剪后输出图片p
[e, p] = Segmation(d, p);
%% 去除噪声
function [result, plate] = Plate_Process(plate, fname, flag)% 分割步骤if nargin < 3flag = 1;end% n = ndims(A) returns the number of dimensions in the array A.if ndims(plate) == 3% I = rgb2gray(RGB) converts the truecolor image RGB to the grayscale intensity image I.% rgb2gray converts RGB images to grayscale by eliminating the hue and saturation information while retaining the luminance.plate1 = rgb2gray(plate);   % 将车牌原始图片信息转换成grayscale intensity image(灰度图像?为方便,下面都称为灰度图像)elseplate1 = plate;endIm = plate1;    % Im为灰度图像plate = double(plate);% B = mean2(A) computes the mean of the values in A.% b = std2(A) computes the standard deviation of the values in A.% 求出当前图片的[均值 标准差]矩阵,用于和数据库的[均值 标准差]矩阵进行计算,然后找出最适合用于处理当前图片的数据库参数信息m = [mean2(plate(:,:,1)) mean2(plate(:,:,2)) mean2(plate(:,:,3)) std2(plate(:,:,1)) std2(plate(:,:,2)) std2(plate(:,:,3))];% f = fullfile(filepart1,...,filepartN) builds a full file specification, f, from the folders and file names specified.% f = fullfile('myfolder','mysubfolder','myfile.m') ===> f = myfolder\mysubfolder\myfile.mload('model.mat');ms = cat(1, M.m);   % 数据库中的[均值 标准差]矩阵% B = repmat(A,m,n) creates a large matrix B consisting of an m-by-n tiling of copies of A.% The size of B is [size(A,1)*m, (size(A,2)*n]. The statement repmat(A,n) creates an n-by-n tiling.m = repmat(m, size(ms, 1), 1);  % 将当前图片的[均值 标准差]矩阵进行拓展,以便进行与数据库[均值 标准差]矩阵运算% B = sum(A,dim) sums along the dimension of A specified by scalar dim. The dim input is an integer value from 1 to N, % where N is the number of dimensions in A. Set dim to 1 to compute the sum of each column, 2 to sum rows, etc.% 按行求和dis = sum((m - ms).^2, 2);  % 当前图片[均值 标准差]矩阵与数据库[均值 标准差]矩阵的方差[~, id] = min(dis);         % 找出方差最小的那个,也就是说,找出最适合用于处理当前图片的数据库参数if fname(6)=='s'ro = M(id).ro;              % 图片旋转的角度参数,单位为度elsero=0;endth = M(id).th;              % 将灰度图像转换为二进制图像的门限,灰度图像中的值大于该门限则转换为1,否则转换为0pts = M(id).pts;            % 定义图片的顶点% B = imrotate(A,angle,method) rotates image A by angle degrees in a counterclockwise direction around its% center point, using the interpolation method specified by method.Im = imrotate(Im, ro, 'bilinear');          % 将灰度图片Im按照逆时针方向,旋转ro度,插值方法选择双线性插值plate = imrotate(plate, ro, 'bilinear');    % 将车牌原始图像,也按照逆时针方向,旋转ro度,插值方法选择双线性插值% BW = im2bw(I, level) converts the grayscale image I to a binary image. % The output image BW replaces all pixels in the input image with luminance(亮度) greater than level with the value 1 (white)% and replaces all other pixels with the value 0 (black). Specify level in the range [0,1]. This range is relative to% the signal levels possible for the image's class. Therefore, a level value of 0.5 is midway between black and white, regardless of class.bw = im2bw(Im, th);     % 将灰度图像Im转换成二进制图像,转换门限为th% h = fspecial('average', hsize) returns an averaging filter h of size hsize.% The argument hsize can be a vector specifying the number of rows and columns in h, or it can be a scalar, in which case h is a square matrix.h = fspecial('average', 2);     % 定义一个多维均值滤波器h,维度为2 x 2% B = imfilter(A,h) filters the multidimensional array A with the multidimensional filter h.% The array A can be logical or a nonsparse numeric array of any class and dimension. The result B has the same size and class as A.% ___= imfilter(___,options,...) performs multidimensional filtering according to the specified options.% 'replicate' ===> Input array values outside the bounds of the array are assumed to equal the nearest array border value.bw1 = imfilter(bw, h, 'replicate');     % 使用多维均值滤波器h,对二进制图像bw进行滤波,滤波选项为replicate%     mask = Mask_Process(bw1);   % 此方法功能是去除bw1图像的上下杂线,即使用特定算法,剔除二进制图像bw1的上下边界处的信息(这些行的像素值全设为0)% 此处的mask可理解为:如果图像像素点在杂线上边界与车牌上边界之间或杂线下边界与车牌下边界之间,则这个像素点的值为0,% 否则,如果图像像素点在杂线上边界和杂线下边界之间,则这个像素点的值为1
%     bw2 = bw1 .* mask;          % 这个.*操作可理解为:与运算,这样bw2就是利用mask矩阵剔除二进制图像bw1中干扰后的结果bw2 = bw1;% 除了通过Mask_Process()函数剔除杂线外,如果有定义车牌边界信息,则可进一步使用车牌边界信息进行图像处理
%     if ~isempty(pts)            % 如果pts不空(即,有外部边界顶点定义),则执行
%         % BW = roipoly(I, c, r) returns the region of interest(ROI) specified by the polygon(多边形) described by vectors c and r,
%         % which specify the column and row indices of each vertex(顶点), respectively. c and r must be the same size.
%         % 根据二进制图片bw2,以及多边形的顶点pts(:, 1), pts(:, 2),得到二进制图像mask,顶点围起来的区域的值全为1,
%         % 其它区域的值全为0,这样做的目的是剔除车牌边界的干扰
%         mask = roipoly(bw2, pts(:, 1), pts(:, 2));      % 得到一个由pts顶点(可组成多边形)指定的二进制边界图像
%         bw1 = bw1 .* mask;      % bw1是只使用多边形剔除干扰后的二进制图像
%         bw2 = bw2 .* mask;      % bw2是使用Mask_Process()算法和多边形两种方法剔除干扰后的二进制图像
%     end

四、运行结果






五、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.
[5]呙润华,苏婷婷,马晓伟.BP神经网络联合模板匹配的车牌识别系统[J].清华大学学报(自然科学版),2013,53(9):1221-1226.
[6]鲁扬.基于BP神经网络的车牌识别算法研究[D].大庆:东北石油大学,2018.
[7]李强,张娟.一种改进的基于模板匹配的污损车牌识别方法[J].智能计算机与应用. 2019,9(03).
[8] 梁凯.基于MATLAB的汽车车牌识别系统的设计与实现[D] .哈尔滨:黑龙江大学, 2018.
[9]刘雄飞,朱盛春.车牌字符多特征提取与BP神经网络的识别算法[J].计算机仿真,2014,31(10):161-164,290.
[10] 曾泉, 谭北海.基于SVM和BP神经网络的车牌识别系统[J] .电子科技, 2016, 29(1) :98-101.

【车牌识别】基于matlab车牌识别【含Matlab源码 417期】相关推荐

  1. 【Matlab指纹识别】指纹识别门禁系统【含GUI源码 1692期】

    一.代码运行视频(哔哩哔哩) [Matlab指纹识别]指纹识别门禁系统[含GUI源码 1692期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 包子阳,余继 ...

  2. 【Matlab车牌识别】停车计费系统【含GUI源码 735期】

    一.代码运行视频(哔哩哔哩) [Matlab车牌识别]停车计费系统[含GUI源码 735期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅.MATLA ...

  3. 【Matlab验证码识别】遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别【含GUI源码 1694期】

    一.代码运行视频(哔哩哔哩) [Matlab验证码识别]遗传算法和最大熵优化+大津法(OTSU)+自定义阈值数字验证码识别[含GUI源码 1694期] 二.matlab版本及参考文献 1 matlab ...

  4. 【Matlab人脸识别】BP神经网络人脸识别(含识别率)【含GUI源码 891期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]BP神经网络人脸识别(含识别率)[含GUI源码 891期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] ...

  5. 【Matlab人脸识别】形态学教室人数统计(带面板)【含GUI源码 1703期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]形态学教室人数统计(带面板)[含GUI源码 1703期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]孟 ...

  6. 【Matlab人脸识别】人脸实时检测与跟踪【含GUI源码 673期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]人脸实时检测与跟踪[含GUI源码 673期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]孟逸凡,柳益君 ...

  7. 【Matlab身份证识别】身份证号码识别【含GUI源码 014期】

    一.代码运行视频(哔哩哔哩) [Matlab身份证识别]身份证号码识别[含GUI源码 014期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅.MAT ...

  8. 【Matlab人脸识别】KL变换人脸识别【含GUI源码 859期】

    一.代码运行视频(哔哩哔哩) [Matlab人脸识别]KL变换人脸识别[含GUI源码 859期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 蔡利梅.MAT ...

  9. 【Matlab指纹识别】指纹识别匹配门禁系统【含GUI源码 587期】

    一.代码运行视频(哔哩哔哩) [Matlab指纹识别]指纹识别匹配门禁系统[含GUI源码 587期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 包子阳,余 ...

  10. 【Matlab水果识别】苹果质量检测及分级系统(带面板)【含GUI源码 1613期】

    一.代码运行视频(哔哩哔哩) [Matlab水果识别]苹果质量检测及分级系统(带面板)[含GUI源码 1613期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1 ...

最新文章

  1. iOS 获取指定时间的前后N个月
  2. android 二次点击退出,android返回二次退出
  3. JavaWeb 入门篇(3)ServletContext 详解 具体应用
  4. 【Matlab】函数输入个数不定怎么办?
  5. [转]java垃圾回收之循环引用
  6. 最新最全vuepress零基础搭建(github搭建+新增插件)
  7. IOS之优秀PCH头文件定义
  8. ethereumjs/ethereumjs-common-3-test
  9. MongoDB 教程五: MongoDB固定集合和性能优化
  10. 数据结构视频教程 -《数据结构(邓俊辉)》
  11. 电脑上如何图片文字识别?哪个工具识别的准确?
  12. 微信开放平台应用申请流程优化公告
  13. Vue项目的打包\部署\优化
  14. 使用element-ui实现表格分页
  15. JBoss学习和应用
  16. 修改iOS工程的Organization Name
  17. 中国无人零售商店前景展望与未来发展预测分析报告2022-2028年版
  18. 「 C++ 11」std::thread “invalid use of non-static member function“问题处理
  19. 思维导图浅析入门知识图谱(Knowledge Graph)
  20. 假如我是铁路订票系统架构师系列 - 开放还是封闭系统 - 对外挂的态度

热门文章

  1. cpg数据库处理_找到未提取的pdf
  2. 史上最全的人工智能知识体系大全图谱 中国人工智能发展现状与未来
  3. opengl 加载贴图Unknown DIB file format问题
  4. Atitit 项目范围管理 目录 1. 应该包含下面过程:启动、范围计划、范围定义、范围核实及范围变更控制 1 1.1. 项目范围管理的五个过程 1 2. 启动过程 1 2.1. 项目章程(如质量、
  5. Atitit 歌曲年份抓取的nlp ai项目 原理通过百度搜索,抓取第一页数据,正则数字,过滤年份。。 显示格式。。歌曲,年份,年份周围前后40字符,方便核对 通过百科抓取比较准确 红尘情歌
  6. Atitit webservice之道 艾提拉著 目录 1. 基本说明Web Service 1 2. 基本概念与内部构成 2 2.1. Web services要使用两种技术: XML SOAP
  7. Atitit 版本管理----分支管理Atit
  8. Atitit opencv版本新特性attilax总结
  9. Atitit 如何利用先有索引项进行查询性能优化
  10. 一篇好奇心文,带你看懂基金的运营全貌