步骤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. C#中的var和dynamic

    在理解var和dynamic关键字之前,让我们先了解一下编程语言的类别. C#中有两类编程语言: 静态类型语言类别 动态语言类别 静态类型语言 静态类型语言也被称为强类型语言.所谓强类型语言,通俗的讲 ...

  2. lua函数随记

    在大多数Lua语法分析中可以获得这些标准Lua函数. 无可争辩, 我们可以查阅Lua网站, 但是一些少了的函数被Blizzard进行了调整. 下面列出了所有Lua函数. WoW API中的Lua注意在 ...

  3. mac port 清理

    http://popozhu.github.io/2014/10/27/mac-port-%E6%B8%85%E7%90%86/ 使用 mac port 来安装一些软件,时间久了后(也有两年多),更新 ...

  4. C#WebService 出现No 'Access-Control-Allow-Origin' header is present on the requested resource

    C#WebService 出现No 'Access-Control-Allow-Origin' header is present on the requested resource 解决办法: 在c ...

  5. nodejs环境 + 入门 + 博客搭建

    NodeJS:NodeJS是一个使用了Google高性能V8 引擎 的服务器端JavaScript实现.它提供了一个(几乎)完全非阻塞I/O栈,与JavaScript提供的闭包和匿名函数相结合,使之成 ...

  6. css那些事(一)

    一.内边框padding和外边框margin属性缩写 内外边框有四个属性:padding-top,padding-right,padding-bottom,padding-left;margin-to ...

  7. Centos6离线安装MySQL5.5.55-1(附带安装包及Perl依赖包)

    资源包下载https://pan.baidu.com/s/1U3myYp4GSmDUfZocMWI9FA 密码:xdac 资源包所带有的资源截图 1.上传MySQL-client-5.5.55-1.l ...

  8. 树莓派配置watchdog

    安装watchdog apt install watchdog 编辑/etc/modules,添加bcm2708_wdog 编辑/etc/watchdog.conf watchdog-device = ...

  9. Python并发编程之线程消息通信机制任务协调(四)

    大家好,并发编程 进入第四篇. 本文目录 前言 Event事件 Condition Queue队列 总结 . 前言 前面我已经向大家介绍了,如何使用创建线程,启动线程.相信大家都会有这样一个想法,线程 ...

  10. python_选择结构

    >>> if 3>2:print('ok') ok>>> if True:print(3);print(5) >>> chTesst=['1 ...