1 简介
In the fifield of saliency detection, many graph-based algorithms use boundary pixels as background seeds to estimate the background and foreground saliency,which leads to signifificant errors in some of pictures. In addition, local context with high contrast will mislead the algorithms. In this paper, we propose a novel multilevel bottom-up saliency detection
approach that accurately utilizes the boundary information and takes advantage of both region based features and local image details. To provide more accurate saliency estimations, we build a three-level graph model to capture both region-based features and local image details. By
using superpixels of all four boundaries, we fifirst roughly fifigure out the foreground superpixels.After calculating the RGB distances between the average of foreground superpixels and every boundary superpixel, we discard the boundary superpixels with the longest distance to get a set of accurate background boundary queries. Finally, we propose the regularized random walks ranking to formulate pixel-wise saliency maps. Experiment results on two public datasets indicate the signifificantly promoted accuracy and robustness of our proposed algorithm in comparison with
7 state-of-the-art saliency detection approaches.
2 部分代码
clear allclcclose all%% Initializationaddpath(genpath('./support/'));IMG_DIR = './TestData/data/';% Original image pathSAL_DIR='./TestData/solution/' ;% Output path of the saliency mapif ~exist(SAL_DIR, 'dir') mkdir(SAL_DIR);endimglist=dir([IMG_DIR '*' 'jpg']);%% Algorithm startfor imgno=1:length(imglist) % Load input image disp(imgno); disp(imglist(imgno).name); % Calculate saliency imgnamein=imglist(imgno).name; spn = 200; spnb = 24; itheta = 10; alpha = 0.99; % Step 1 & 2: Saliency Estimation imgname = [IMG_DIR, imgnamein(1:end-4) '.jpg']; imgbmpname = strcat(imgname(1:(end-4)), '.bmp'); [img, wid] = removeframe(imgname); img = uint8(img*255); w=fspecial('gaussian',[5,5],15); img2=imfilter(img,w);%%%%%%%%%%%1st gaussian w=fspecial('gaussian',[55,55],15); img3=imfilter(img,w);%%%%%%%%%%%2st gaussian [m, n, ~] = size(img); comm = ['SLIC_SUPPORT' ' ' imgbmpname ' ' int2str(2) ' ' int2str(spn) ' ']; evalc('system(comm)'); spname = [imgbmpname(1:end-4) '.dat']; superpixels = ReadDAT([m,n], spname); spno = max(superpixels(:)); [salest,W] = Msalestimation(img, superpixels, spno, itheta, alpha,img2,img3); salest= (salest-min(salest))/(max(salest)-min(salest)); map=superpixels; for i=1:spno map(map==i)=salest(i); end map1=reshape(map',n*m,1); % Step 3: regularized random walk ranking salest=salest(1:spno,1); th1 = (mean(salest) + max(salest)) / 2; th2 = mean(salest); mu = (1-alpha) / alpha; [seeds, label] = seed4rw(salest, th1, th2); [P] = myrrwr(m,n,img,itheta,superpixels,seeds,label,salest,spno,mu); sal = P(:,1); salmean = (sal+map1)/2; sal = (salmean-min(salmean(:)))/(max(salmean(:))-min(salmean(:))); sal=reshape(sal,n,m)'; saloutput = zeros(wid(1),wid(2)); saloutput(wid(3):wid(4),wid(5):wid(6)) = sal; saloutput = uint8(saloutput*255); saliency=saloutput; % Output saliency map to file imwrite(saliency, [SAL_DIR, imglist(imgno).name(1:end-4), '_Saliency.png']); salest=salest(1:spno,1); th1 = (mean(salest) + max(salest)) / 2; th2 = mean(salest); mu = (1-alpha) / alpha; [seeds, label] = seed4rw(salest, th1, th2); [~, probabilities] = rrwr(img, superpixels, salest, seeds, label, mu); sal = probabilities(:,:,1); sal = (sal-min(sal(:)))/(max(sal(:))-min(sal(:))); saloutput = zeros(wid(1),wid(2)); saloutput(wid(3):wid(4),wid(5):wid(6)) = sal; saloutput = uint8(saloutput*255); saliency=saloutput; % Output saliency map to file figure subplot(121); imshow(img); title('原图') subplot(122); imshow(saliency) ; title('显著图') imwrite(saliency, [SAL_DIR, imglist(imgno).name(1:end-4), '_SaliencyOld.png']); % imwrite(map, [SAL_DIR, imglist(imgno).name(1:end-4), '_sal锟洁级BB.png']); clearvars -except IMG_DIR SAL_DIR imglist imgnoend
3 仿真结果
4 参考文献
[1]Hao, Aimin, Shuai, et al. Structure-Sensitive Saliency Detection via Multilevel Rank Analysis in Intrinsic Feature Space[J]. IEEE Transactions on Image Processing, 2015, 24(8):2303-2316.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。