显著性检测(saliency detection)评价指标之KL散度距离Matlab代码实现
步骤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代码实现的更多相关文章
- 显著性检测(saliency detection)评价指标之sAUC(shuffled AUC)的Matlab代码实现
AUC_shuffled.m function [score,tp,fp] = AUC_shuffled(saliencyMap, fixationMap, otherMap, Nsplits, st ...
- 显著性检测(saliency detection)评价指标之NSS的Matlab代码实现
calcNSSscore.m function [ score ] = calcNSSscore( salMap, eyeMap ) %calcNSSscore Calculate NSS score ...
- 视觉显著性简介 Saliency Detection
内容转移到博客文章系列:显著性检测 1.简介 视觉显著性包括从下而上和从上往下两种机制.从下而上也可以认为是数据驱动,即图像本身对人的吸引,从上而下则是在人意识控制下对图像进行注意.科研主要做的是从下 ...
- paper 22:kl-divergence(KL散度)实现代码
这个函数很重要: function KL = kldiv(varValue,pVect1,pVect2,varargin) %KLDIV Kullback-Leibler or Jensen-Shan ...
- paper 27 :图像/视觉显著性检测技术发展情况梳理(Saliency Detection、Visual Attention)
1. 早期C. Koch与S. Ullman的研究工作. 他们提出了非常有影响力的生物启发模型. C. Koch and S. Ullman . Shifts in selective visual ...
- 视觉显著性检测(Visual saliency detection)相关概念
视觉显著性检测(Visual saliency detection)指通过智能算法模拟人的视觉特点,提取图像中的显著区域(即人类感兴趣的区域). 视觉注意机制(Visual Attention Mec ...
- (不断更新)关于显著性检测的调研-Salient Object Detection: A Survey
<Salient Object Detection: A Survey>作者:Ali Borji.Ming-Ming Cheng.Huaizu Jiang and Jia Li 基本按照文 ...
- 视频显著性检测-----Predicting Video Saliency using Object-to-Motion CNN and Two-layer Convolutional LSTM
帧内显著性检测: 将卷积网络的多层特征进行组合通过unsampling 得到粗显著性预测: 帧间显著性检测: (粗检测结果+新卷积网络的特征图,最后+之前卷积网络的卷积特征输入到LSTM中)进行预测. ...
- {Links}{Matting}{Saliency Detection}{Superpixel}Source links
自然图像抠图/视频抠像技术发展情况梳理(image matting, alpha matting, video matting)--计算机视觉专题1 http://blog.csdn.net/ansh ...
随机推荐
- 春天aopframework实现
Java的代码 包 cn.itcast.day3.aopframework; 进口 java.io.IOException的; 进口 的java.io.InputStream; 进口 java.u ...
- 信息化建设中的IT规划精要
IT规划在信息化建设中发挥着"定位"和"导航"的作用,IT规划理论方法更是博大精深,细细讲来,会成为IT版本的"一千零一夜".因此,本文以& ...
- Greenplum测试部署笔记
按照官方Readme文档在Ubunut16.04上成功编译安装Greenplum最新代码(now:2017-11-12 21:40) 按照文档安装的过程中主要出现两个问题: 1.Root用户安装会卡在 ...
- 使用commons-compress操作zip文件(压缩和解压缩)
http://www.cnblogs.com/luxh/archive/2012/06/28/2568758.html Apache Commons Compress是一个压缩.解压缩文件的类库. 可 ...
- mysql distinct field1,field2,field3, .... from table
mysql distinct field1,field2,field3, .... from table 我们知道 这样的sql可以去掉重复项 (field1的重复项); select distinc ...
- codeforces——961B. Lecture Sleep
本文为博主原创文章,未经允许不得转载. 我在csdn也同步发布了此文,链接 https://blog.csdn.net/umbrellalalalala/article/details/7989196 ...
- ORACLE 数据库选择性导出表中数据&导入已存在表数据
在dos界面下选择性导出表中的数据语句为: exp his/linker@orcl tables=(sysreprot) file="D:\20131218.dmp" query= ...
- Selenium2Lib库之输入常用关键字实战
4.1 Input Text关键字 按F5 查看Input Text关键字的说明,如下图: Input Text 关键字用于向文本框输入内容,需要传2个参数(文本框的元素定位和输入的值). 项目例子: ...
- javase---string类介绍01
一.String类简介 java.lang.String类用于描述一个字符序列.String类是不可变对象的类.其对象一旦被创建,永远无法改变.但是对象的引用可以重新赋值.而且String类被fina ...
- Python_自定义有向图
directedGraph.py class DirectedGraph(object): def __init__(self,d): if isinstance(d,dict): self.__gr ...