您现在的位置:首页 >> 机器学习 >> 内容

基于OCR模板匹配的手写英文字母数字识别matlab仿真

时间:2022/12/29 18:43:07 点击:

  核心提示:A163,包括程序操作录像...

1.完整项目描述和程序获取

>面包多安全交易平台:https://mbd.pub/o/bread/Y52bkppx

>如果链接失效,可以直接打开本站店铺搜索相关店铺:

点击店铺

>如果链接失效,程序调试报错或者项目合作可以加微信或者QQ联系。

2.部分仿真图预览


3.算法概述

         文字识别(OCR)目前在多个行业中得到了广泛应用,比如金融行业的单据识别输入,餐饮行业中的发票识别, 交通领域的车票识别,企业中各种表单识别,以及日常工作生活中常用的身份证,驾驶证,护照识别等等。

        OCR(文字识别)是目前常用的一种AI能力。 一般OCR的识别结果是一种按行识别的结构化输出,能够给出一行文字的检测框坐标及文字内容。

4.部分源码

imagen=imread('TEST_1.jpg');

imshow(imagen);

if size(imagen,3)==3 %RGB image

    imagen=rgb2gray(imagen);

end

% Convert to BW

threshold = graythresh(imagen);

imagen =~im2bw(imagen,threshold);

imagen = bwareaopen(imagen,30);

word=[ ];

re=imagen;

fid = fopen('text.txt', 'wt');

% Load templates

load templates

global templates

num_letras=size(templates,2);

while 1

    %Fcn 'lines' separate lines in text

    [fl re]=lines(re);

    imgn=fl;

    [L Ne] = bwlabel(imgn);    

    for n=1:Ne

        [r,c] = find(L==n);

        % Extract letter

        n1=imgn(min(r):max(r),min(c):max(c));  

        img_r=imresize(n1,[42 24]);

        letterread_letter(img_r,num_letras);

        word=[word letter];

    end

    fprintf(fid,'%s\n',word);%Write 'word' in text file (upper)

    word=[ ];

    if isempty(re)  %See variable 're' in Fcn 'lines'

        break

    end    

end

fclose(fid);

winopen('text.txt')

A163

作者:我爱C编程 来源:我爱C编程
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
本类固顶
  • 没有
  • FPGA/MATLAB商业/科研类项目合作(www.store718.com) © 2025 版权所有 All Rights Reserved.
  • Email:1480526168@qq.com 站长QQ: 1480526168