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

简介: 【显著图】基于多尺度图结构实现显著图计算附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代码问题可私信交流。

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


相关文章
|
2月前
|
编解码
MATLAB | 科研绘图第十一期动态趋势图
MATLAB | 科研绘图第十一期动态趋势图
27 0
|
2月前
|
存储 编解码
MATLAB | 科研绘图第十八期散点密度图
MATLAB | 科研绘图第十八期散点密度图
59 0
|
4月前
|
算法 计算机视觉 异构计算
基于FPGA的图像PSNR质量评估计算实现,包含testbench和MATLAB辅助验证程序
基于FPGA的图像PSNR质量评估计算实现,包含testbench和MATLAB辅助验证程序
|
2月前
|
存储 编解码
MATLAB | 科研绘图第十九期散点密度图强化版
MATLAB | 科研绘图第十九期散点密度图强化版
37 0
|
2月前
|
编解码
MATLAB | 科研绘图第二十三期箭头图
MATLAB | 科研绘图第二十三期箭头图
33 0
|
5月前
|
计算机视觉
专题七MATLAB符号计算-2
专题七MATLAB符号计算
37 0
|
5月前
专题七MATLAB符号计算-1
专题七MATLAB符号计算
39 0
|
7月前
|
机器学习/深度学习 传感器 算法
【特征提取】语音信号端点检测+倒谱法+自相关法特征提取附Matlab源码
【特征提取】语音信号端点检测+倒谱法+自相关法特征提取附Matlab源码
|
9天前
|
Shell
MATLAB 求解特征方程的根轨迹图稳定性分析
MATLAB 求解特征方程的根轨迹图稳定性分析
12 0
|
10天前
|
传感器 存储 数据库
matlab测量计算信号的相似度
matlab测量计算信号的相似度
14 0

热门文章

最新文章