资源简介
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
相关资源
- Face Detection and Recognition: Theory and Pra
- plant Leaf Disease Detection 植物叶片病害识
- Real-Time Collision Detection实时碰撞检测算
- Fault Detection and Diagnosis in Industrial Sy
- unity语音识别Word Detection
- Pedestrian_detection_in_infrared_images.pdf
-
Single-Shot Refinement Neural Network for ob
- Image Analysis Classification and Change Detec
- Real-Time Collision Detection
-
You Only Look Once Unified Real-Time ob
ject - A Computational Approach to Edge Detection
- Image Analysis Classification and Change Detec
- An Introduction to Signal Detection and Estima
-
ob
ject Detection in 20 Years A Survey总结汇 - Steven Kay信号检测与估计两卷Detection和
-
Robust Real-time ob
ject Detection 论文 整理 - [2011 IROS]People detection in RGB-D data
-
[2010 PAMI] ob
ject Detection with Discrimin - Long Short Term Memory Networks for Anomaly De
- FaceDetection人脸识别系统源代码
- Aggregate Channel Features for Multi-view Face
- Signal Detection And Estimation - Solution Man
- Saliency Filters的实现
- Context-Aware Saliency Detection论文和源代码
- crack detection
- MTCNN_face_detection_alignment.zip
- Scale-space and edge detection using anisotrop
- Fundamentals of Statistical Signal ProcessingV
- Blind Copy-Paste Detection Using SIFT Ring Des
- 安卓原生FaceDetection人脸识别
评论
共有 条评论