【显著图】基于多尺度图结构实现显著图计算附matlab源码

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代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值