图像显著性检测评价指标P-R,F值等相关问题

问题描述

图像显著性检测评价指标P-R,F值等相关问题

求~这些评价指标的matlab程序~~需要比较多种检测方法的结果,生成比较图~~求助求助

解决方案

贴一个码,不过我还没有调试成功
function Plot_PreRecallThousand
%%
clear;
% Mapdir = 'E:BenchMapmapBerke';
% Mapdir = 'E:BenchMapEqup';
% Mapdir = 'e:BenchMapGbvsMapSED1';
% Mapdir = 'e:OURCMREWberkelmap';
Mapdir = 'E:BenchMapmapBerke';
%GroundDir = 'E:pagerankgrdsed2';bijaohao
% GroundDir = 'E:datasetBSD300Masks';
% GroundDir = 'E:OURCMREBSD300Masks';
% GroundDir = 'E:OURCMREgrdsed1';
GroundDir = 'E:OURCMREbinary mask';
cd (GroundDir);
ImgEnum=dir('*.bmp'); ImgNum=length(ImgEnum);%图像数量
Pre = zeros(21,1);
Recall = zeros(21,1);

% FMeasure = zeros(21,1);
jj=0; PreF = 0; RecallF = 0; FMeasureF = 0; FigAnd = 0; bigthreshold = 0; ThresholdAnd = 0;
for i=1:ImgNum

i

cd(GroundDir);
Binary = imread( ImgEnum(i).name );
NumOne= length( find(Binary(:,:,1) >0) );
[height,width] = size( Binary(:,:,1) );

cd (Mapdir);
mapImg = imread( strcat( ImgEnum(i).name(1:end-4),'_sparse.jpg' ) );

% Label2 = imread( ImgEnum(i).name );
Label2 = mat2gray( mapImg );

%% thou berke Pre recall

if NumOne ~= 0
jj=jj+1; mm = 1;

for j = 0 : .05 : 1
Label3 = zeros( height, width );

Label3( Label2>=j )=1;

NumRec = length( find( Label3==1 ) );

   LabelAnd = Label3 & Binary(:,:,1);
   NumAnd = length( find( LabelAnd==1 ) );
   if NumAnd == 0
       FigAnd = FigAnd + 1;
       break;
   end
   Pretem = NumAnd/NumRec;
   Recalltem =  NumAnd/NumOne;

   Pre(mm) = Pre(mm) +  Pretem;
   Recall(mm) = Recall(mm) + Recalltem;

% FMeasure(mm) = FMeasure(mm) + ( (1 + .3) * Pretem * Recalltem ) / ( .3 * Pretem + Recalltem );
mm = mm + 1;
end

  sumLabel =  2* sum( sum(Label2) ) / (height*width) ;
  if ( sumLabel >= 1 )
          sumLabel = .902 ;    bigthreshold = bigthreshold +1;
  end       

   Label3 = zeros( height, width );
   Label3( Label2>=sumLabel ) = 1;       

   NumRec = length( find( Label3==1 ) );

   LabelAnd = Label3 & Binary(:,:,1);
   NumAnd = length( find ( LabelAnd==1 ) );

   if NumAnd == 0
       ThresholdAnd = ThresholdAnd +1;
       continue;
   end

   PreFtem = NumAnd/NumRec;
   RecallFtem = NumAnd/NumOne;   

   PreF = PreF +    PreFtem;
   RecallF = RecallF +    RecallFtem;

   FMeasureF = FMeasureF + ( ( ( 1 + .3) * PreFtem * RecallFtem ) / ( .3 * PreFtem + RecallFtem ) );

end

end
%% Mean Pre Recall

FigAnd
ThresholdAnd
bigthreshold
cd 'E:ourcmremapcodemap';
Pre = Pre ./jj ;
Recall = Recall ./jj;

% FMeasure = FMeasure ./ jj;

PreF = PreF /jj
RecallF = RecallF /jj
FMeasureF = FMeasureF / jj

save( Mapdir( end-13: end-1) , 'Pre', 'Recall', 'FMeasureF','PreF','RecallF'); % 'FMeasure',

figure(1);
hold on;

plot(Recall ,Pre, 'r' );

xlabel('Recall');
ylabel('Precision');

grid on;
hold off;

% figure(2);
% hold on;
% plot(Pre, 'r' );
% xlabel('Threshold');
% ylabel('Pre');
% grid on;
% hold off;
%
% figure(3);
% hold on;
% plot(Recall, 'r' );
% xlabel('Threshold');
% ylabel('Recall');
% grid on;
% hold off;
%
% figure(4);
% hold on;
% plot( FMeasure, 'r' );
% xlabel('Threshold');
% ylabel('FMeasure');
% grid on;
% hold off;

时间: 2024-08-07 21:49:49

图像显著性检测评价指标P-R,F值等相关问题的相关文章

用opencv4android中的cvtColoer()对图像灰度化后,为什么像素值都是负数?

问题描述 用opencv4android中的cvtColoer()对图像灰度化后,为什么像素值都是负数? Imgproc.cvtColor(srcMat grayMat Imgproc.COLOR_RGB2GRAY);我是这样灰度化的然后,graybmp = Bitmap.createBitmap(bmp.getWidth() bmp.getHeight() Config.RGB_565);Utils.matToBitmap(grayMat graybmp);我转成bmp图像随后,graybmp

什么是MTU,如何检测和设置路由器MTU值

MTU是MaximumTransmissionUnit的缩写. 意思是网络上传送的最大数据包.MTU的单位是字节.大部分网络设备的MTU都是1500.如果本机的MTU比网关的MTU大,大的数据包就会被拆开来传送,这样会产生很多数据包碎片,增加丢包率,降低网络速度.把本机的MTU设成比网关的MTU小或相同,就可以减少丢包. 如何检测网关的MTU? 在本机打开dos窗口,执行: ping-f-l1452192.168.1.1 其中192.168.1.1是网关IP地址,1452是数据包的长度.请注意,

信号曲线积分”-Labview混合信号曲线的游标图例能检测显示所有曲线交点值,但不知道如何都输出来

问题描述 Labview混合信号曲线的游标图例能检测显示所有曲线交点值,但不知道如何都输出来 两游标夹的一条曲线怎么求面积,那个大神能帮忙写个小vi,分少了点 解决方案 给个建议吧!可能您是不想写代码 1. http://jingyan.baidu.com/article/656db9189d5a6ee381249ca0.html 这是用matlab实现的一段两条曲线求面积的代码 2. http://www.ilovematlab.cn/thread-99053-1-1.html 这是Labvi

程明明-显著性检测(RC算法、HC算法)

问题描述 显著性检测(RC算法.HC算法) 求教各位:有看过程明明的"Global Contrast based Salient Region Detection"论文的,想请教一下论文的运行代码(RC算法),谢谢各位了

class- 请问怎样把f值返回给s

问题描述 请问怎样把f值返回给s #include "iosrtream.h" class aa { public: aa(int x,int y) { int f; f=x+y; } } main() { int x=1,y=2,s; aa(x,y); s=aa(x,y); } 解决方案 #include <iostream> using namespace std; class aa { private: int f; public: aa(int x,int y) {

ILSVRC2016目标检测任务回顾:图像目标检测(DET)

雷锋网(公众号:雷锋网)注:本文作者李瑜,中科院计算所前瞻研究实验室跨媒体组硕博士生,硕士导师唐胜副研究员,博士导师李锦涛研究员.2016年,作为360+MCG-ICT-CAS_DET团队核心主力参加了ImageNet大规模视觉识别挑战赛(ILSVRC)的 DET任务并获得第四名.目标检测相关工作受邀在ECCV 2016 ImageNet和COCO视觉识别挑战赛联合工作组会议上做大会报告. 计算机视觉领域权威评测--ImageNet大规模图像识别挑战赛(Large Scale Visual Re

亦是疑难杂症、WPF:我用photoshop建了一幅3*3的png图像,然后,用下面代码读取这幅图像所有9个点的Argb值,发现某些点有偏差。不解不解。!

问题描述 备注:下面D:3.png是我用photoshop建立的一幅3*3的png图像,其中9个点的颜色分别是:赤橙黄黑白绿青蓝紫.<Windowx:Class="Test.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title

图像背景检测算法

问题描述 请问有没有什么算法可以把一个图片的蓝色背景或者绿色背景检测出来得到mask图,我需要具体的算法,谢谢 解决方案 本帖最后由 bzyhd 于 2015-12-08 08:31:05 编辑

ajax 服务器文本框自动填值_AJAX相关

这样的话就增加了服务器的负担.后面自己他细想了一下.想利用ajax去实现这样一个效果.代码如下: 前台代码: 复制代码 代码如下: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServerTextBoxdata.aspx.cs" Inherits="Default3" %> <!DOCTYPE html PUBLIC "-//W3C