Effacer les filtres
Effacer les filtres

color video error

1 vue (au cours des 30 derniers jours)
Pan
Pan le 11 Mar 2012
I try to extract the keyframe usin entropy way,current,I test video that is gray and size is [288 252 300]. But now,I must to use color video that size is [480 640 3 207] row and colum is 480 640 and 3 is color(RGB)and 207 is frames.
this is my code,current
clear all;
load xz
[m,n,c,f]=size(xz);
h=zeros(1,256);
e=zeros(1,207);
a=zeros(1,207);
dif=zeros(1,207);
se=zeros(1,207);
b=zeros(1,207);
for ix=1:207;
h=zeros(1,256);
for ii=1:m
for jj=1:n
c=1;
h(xz(ii,jj,c,ix)+1)= h(xz(ii,jj,c,ix)+1)+1;
end
end
figure(1)
plot(h)
pf=h/(m*n);
figure(2)
plot(pf)
for ii=1:256
if(pf(ii)==0) % pr為0,則q(消息量)為0
q(ii)=0;
else
q(ii)=-1.*log2(pf(ii)); %pr不為0,則用log去計算出q(消息量)
end
end
ef=pf.*q;
e(ix)=sum(pf.*q);
em=sort(ef,2,'descend');
s=0;
for k=1:256
s=s+em(k);
if (s>=0.7*e(ix) )
se(ix)=s;
break;
end
end
a(ix)=k;
s=0;
for k=a(ix):256
s=s+em(k);
end
b(ix)=s;
end
for ix=1:207
if(ix<207)
dif(ix)=abs(b(ix)-b(ix+1));
if(dif(ix)>0.1)
ix
end
end
end
I refer to the algorithm of this paper http://kawicho.com/iat333/IAT455%20_IGNOR/useful_.pdf
Please give me some advices. Thanks!
  1 commentaire
Walter Roberson
Walter Roberson le 11 Mar 2012
What error is encountered on which line? Or how does the output differ from what you expect?

Connectez-vous pour commenter.

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by