color video error
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2012년 3월 11일
What error is encountered on which line? Or how does the output differ from what you expect?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!