步骤1:先定义KLdiv函数:

function score = KLdiv(saliencyMap, fixationMap)
% saliencyMap is the saliency map
% fixationMap is the human fixation map map1 = im2double(imresize(saliencyMap, size(fixationMap)));
map2 = im2double(fixationMap); % make sure map1 and map2 sum to 1
if any(map1(:))
map1 = map1/sum(map1(:));
end if any(map2(:))
map2 = map2/sum(map2(:));
end % compute KL-divergence
score = sum(sum(map2 .* log(eps + map2./(map1+eps))));

  步骤2:再写一个主函数调用它:

clear;
clc;
smap_path='E:\Dataset180303\final_data\smap_Result1\';
gmap_path='E:\Dataset180303\final_data\image_resize_gt\';
smap_file=dir(smap_path); for j=3:length(smap_file)
disp(j-2);
gmap_name=strcat(gmap_path,num2str(j-2), '.jpg');
% gmap_name=strcat(gmap_path,smap_file(j).name);
smap_name=strcat(smap_path,num2str(j-2+ 0 ), '.jpg');
% smap_name=strcat(smap_path,num2str(j-2+ 0 ), '_SaliencyMap', '.jpg');
gmap=imresize(imread(gmap_name), [224, 224], 'bicubic');
smap=imresize(imread(smap_name), [224, 224], 'bicubic');
sal_map=mat2gray(smap);
if gmap==0
continue;
end if size(gmap,3)==3
gt_final_map=rgb2gray(gmap);
else
gt_final_map = gmap;
end
sal_map=imresize(sal_map,0.5);
gt_final_map=imresize(gt_final_map,0.5); threshold_value = graythresh(gt_final_map);
gt_final_map_bin = im2bw(gt_final_map, threshold_value);
c = KLdiv(sal_map, gt_final_map);
idx=find(isnan(c));
c(idx)=0.5;
c = abs(c);
a(j-2,1)=mean(c);
end
% b(i-2,1)=mean(a);
% clear a;
% end
KLdiv = mean(a);

  

显著性检测(saliency detection)评价指标之KL散度距离Matlab代码实现的更多相关文章

  1. 显著性检测(saliency detection)评价指标之sAUC(shuffled AUC)的Matlab代码实现

    AUC_shuffled.m function [score,tp,fp] = AUC_shuffled(saliencyMap, fixationMap, otherMap, Nsplits, st ...

  2. 显著性检测(saliency detection)评价指标之NSS的Matlab代码实现

    calcNSSscore.m function [ score ] = calcNSSscore( salMap, eyeMap ) %calcNSSscore Calculate NSS score ...

  3. 视觉显著性简介 Saliency Detection

    内容转移到博客文章系列:显著性检测 1.简介 视觉显著性包括从下而上和从上往下两种机制.从下而上也可以认为是数据驱动,即图像本身对人的吸引,从上而下则是在人意识控制下对图像进行注意.科研主要做的是从下 ...

  4. paper 22:kl-divergence(KL散度)实现代码

    这个函数很重要: function KL = kldiv(varValue,pVect1,pVect2,varargin) %KLDIV Kullback-Leibler or Jensen-Shan ...

  5. paper 27 :图像/视觉显著性检测技术发展情况梳理(Saliency Detection、Visual Attention)

    1. 早期C. Koch与S. Ullman的研究工作. 他们提出了非常有影响力的生物启发模型. C. Koch and S. Ullman . Shifts in selective visual ...

  6. 视觉显著性检测(Visual saliency detection)相关概念

    视觉显著性检测(Visual saliency detection)指通过智能算法模拟人的视觉特点,提取图像中的显著区域(即人类感兴趣的区域). 视觉注意机制(Visual Attention Mec ...

  7. (不断更新)关于显著性检测的调研-Salient Object Detection: A Survey

    <Salient Object Detection: A Survey>作者:Ali Borji.Ming-Ming Cheng.Huaizu Jiang and Jia Li 基本按照文 ...

  8. 视频显著性检测-----Predicting Video Saliency using Object-to-Motion CNN and Two-layer Convolutional LSTM

    帧内显著性检测: 将卷积网络的多层特征进行组合通过unsampling 得到粗显著性预测: 帧间显著性检测: (粗检测结果+新卷积网络的特征图,最后+之前卷积网络的卷积特征输入到LSTM中)进行预测. ...

  9. {Links}{Matting}{Saliency Detection}{Superpixel}Source links

    自然图像抠图/视频抠像技术发展情况梳理(image matting, alpha matting, video matting)--计算机视觉专题1 http://blog.csdn.net/ansh ...

随机推荐

  1. 刚收到一个吃瓜群众看了肯定不信的offer!

    我教过了很多学生了,有的毕业后跟我依然保持联系,有的不知所踪,有的越混越好,有的没有什么变化,这让我不断思考,到底拉开人与人之间差距的是什么呢?

  2. 【转】地球坐标系 (WGS-84) 到火星坐标系 (GCJ-02) 的转换算法

    // // Copyright (C) 1000 - 9999 Somebody Anonymous // NO WARRANTY OR GUARANTEE // using System; name ...

  3. SAE提供服务分析

    这个分析列表主要关注两个问题,服务能做什么,移植实现难度. AppConfig: 这个东西主要面向SAE本身的一些配置选项,移植时放弃这个东西,所以就不谈难度了Counter :这个东西提供某个操作的 ...

  4. Amazing iOS Tips

    先开个题,慢慢加内容: 准备参考的资料 https://github.com/Aufree/trip-to-iOS       https://github.com/vsouza/awesome-io ...

  5. 关于SpringMVC控制器的一点补充

    首先复习一下之前控制器的写法:http://www.cnblogs.com/eco-just/p/7882016.html. 我们可以看到,之前的写法是这样的: @RequestMapping(&qu ...

  6. CSS样式渐变代码,兼容IE8

    background: -webkit-linear-gradient(top,#ffffff,#f5f5f5); background: -moz-linear-gradient(top,#ffff ...

  7. git命令行常用几个指令(细节问题)

    GIT PUSH/PULL时总需要输入用户名密码的解决方案: git config --global credential.helper store 查看当前的配置信息: git config --s ...

  8. Java容器:Map

    1. Map概述 1.1. Map类的继承关系 1.2. 几个Map接口类概念 1.3. Map类的通用方法 2. HashMap 2.1. 构造函数 2.2. 数据结构 2.3. 存储实现 3. H ...

  9. TensorFlow-谷歌深度学习库 命令行参数

    程序的入口: tf.app.run tf.app.run( main=None, argv=None ) 运行程序,可以提供'main'函数以及函数参数列表.处理flag解析然后执行main函数. 什 ...

  10. Android开发学习总结(三)——appcompat_v7项目说明

    一.appcompat_v7项目说明 今天来说一下appcompat_v7项目的问题,使用eclipse创建Android项目时,发现project列表中会多创建出一个appcompat_v7项目,这 ...