资源简介
图像视觉显著性检测算法在分析图像内容的过程中,引入了视觉特性,大大提高了
计算机对图像内容的理解程度,推进了图像处理技术的发展。在各种图像处理技术中,
计算机所关注的并不是图像的全部内容,而是一部分感兴趣区域或者非感兴趣区域。通
过视觉显著性检测算法去检测图像的显著区域,并给予不同区域不同的处理优先级,从
而更好的利用计算资源,提高计算效率。
代码片段和文件信息
% 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;
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
Yt=ze
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5123 2013-04-06 11:11 cvprcode\demo.m
文件 2101 2003-08-22 05:43 cvprcode\others\adjacency.m
文件 1052 2013-04-03 16:31 cvprcode\others\AdjcProcloop.m
文件 14019 2006-08-13 18:29 cvprcode\others\colorspace.m
文件 215 2013-03-05 19:16 cvprcode\others\makeweights.m
文件 2365 2003-08-22 05:43 cvprcode\others\normalize.m
文件 441 2013-03-05 18:58 cvprcode\others\ReadDAT.m
文件 1256 2013-03-28 20:17 cvprcode\others\removefr
文件 1924 2013-04-03 17:48 cvprcode\readme.txt
文件 192512 2012-11-28 16:12 cvprcode\SLICSuperpixelSegmentation.exe
目录 0 2013-03-27 16:13 cvprcode\others
目录 0 2013-03-29 13:10 cvprcode\test
目录 0 2013-04-06 11:13 cvprcode
----------- --------- ---------- ----- ----
221008 13
- 上一篇:单端反激式开关电源原理与设计
- 下一篇:基于GIS的大气污染物扩散模拟分析系统
评论
共有 条评论