图像显著性MR方法的matlab代码
标签:
•
文件类型: .rar
•
文件大小: 2.34MB
•
下载次数: 1
•
图像显著性matlab代码,将所需要检测的图像放到test文件夹中,灰度图像,然后运行demo.m即可
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2754857 2016-09-12 05:27 saliency2013CVPR_Saliency Detection via Graph-based Manifold Ranking.pdf
文件 5186 2018-04-29 21:13 saliencydemo.m
文件 8600 2016-11-11 03:18 saliencydemo_annotated.m
文件 13868 2018-10-25 10:26 saliencyhideimg.jpg
文件 1082 2018-10-29 22:48 saliencylena1-2.png
文件 1067 2018-10-29 22:48 saliencylena1.png
文件 7516 2018-10-25 11:01 saliencylenalena-2.png
文件 7402 2018-10-25 11:01 saliencylenaLENA.png
文件 291582 2018-10-25 10:26 saliencymsg.txt
文件 2101 2015-10-26 12:54 saliencyothersadjacency.m
文件 1052 2015-10-26 12:54 saliencyothersAdjcProcloop.m
文件 14019 2015-10-26 12:54 saliencyotherscolorspace.m
文件 215 2015-10-26 12:54 saliencyothersmakeweights.m
文件 2365 2015-10-26 12:54 saliencyothers
ormalize.m
文件 441 2015-10-26 12:54 saliencyothersReadDAT.m
文件 1300 2018-10-29 22:48 saliencyothers
emoveframe.m
文件 31 2018-10-25 10:26 saliencypsnr.txt
文件 1924 2015-10-26 12:54 saliency
eadme.txt
文件 1104 2018-10-30 15:21 saliencysaliencymap2.png
文件 1108 2018-10-30 15:21 saliencysaliencymap2_stage1.png
文件 1110 2018-10-30 15:21 saliencysaliencymap3.png
文件 1100 2018-10-30 15:21 saliencysaliencymap3_stage1.png
文件 1061 2018-10-30 15:21 saliencysaliencymap4.png
文件 1082 2018-10-30 15:21 saliencysaliencymap4_stage1.png
文件 1091 2018-10-30 15:21 saliencysaliencymap5.png
文件 1100 2018-10-30 15:21 saliencysaliencymap5_stage1.png
文件 996 2018-10-30 15:21 saliencysaliencymap6.png
文件 1094 2018-10-30 15:21 saliencysaliencymap6_stage1.png
文件 950 2018-10-30 15:21 saliencysaliencymap8.png
文件 760 2018-10-30 15:21 saliencysaliencymap8_stage1.png
............此处省略36个文件信息
% Demo for paper “Saliency Detection via Graph-based Manifold Ranking“
% by Chuan Yang Lihe Zhang Huchuan Lu Ming-Hsuan Yang and Xiang Ruan
% To appear in Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2013) Portland June 2013.
clear all;
tic
addpath(‘./others/‘);
%%------------------------set parameters---------------------%%
theta=10; % control the edge weight
alpha=0.99;% control the balance of two items in manifold ranking cost function
spnumber=200;% superpixel number
imgRoot=‘./test/‘;% test image path
saldir=‘./saliencymap/‘;% the output path of the saliency map
supdir=‘./superpixels/‘;% the superpixel label file path
mkdir(supdir);
mkdir(saldir);
imnames=dir([imgRoot ‘*‘ ‘jpg‘]);
for ii=1:length(imnames)
disp(ii);
imname=[imgRoot imnames(ii).name];
[input_imw]=removeframe(imname);% run a pre-processing to remove the image frame
[mnk] = size(input_im);
%%----------------------generate superpixels--------------------%%
imname=[imname(1:end-4) ‘.bmp‘];% the slic software support only the ‘.bmp‘ image
comm=[‘SLICSuperpixelSegmentation‘ ‘ ‘ imname ‘ ‘ int2str(20) ‘ ‘ int2str(spnumber) ‘ ‘ supdir];
system(comm);
spname=[supdir imnames(ii).name(1:end-4) ‘.dat‘];
superpixels=ReadDAT([mn]spname); % superpixel label matrix
spnum=max(superpixels(:));% the actual superpixel number
%%----------------------design the graph model--------------------------%%
% compute the feature (mean color in lab color space)
% for each node (superpixels)
input_vals=reshape(input_im m*n k);
rgb_vals=zeros(spnum13);
inds=cell(spnum1);
for i=1:spnum
inds{i}=find(superpixels==i);
rgb_vals(i1:)=mean(input_vals(inds{i}:)1);
end
lab_vals = colorspace(‘Lab<-‘ rgb_vals);
seg_vals=reshape(lab_valsspnum3);% feature for each superpixel
% get edges
adjloop=AdjcProcloop(superpixelsspnum);
edges=[];
for i=1:spnum
indext=[];
ind=find(adjloop(i:)==1);
for j=1:length(ind)
indj=find(adjloop(ind(j):)==1);
indext=[indextindj];
end
indext=[indextind];
indext=indext((indext>i));
indext=unique(indext);
if(~isempty(indext))
ed=ones(length(indext)2);
ed(:2)=i*ed(:2);
ed(:1)=indext;
edges=[edges;ed];
end
end
% compute affinity matrix
weights = makeweights(edgesseg_valstheta);
W = adjacency(edgesweightsspnum);
% learn the optimal affinity matrix (eq. 3 in paper)
dd = sum(W); D = sparse(1:spnum1:spnumdd); clear dd;
optAff =(D-alpha*W)eye(spnum);
mz=diag(ones(spnum1));
mz=~mz;
optAff=optAff.*mz;
%%-----------------------------stage 1--------------------------%%
% compute the saliency value for each superpixel
% with the top boundary as the query
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2754857 2016-09-12 05:27 saliency2013CVPR_Saliency Detection via Graph-ba
文件 5186 2018-04-29 21:13 saliencydemo.m
文件 8600 2016-11-11 03:18 saliencydemo_annotated.m
文件 13868 2018-10-25 10:26 saliencyhideimg.jpg
文件 1082 2018-10-29 22:48 saliencylena1-2.png
文件 1067 2018-10-29 22:48 saliencylena1.png
文件 7516 2018-10-25 11:01 saliencylenalena-2.png
文件 7402 2018-10-25 11:01 saliencylenaLENA.png
文件 291582 2018-10-25 10:26 saliencymsg.txt
文件 2101 2015-10-26 12:54 saliencyothersadjacency.m
文件 1052 2015-10-26 12:54 saliencyothersAdjcProcloop.m
文件 14019 2015-10-26 12:54 saliencyotherscolorspace.m
文件 215 2015-10-26 12:54 saliencyothersmakeweights.m
文件 2365 2015-10-26 12:54 saliencyothers
ormalize.m
文件 441 2015-10-26 12:54 saliencyothersReadDAT.m
文件 1300 2018-10-29 22:48 saliencyothers
emovefr
文件 31 2018-10-25 10:26 saliencypsnr.txt
文件 1924 2015-10-26 12:54 saliency
eadme.txt
文件 1104 2018-10-30 15:21 saliencysaliencymap2.png
文件 1108 2018-10-30 15:21 saliencysaliencymap2_stage1.png
文件 1110 2018-10-30 15:21 saliencysaliencymap3.png
文件 1100 2018-10-30 15:21 saliencysaliencymap3_stage1.png
文件 1061 2018-10-30 15:21 saliencysaliencymap4.png
文件 1082 2018-10-30 15:21 saliencysaliencymap4_stage1.png
文件 1091 2018-10-30 15:21 saliencysaliencymap5.png
文件 1100 2018-10-30 15:21 saliencysaliencymap5_stage1.png
文件 996 2018-10-30 15:21 saliencysaliencymap6.png
文件 1094 2018-10-30 15:21 saliencysaliencymap6_stage1.png
文件 950 2018-10-30 15:21 saliencysaliencymap8.png
文件 760 2018-10-30 15:21 saliencysaliencymap8_stage1.png
............此处省略36个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)