function Feature = FeatureExtract(img,opts)
%---------------------- Introduction --------------------%
% input:
% img: image list
% opts: parameters
% output:
% Feature: features that extracted from images
%
% describe: use the patch that has a fixed size to scanf the image;(patch as a point)
% then sum the pixel value that in a patch;
% compute the percent of black pixel in patch as an element of feature.
%---------------------------------------------------------%
patch = opts.patch;
width = opts.width;
height = opts.height;
nImg = length(img);
column = width/patch(1);
row = height/patch(2);
area = patch(1)*patch(2);
PixPercent = zeros(row*column,1);
Feature = zeros(row*column,nImg);
%----------------------------------------- Feature Extraction -----------------------------------------%
for k = 1:length(img);
bw = im2bw( img{k},graythresh(img{k}) );
reImg = imresize( bw,[height,width] );
for i = 1:row
for j = 1:column
Atemp = sum( reImg( ( ( i*patch(2)-(patch(2)-1) ):(i*patch(2)) ) , ( ( j*patch(1)-(patch(1)-1) ):(j*patch(1)) ) ) );
PixPercent( (i-1)*column + j ) = sum( Atemp );
end
end
PixPercent = ( (area-PixPercent)/area );
Feature(:,k) = PixPercent;
end
%----------------------------------------------- End ---------------------------------------------------%
end
没有合适的资源?快使用搜索试试~ 我知道了~
基于BP神经网络的手写数字识别matlab实现
共5027个文件
bmp:5000个
ini:20个
m:6个
5星 · 超过95%的资源 需积分: 49 324 下载量 92 浏览量
2016-08-22
16:42:51
上传
评论 37
收藏 7.07MB ZIP 举报
温馨提示
本ZIP文件包含了经典的手写数字的bmp数据,共{0,1,2,……,9}10个类,每个类包含500个数据;然后对图片进行二值化处理,采用patch来对每张image提出特征,最后设计神经网络对特征进行训练,并用得到的net来测试TestingSet,经过调解参数,测试精度可以达到95%左右。整个实现过程是基于matlab语言的,code清晰,明了,简单易懂,绝对值得算法爱好者探究。
资源推荐
资源详情
资源评论
收起资源包目录
基于BP神经网络的手写数字识别matlab实现 (5027个子文件)
5_153.bmp 2KB
5_338.bmp 2KB
5_159.bmp 2KB
5_495.bmp 2KB
5_168.bmp 2KB
5_216.bmp 2KB
5_345.bmp 2KB
5_226.bmp 2KB
5_178.bmp 2KB
5_7.bmp 2KB
5_63.bmp 2KB
5_460.bmp 2KB
5_42.bmp 2KB
5_317.bmp 2KB
5_195.bmp 2KB
5_404.bmp 2KB
5_413.bmp 2KB
5_123.bmp 2KB
5_451.bmp 2KB
5_407.bmp 2KB
5_73.bmp 2KB
5_373.bmp 2KB
5_225.bmp 2KB
5_80.bmp 2KB
5_326.bmp 2KB
5_315.bmp 2KB
5_473.bmp 2KB
5_353.bmp 2KB
5_491.bmp 2KB
5_323.bmp 2KB
5_348.bmp 2KB
5_17.bmp 2KB
5_391.bmp 2KB
5_171.bmp 2KB
5_15.bmp 2KB
5_480.bmp 2KB
5_164.bmp 2KB
5_53.bmp 2KB
5_297.bmp 2KB
5_444.bmp 2KB
5_350.bmp 2KB
5_55.bmp 2KB
5_32.bmp 2KB
5_416.bmp 2KB
5_425.bmp 2KB
5_268.bmp 2KB
5_330.bmp 2KB
5_70.bmp 2KB
5_304.bmp 2KB
5_202.bmp 2KB
5_51.bmp 2KB
5_383.bmp 2KB
5_3.bmp 2KB
5_398.bmp 2KB
5_67.bmp 2KB
5_296.bmp 2KB
5_204.bmp 2KB
5_76.bmp 2KB
5_429.bmp 2KB
5_91.bmp 2KB
5_243.bmp 2KB
5_234.bmp 2KB
5_344.bmp 2KB
5_207.bmp 2KB
5_498.bmp 2KB
5_299.bmp 2KB
5_9.bmp 2KB
5_147.bmp 2KB
5_223.bmp 2KB
5_39.bmp 2KB
5_34.bmp 2KB
5_497.bmp 2KB
5_337.bmp 2KB
5_474.bmp 2KB
5_375.bmp 2KB
5_368.bmp 2KB
5_436.bmp 2KB
5_442.bmp 2KB
5_127.bmp 2KB
5_177.bmp 2KB
5_94.bmp 2KB
5_333.bmp 2KB
5_399.bmp 2KB
5_265.bmp 2KB
5_169.bmp 2KB
5_430.bmp 2KB
5_242.bmp 2KB
5_24.bmp 2KB
5_158.bmp 2KB
5_125.bmp 2KB
5_467.bmp 2KB
5_231.bmp 2KB
5_452.bmp 2KB
5_279.bmp 2KB
5_261.bmp 2KB
5_81.bmp 2KB
5_357.bmp 2KB
5_365.bmp 2KB
5_293.bmp 2KB
5_132.bmp 2KB
共 5027 条
- 1
- 2
- 3
- 4
- 5
- 6
- 51
资源评论
- xiaociniao2018-04-19识别率不稳定 大约只有90%左右
- sst___2018-12-04用的工具箱,不是自己写的
- qq_335573402017-04-15挺好的,识别率可达到92%,希望可以进一步提高
- doolisty2017-12-23条理很清晰,对于初学者而言实在是很好的入门,准确率也很高
ReLuJie
- 粉丝: 109
- 资源: 42
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功