博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【MATLAB】评价二值分割结果的函数
阅读量:7090 次
发布时间:2019-06-28

本文共 940 字,大约阅读时间需要 3 分钟。

 

根据PASCAL challenges的标准:intersection-over-union score,所写的matlab评价程序,处理二值图像。

 

其思想即分割结果与Ground Trueth的交集比上它们的并集,即为分割的准确率,代码如下:

 

1 function performance =get_performance_iou_binary(ImgResult, ImgGT) 2  3 % background color & foreground 4 bg_color = 0 ; 5 fg_color = 255 ; 6  7 % check the size 8 [rh rw rd] = size(ImgResult); 9 [gh gw gd] = size(ImgGT);10 11 if rh~=gh || rw~=gw || rd~=gd12     return;13 end14 15 % performance by intersection-over-union16 intersection=0;17 unionsection=0;18 19 for i=1:rh20     for j=1:rw21         if ImgResult(i,j)==fg_color && ImgGT(i,j)==fg_color22             intersection=intersection+1;23         end24         if ImgResult(i,j)==fg_color || ImgGT(i,j)==fg_color25             unionsection=unionsection+1;26         end27     end28 end29 30 if unionsection==031     performance=100;32 else33     performance=100*intersection/unionsection;34 end35 36 end

 

转载于:https://www.cnblogs.com/moondark/p/3325906.html

你可能感兴趣的文章
JCreator中不能引入servlet包的解决办法
查看>>
mysql root账户被删除
查看>>
vagrant box php开发环境配置 -- redis安装
查看>>
Java动态编译类小案例
查看>>
eclipse 本地连接hadoop 进行开发
查看>>
开发注意事项总结
查看>>
英语美文20篇
查看>>
如何做到完成任务和内功修炼的完美统一
查看>>
使用cornerstone是的灵异事件
查看>>
Java Objects-------------工具类使用
查看>>
Intellij IDEA 自动生成 serialVersionUID
查看>>
将CentOS设置为用光盘做yum源
查看>>
终于用上了比较完美的lion 10.7.3
查看>>
【CentOS 7笔记47】,rsync文件同步工具#171205
查看>>
word2007设置标题自动编号
查看>>
Ubuntu添加自定义快捷方式
查看>>
mysql 基本操作
查看>>
我的友情链接
查看>>
Xcode 使用Git User Interface State 问题
查看>>
我在群硕实习的日子
查看>>