資源簡介
論文題目:Graph-regularized Saliency Detection with Convex-hull-based Center Prior

代碼片段和文件信息
%?demo?code?for?paper?“Graph-regularized?Saliency?Detection?with?Convex-hull-based?Center?Prior“?
%?written?by?chuan?yang
%?email:?ycscience86@gmail.com
clear?all;
%%?paramter
deltaw=0.05;?%%?controal?edge?weight?
spnumber=200;%%?superpixels?number
deltap=0.2;
deltax=0.15;
deltay=0.15;
lamda=25;
%convex?hull?paramter
sigma_g=1.5;
sigma_a=5;
nPoints=30;
%
imgRoot=‘./test/‘;%%?test?image?dir
outdir=‘./saliencymaps/‘;%%?the?output?saliency?map?saving?dir
supdir=‘./superpixels200/‘;%%?the?superpixels?files?saving?dir
mkdir(supdir);
mkdir(outdir);
imnames=dir([imgRoot?‘*‘?‘jpg‘]);
addpath(‘./others/‘);
addpath(‘./ColorFeatures/‘);
for?ii=1:length(imnames);
??
????ii
????imname=[imgRoot?imnames(ii).name];?
????input_im=imread(imname);?
????outname=[imgRoot?imnames(ii).name(1:end-4)?‘.bmp‘];
????imwrite(input_imoutname);
????input_im=im2double(input_im);
????[mnz]?=?size(input_im);
????
%%?generate?superpixels
????comm=[‘SLICSuperpixelSegmentation‘?‘?‘?outname?‘?‘?int2str(20)?‘?‘?int2str(spnumber)?‘?‘?supdir];
????system(comm);????
????spname=[supdir?imnames(ii).name(1:end-4)??‘.dat‘];
????superpixels=ReadDAT([mn]spname);
????spnum=max(max(superpixels));???
??
%%?initial?saliency?map
????%?compute?convex?hull
????Mboost?=?BoostMatrix(input_im);
????boost_im=?BoostImage(input_imMboost);
????[EnIm]=?ColorHarris(boost_imsigma_gsigma_a0.041);
????[x_maxy_maxcorner_im2num_max]=getmaxpoints(EnImnPoints);
????[xy]=find(corner_im2>0);
????point=[xy];
????point=point(point(:1)>20:);
????point=point(point(:1) ????point=point(point(:2)>20:);
????point=point(point(:2) ????x=point(:1);
????y=point(:2);
????dis=zeros(length(x)1);
????for?i=1:length(x)
????????dis(i)=0;
????????for?j=1:length(x)
????????????dis(i)=dis(i)+sqrt((x(i)-x(j))^2+(y(i)-y(j))^2);
????????end
????????dis(i)=dis(i)/length(x);
????end
????[mdmind]=sort(dis);clear?dis;
????point=point(mind(1:length(x)-2):);
????dt?=?DelaunayTri(point(:2)point(:1));
????k?=?convexHull(dt);
????[XY]?=?meshgrid(1:n1:m);
????Xl=reshape(X[m*n1]);
????Yl=reshape(Y[m*n1]);
????sI=pointLocation(dtXlYl);
????mask?=?~isnan(sI);????
????mask=reshape(maskmn);?
?
????%?compute?convex-hull-based?center?
????STATS?=?regionprops(mask‘Centroid‘);
????center(2)?=?STATS(length(STATS)).Centroid(1);
????center(1)=STATS(length(STATS)).Centroid(2);
????center(1)=center(1)/m;
????center(2)=center(2)/n;
????
????%?convex-hull-based?center?prior??
????inds=cell(spnum1);
????input_vals=reshape(input_im?m*n?z);
????rgb_img=zeros(spnum13);
????location_vals=zeros(spnum2);
????sup_center_prior=zeros(spnum1);
????for?i=1:spnum
????????inds{i}=find(superpixels==i);
????????rgb_img(i1:)=mean(input_vals(inds{i}:)1);
????????[mmnn]=ind2sub(size(superpixels)inds{i});
????????location_vals(i1)=mean(mm/m);
????????location_vals(i2)=mean(nn/n);
????????sup_center_prior(i)=exp(-((location_vals(i1)-center(1))^2/(2*deltax)+(location_vals(i2)-center(2))^2/(2*deltay)));
????end??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-29?17:57??GR\
?????目錄???????????0??2018-05-29?16:42??GR\ColorFeatures\
?????文件?????????399??2016-01-07?07:59??GR\ColorFeatures\BoostImage.m
?????文件????????2809??2016-01-07?07:59??GR\ColorFeatures\BoostMatrix.m
?????文件????????1724??2016-01-07?07:59??GR\ColorFeatures\ColorHarris.m
?????文件????????1093??2016-01-07?07:59??GR\ColorFeatures\ColorStructureTensor.m
?????文件?????????390??2016-01-07?07:59??GR\ColorFeatures\ColorStructureTensor2.m
?????文件????????1713??2016-01-07?07:59??GR\ColorFeatures\HSI_der.m
?????文件?????????242??2016-01-07?07:59??GR\ColorFeatures\O2RGB.m
?????文件?????????430??2016-01-07?07:59??GR\ColorFeatures\RGB2O.m
?????文件?????????103??2016-01-07?07:59??GR\ColorFeatures\RGB2luminance.m
?????文件????????1724??2016-01-07?07:59??GR\ColorFeatures\canny.m
?????文件????????3139??2016-01-07?07:59??GR\ColorFeatures\color_canny.m
?????文件?????????338??2016-01-07?07:59??GR\ColorFeatures\color_gradient.m
?????文件????????2047??2016-01-07?07:59??GR\ColorFeatures\demo_color_canny.m
?????文件????????2276??2016-01-07?07:59??GR\ColorFeatures\demo_color_harris.m
?????文件????????2014??2016-01-07?07:59??GR\ColorFeatures\demo_quasi_invariant_edges.m
?????文件?????????303??2016-01-07?07:59??GR\ColorFeatures\dilation33.m
?????文件????????1112??2016-01-07?07:59??GR\ColorFeatures\fill_border.m
?????文件?????????974??2016-01-07?07:59??GR\ColorFeatures\gDer.m
?????文件?????????722??2016-01-07?07:59??GR\ColorFeatures\getmaxpoints.m
?????文件?????????102??2016-01-07?07:59??GR\ColorFeatures\make_image.m
?????文件????????1247??2016-01-07?07:59??GR\ColorFeatures\opponent_der.m
?????文件????????1887??2016-01-07?07:59??GR\ColorFeatures\spherical_der.m
?????文件????????3143??2016-01-07?07:59??GR\ColorFeatures\star_sym_color.m
?????文件?????????327??2016-01-07?07:59??GR\ColorFeatures\visualize_corners.m
?????文件????????3696??2016-01-07?07:59??GR\GetGR.m
?????文件????????1133??2016-01-07?07:59??GR\README.md
?????文件??????192512??2016-01-07?07:59??GR\SLICSuperpixelSegmentation.exe
?????文件?????????720??2016-01-07?07:59??GR\SlicSupPixel.m
?????文件????????4280??2016-01-07?07:59??GR\demo.m
............此處省略28個文件信息
- 上一篇:顯著性檢測COV算法--MATLAB
- 下一篇:Matlab完整版車牌定位識別
評論
共有 條評論