📄 getfeature.m
字号:
%特征提取以8*8的矩阵存取
function[array64]=getfeature(input)
% if (input=file)
% title('go on');
% else
% title('stop');
[row,col]=size(input);
basement1=0;
basement2=0;
leaveone=mod(row,8);
leavetwo=mod(col,8);
for i=1:8
rowspace=floor(row/8);
if(leavetwo>0)
rowspace=rowspace+1;
leaveone=leaveone-1;
end
basement1=basement1+rowspace;
basement2=0;
for j=1:8
colspace=floor(col/8);
if(leavetwo>0)
colspace=colspace+1;
leavetwo=leavetwo-1;
end
basement2=basement2+colspace;
count=0;
sum=0;
for k=basement1-rowspace+1 :basement1
for l=basement2-colspace+1:basement2
count=count+input(k,l);
sum=sum+1;
end
end
array(i,j)=count/sum;
end
end
index=1;
for(i=1:8)
for(j=1:8)
array64(index,1)=array(i,j);
index=index+1;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -