资源简介
Saliency Detection via Absorbing Markov Chain 中对应的源码
代码片段和文件信息
function Saliency_Absorb_MC
%%
clear; tic;
addpath( ‘./SubCode/‘ );
Salmap = ‘./map/‘;
mkdir( Salmap );
imgpath = ‘./img/‘;
ImgEnum=dir([imgpath ‘*.jpg‘]); ImgNum=length(ImgEnum);
for i= 1 :ImgNum
i
imname = [ imgpath ImgEnum(i).name ];
Img = double( imread( imname ) );
[ heightwidth ] = size(Img(::1));
PixNum = height*width;
ImgVecR = reshape( Img(::1)‘ PixNum 1);
ImgVecG = reshape( Img(::2)‘ PixNum 1);
ImgVecB = reshape( Img(::3)‘ PixNum 1);
% m is the compactness parameter k is the super-pixel number in SLIC algorithm
m = 20; k = 250;
ImgAttr=[ height width k m PixNum ];
% obtain superpixel from SLIC algorithm: LabelLine is the super-pixel label vector of the image
% Sup1 Sup2 Sup3 are the mean L a b colour value of each superpixel
% k is the number of the super-pixel.
[ LabelLine Sup1 Sup2 Sup3 k ] = SLIC( ImgVecR ImgVecG ImgVecB ImgAttr );
Label=reshape(LabelLinewidthheight);
Label = Label‘; % the superpixle label
[ ConPix ConPixDouble ] = find_connect_superpixel_DoubleIn_Opposite( Label k height width );
% count the number of the edge in the graph
NumInit=0;
for j=1:k
for z=j+1:k
if ConPixDouble(jz)>0
NumInit=NumInit+1;
end
end
end
Dcol=zeros(NumInit3);
% calculate the edge weight
mm=1;
for j=1:k-1
for z=j+1:k
if ConPixDouble(jz)>0
DcolTem = sqrt( ( Sup1(j)-Sup1(z) ).^2 + ( Sup2(j)-Sup2(z) ).^2 + ( Sup3(j)- Sup3(z) ).^2 );
Dcol(mm 1: 3 )=[jzDcolTem ];
mm=mm+1;
end
end
end
DcolNor = normalize( Dcol(:3) );
weight = exp( -10*DcolNor ) + .00001;
WconFirst = sparse( [Dcol(:1);Dcol(:2)] [Dcol(:2);Dcol(:1)] [weightweight]k k );
WconFirst = full(WconFirst ) + eye(k); % the affinity matrix of the graph model
Discard = sum(WconFirst2);
DiscardPos = find( Discard < 1.1 ); % to discard the outlier
LenDiscardPos = length(DiscardPos);
EdgSup = Find_Edge_Superpixels( Label k height width WconFirst ConPix );
for j=1:LenDiscardPos
EdgSup( DiscardPos(j) ) = 2;
end
NumIn = k - length( find( EdgSup == 2 ) );
NumEdg = length( find( EdgSup==1 ) );
EdgWcon = zeros( k NumEdg );
mm=1;
for j=1:k
if EdgSup(j)==1
EdgWcon(:mm) = WconFirst(:j);
mm = mm + 1;
end
end
alph = 1; W=zeros(kk);
%%%%%%%%%%%% absorb MC
if NumIn == k
baseEdg = sum( EdgWcon 2 ) ;
D = diag( Discard + baseEdg );
Wcon = D \ WconFirst;
I = eye( NumIn );
N = ( I - alph* Wcon );
y = ones( NumIn 1 );
Sal = N \ y;
Sal = normalize(Sal);
else
baseEdg
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 15742 2007-06-13 17:00 code_absorb_MC\img\0_1_1339.jpg
文件 42274 2007-06-13 17:00 code_absorb_MC\img\0_1_1427.jpg
..A.SH. 13312 2013-10-02 09:41 code_absorb_MC\img\Thumbs.db
文件 1346 2013-10-02 12:01 code_absorb_MC\read_me.txt
文件 6879 2013-10-02 11:58 code_absorb_MC\Saliency_Absorb_MC.m
文件 2333 2013-10-02 10:32 code_absorb_MC\SubCode\find_connect_superpixel_DoubleIn_Opposite.m
文件 1376 2013-10-02 10:40 code_absorb_MC\SubCode\Find_Edge_Superpixels.m
文件 2368 2013-10-02 11:40 code_absorb_MC\SubCode\normalize.m
文件 32892 2013-04-05 18:32 code_absorb_MC\SubCode\SLIC.cpp
文件 20480 2013-04-05 18:32 code_absorb_MC\SubCode\SLIC.mexw32
文件 32768 2013-04-06 11:48 code_absorb_MC\SubCode\SLIC.mexw64
文件 568 2013-04-05 20:06 code_absorb_MC\SubCode\sup2pixel.cpp
文件 7680 2013-04-05 20:17 code_absorb_MC\SubCode\sup2pixel.mexw32
文件 7168 2013-04-06 11:48 code_absorb_MC\SubCode\sup2pixel.mexw64
目录 0 2013-10-02 11:58 code_absorb_MC\img
目录 0 2013-10-02 12:11 code_absorb_MC\SubCode
目录 0 2013-10-02 12:05 code_absorb_MC
----------- --------- ---------- ----- ----
187186 17
相关资源
- Saliency Detection with Multi-Scale Superpixel
- mmdetection-中文文档(自己翻译).pdf
-
ob
ject Detection 目标检测 思维导图 - Facedetectionfacerecognitiondataset.txt
- SVM+HOG+LBP
- Dynamic_Data_Race_Detection
- Louvain快速社区发现算法Fast unfolding算
- Rapid detection of virulent factors of Aeromon
- The assembly of a novel enzyme biosensor for a
- Detection Estimation and Modulation Theory Par
- Early detection in urinary proteome for the ef
- Implication of urinary KIM-1 mRNA detection in
- 虚假新闻检测的自然语言处理研究综
-
ba
sed.Radar.Detection.Tracking.And.Classifi - Learning Rich Features for Image Manipulation
- Quickest Detection_H. Vincent Poor(2008)
- deep learning for anomaly detection a survey(深
- ship detection
- 基于内容的视频镜头检测
-
Mimicking Very Efficient Network for ob
ject - CNM社团检测算法
评论
共有 条评论