1 简介
BP 神经网络是一种按照误差逆向传播算法训练的多层前馈神经网络,已广泛应用于模式识别、函数逼近、信号处理和自动控制等领域,是目前应用最广泛的神经网络。
正在上传…重新上传取消
正在上传…重新上传取消

2 部分代码
clc; clear all; close all;
warning off all;
% 获取字符集
fd = fullfile(pwd, 'images', 'dbx');
fds = dir(fd);
ts = [];
for i = 1 : length(fds)
    if isequal(fds(i).name, '.') || isequal(fds(i).name, '..')
        continue;
    end
    ts{end+1} = fds(i).name;
end
files = GetAllFiles(fd);
% 提取字符集合的特征向量
db_file = fullfile(pwd, 'VL.mat');
if exist(db_file, 'file')
    load(db_file);
else
for i=1:m
   cropimg_2 = imcrop(A,status(i).BoundingBox);%画框部分图像截取
   cropimg_2 = imresize(cropimg_2,[28,28]); %将图像调整为28*28的
   %cropimg_2 = imcomplement(cropimg_2);
   [file_path,~,~]= fileparts(mfilename('fullpath'));
   disp(file_path)
imwrite(cropimg_2,[file_path,'\\LXJC\\',num2str(m,'%02d'),'.bmp'],'bmp')%将截取部分的图像暂时存储在LXSB文件中
filePath = [file_path,'\\LXJC\\',num2str(m,'%02d'),'.bmp'];%打开图像
   if isequal(filePath, 0)
        break;
    end
    im = uint16(imread(filePath));
    [~, p_test] = get_feature(im);
    p2n = tramnmx(p_test,minp, maxp);
    r=sim(net,p2n);
    r2n = postmnmx(r,mint,maxt);
    r = round(r2n(1));
    r = ts{r};
    figure;imshow(cropimg_2);title(r, 'FontSize', 16);
end 
else
end3 仿真结果
正在上传…重新上传取消

4 参考文献
[1]罗莉. BP神经网络数字识别的Matlab实现[J]. 电子技术与软件工程, 2019(20):2.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。











