color video error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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
Please give me some advices. Thanks!
1 Kommentar
Walter Roberson
am 11 Mär. 2012
What error is encountered on which line? Or how does the output differ from what you expect?
Antworten (0)
Siehe auch
Kategorien
Mehr zu Modify Image Colors finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!