?? 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 + -