91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 7.77MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2024-01-27
  • 語言: 其他
  • 標簽: Kmean??聚類??關鍵幀??

資源簡介

本程序可以很快地找到視頻和圖片序列中的關鍵幀,該壓縮包中已經有對應的圖片序列,可以直接運行程序。

資源截圖

代碼片段和文件信息

%基于聚類的關鍵幀提取法
%會彈出這幾幅關鍵幀的圖像

filenames=dir(‘images/*.jpg‘);
num=size(filenames1);
key=zeros(1num);
cluster=zeros(1num);
clusterCount=zeros(1num);??%各聚類有的幀數
count=0;????????%聚類個數

threshold=0.75;
centrodR=zeros(num256);???%聚類質心R的直方圖
centrodG=zeros(num256);???%聚類質心G的直方圖
centrodB=zeros(num256);???%聚類質心B的直方圖

if?num==0
????error(‘Sorry?there?is?no?pictures?in?images?folder!‘);
else
????%令首幀形成第一個聚類
????img=imread(strcat(‘images/‘filenames(1).name));
????count=count+1;
????[preCountRx]=imhist(img(::1));???%red?histogram
????[preCountGx]=imhist(img(::2));???%green?histogram
????[preCountBx]=imhist(img(::3));???%blue?histogram
????
????cluster(1)=1;???%設定第一個聚類選取的關鍵幀初始為首幀
????clusterCount(1)=clusterCount(1)+1;
????centrodR(1:)=preCountR;
????centrodG(1:)=preCountG;
????centrodB(1:)=preCountB;
????
????for?k=2:num
????????img=imread(strcat(‘images/‘filenames(k).name));
????????[tmpCountRx]=imhist(img(::1));???%red?histogram
????????[tmpCountGx]=imhist(img(::2));???%green?histogram
????????[tmpCountBx]=imhist(img(::3));???%blue?histogram

????????clusterGroupId=1;
????????maxSimilar=0;
????????for?clusterCountI=1:count???????????
????????????sR=0;
????????????sG=0;
????????????sB=0;
????????????%運用顏色直方圖法的差別函數
????????????for?j=1:256
????????????????sR=min(centrodR(clusterCountIj)tmpCountR(j))+sR;
????????????????sG=min(centrodG(clusterCountIj)tmpCountG(j))+sG;
????????????????sB=min(centrodB(clusterCountIj)tmpCountB(j))+sB;
????????????end
????????????dR=sR/sum(tmpCountR);
????????????dG=sG/sum(tmpCountG);
????????????dB=sB/sum(tmpCountB);
????????????%YUVpersons?are?sensitive?to?Y
????????????d=0.30*dR+0.59*dG+0.11*dB;
????????????if?d>maxSimilar
????????????????clusterGroupId=clusterCountI;
????????????????maxSimilar=d;
????????????end
????????end
????????if?maxSimilar>threshold
????????????%相似度大,與該聚類質心距離小
????????????%加入該聚類,并調整質心
????????????for?ii=1:256????
????????????????centrodR(clusterGroupIdii)=centrodR(clusterGroupIdii)*clusterCount(clusterGroupId)/(clusterCount(clusterGroupId)+1)+tmpCountR(ii)*1.0/(clusterCount(clusterGroupId)+1);
????????????????centrodG(clusterGroupIdii)=centrodG(clusterGroupIdii)*clusterCount(clusterGroupId)/(clusterCount(clusterGroupId)+1)+tmpCountG(ii)*1.0/(clusterCount(clusterGroupId)+1);
????????????????centrodB(clusterGroupIdii)=centrodB(clusterGroupIdii)*clusterCount(clusterGroupId)/(clusterCount(clusterGroupId)+1)+tmpCountB(ii)*1.0/(clusterCount(clusterGroupId)+1);
????????????end
????????????clusterCount(clusterGroupId)=clusterCount(clusterGroupId)+1;
????????????cluster(k)=clusterGroupId;???%第k幀在第clusterGroupId個聚類里面
????????else
????????????%形成新的聚類,增加一個聚類質心
????????????count=count+1;
????????????clusterCount(count)=clusterCount(count)+1;
????????????centrodR(count:)=tmpCountR;
????????????centrodG(count:)=tmpCountG;
????????????centrodB(count:)=tmpCountB;
????????????cluster(k)=count;???%第k幀在第count

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-04-10?12:37??基于K_mean聚類的關鍵幀提取代碼\
?????目錄???????????0??2017-04-10?12:37??基于K_mean聚類的關鍵幀提取代碼\images\
?????文件???????13834??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0001.jpg
?????文件???????24848??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0002.jpg
?????文件???????26083??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0003.jpg
?????文件???????25916??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0004.jpg
?????文件???????26455??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0005.jpg
?????文件???????26282??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0006.jpg
?????文件???????26640??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0007.jpg
?????文件???????26500??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0008.jpg
?????文件???????26858??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0009.jpg
?????文件???????26873??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0010.jpg
?????文件???????25870??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0011.jpg
?????文件???????25659??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0012.jpg
?????文件???????25987??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0013.jpg
?????文件???????26130??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0014.jpg
?????文件???????26972??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0015.jpg
?????文件???????27760??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0016.jpg
?????文件???????27136??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0017.jpg
?????文件???????27295??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0018.jpg
?????文件???????28964??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0019.jpg
?????文件???????27212??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0020.jpg
?????文件???????28215??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0021.jpg
?????文件???????28810??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0022.jpg
?????文件???????29340??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0023.jpg
?????文件???????28895??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0024.jpg
?????文件???????28458??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0025.jpg
?????文件???????27913??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0026.jpg
?????文件???????27867??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0027.jpg
?????文件???????28162??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0028.jpg
?????文件???????27905??2008-06-24?22:09??基于K_mean聚類的關鍵幀提取代碼\images\0029.jpg
............此處省略279個文件信息

評論

共有 條評論