Frequency-tuned Salient Region Detection MATLAB代码出错修改方法
论文:Frequency-tuned Salient Region Detection.CVPR.2009
MATLAB代码运行出错如下:
Error using makecform>parseWPInput (line 389)
Expected input number 2, PROPERTYNAME, to match one of these strings:
AdaptedWhitePoint
The input, ''whitepoint'', did not match any of the valid strings.
Error in makecform>parseWPInputs (line 378)
wp = parseWPInput(varargin{2}, varargin{3}, valid_strings, 'WP', 2);
Error in makecform>make_srgb2lab_cform (line 349)
wp = parseWPInputs('AdaptedWhitePoint', varargin{:});
Error in makecform (line 213)
c = make_srgb2lab_cform(varargin{:});
Error in FT_Saliency_CVPR2009 (line 36)
cform = makecform('srgb2lab', 'whitepoint', whitepoint('d65'));
修改如下:
cform = makecform('srgb2lab', 'AdaptedWhitePoint', whitepoint('d65'));
%---------------------------------------------------------
% Copyright (c) Radhakrishna Achanta [EPFL]
% Contact: firstname.lastname@epfl.ch
%---------------------------------------------------------
% Citation:
% @InProceedings{LCAV-CONF--,
% author = {Achanta, Radhakrishna and Hemami, Sheila and Estrada,
% Francisco and S黶strunk, Sabine},
% booktitle = {{IEEE} {I}nternational {C}onference on {C}omputer
% {V}ision and {P}attern {R}ecognition},
% year =
% }
%---------------------------------------------------------
% Please note that the saliency maps generated using this
% code may be slightly different from those of the paper.
% This seems to be because the RGB to Lab conversion is
% different from the one used for the results in the C++ code.
% The C++ code is available on the same page as this matlab
% code (http://ivrg.epfl.ch/supplementary_material/RK_CVPR09/index.html)
% One should preferably use the C++ as reference and use
% this matlab implementation mostly as proof of concept
% demo code.
%---------------------------------------------------------
%
%
%---------------------------------------------------------
% Read image and blur it with a 3x3 or 5x5 Gaussian filter
%---------------------------------------------------------
img = imread('100\images\8.jpg');%Provide input image path
gfrgb = imfilter(img, fspecial('gaussian', , ), 'symmetric', 'conv');
%symmetric图像大小通过镜像反射其边界来扩展 conv通过使用卷积来完成
%fspecial('gaussian', , )产生3*3高斯低通滤波器模板
%---------------------------------------------------------
% Perform sRGB to CIE Lab color space conversion (using D65)
%---------------------------------------------------------
%cform = makecform('srgb2lab', 'whitepoint', whitepoint('d65'));
cform = makecform('srgb2lab', 'AdaptedWhitePoint', whitepoint('d65'));
lab = applycform(gfrgb,cform);
%---------------------------------------------------------
% Compute Lab average values (note that in the paper this
% average is found from the unblurred original image, but
% the results are quite similar)
%---------------------------------------------------------
l = double(lab(:,:,)); lm = mean(mean(l));
a = double(lab(:,:,)); am = mean(mean(a));
b = double(lab(:,:,)); bm = mean(mean(b));
%---------------------------------------------------------
% Finally compute the saliency map and display it.
%---------------------------------------------------------
sm = (l-lm).^ + (a-am).^ + (b-bm).^;
imshow(sm,[]);
%---------------------------------------------------------
效果图:


Frequency-tuned Salient Region Detection MATLAB代码出错修改方法的更多相关文章
- CVPR 2011 Global contrast based salient region detection
Two salient region detection methods are proposed in this paper: HC AND RC HC: Histogram based contr ...
- Global Contrast based Salient Region Detection (Ming ming Cheng)
abstract: Automatic estimation of salient object regions across images, without any prior assumption ...
- (不断更新)关于显著性检测的调研-Salient Object Detection: A Survey
<Salient Object Detection: A Survey>作者:Ali Borji.Ming-Ming Cheng.Huaizu Jiang and Jia Li 基本按照文 ...
- Minimum Barrier Salient Object Detection at 80 FPS 论文阅读笔记
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...
- Matlab人脸检測方法(Face Parts Detection)具体解释
今天同学让我帮忙制作一个人脸表情识别的样本库,当中主要是对人脸进行裁剪,这里用到了一个相对较新的Matlab人脸检測方法Face Parts Detection.网上百度了一下发现关于Matlab人脸 ...
- Ncut matlab 代码bug 修复
先说平台: win7 x64,matlab 2012a x64,亲测运行. ncut 是个图像切割方法,以后再回顾具体算法吧,网上很多流程的是Jianbo Shi 这位2000年写的,名字应该是:Da ...
- 让matlab在出错时停在debug内,并留下相关变量
很多时候,我们写的matlab代码会在执行的过程中发生错误.这种情况下,matlab会 直接跳出执行,顺带告诉你是在代码的那一行跳出了,但是却无法留下出错时的每个变量 的具体值,给debug带来很大的 ...
- 【转载】让你的MATLAB代码飞起来
原文地址:http://developer.51cto.com/art/201104/255128_all.htm MATLAB语言是一种被称为是"演算纸"式的语言,因此追求的是方 ...
- 如何加速MATLAB代码运行
学习笔记 V1.0 2015/4/17 如何加速MATLAB代码运行 概述 本文源于LDPCC的MATLAB代码,即<CCSDS标准的LDPC编译码仿真>.由于代码的问题,在信息位长度很长 ...
随机推荐
- [JQuery]ScrollMe滚动特效插件
最近考完试,一切顺利,昨晚闲着无聊把最近要用的一个插件翻译了一下:ScrollMe. (╯‵□′)╯︵┻━┻地址请戳: /* ScrollMe -李明夕翻译(╯‵□′)╯︵┻━┻ */ ScrollM ...
- .Net Core配置与自动更新
.Net Core 将之前Web.Config中的配置迁移到了appsettings.json文件中,并使用ConfigurationBuilder来读取这个配置文件.并可设置在配置文件变化以后,自动 ...
- .net core 2.0 mvc 获取配置信息
mvc_core_config *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 ...
- solr7.3集群搭建
solr集群搭建 原博客:https://blog.csdn.net/gdsgdh308227363/article/details/81004706 注意,在搭建solr集群前,建议最好有一个sol ...
- CSS:如何清除a标签之间的默认留白间距
即使我们使用了类似 *{margin: 0;padding: 0;} 这样的代码重置了浏览器默认样式,也会发现类似<a>标签这种inline-block元素,它们之间也还存在着间距. de ...
- Linux常用运维指令
cd data/apps./=========================================== ps -ef | grep tomcatps -ef | grep desktopX ...
- django 后台格式化数据库查询出的日期
在项目中,我遇到这样的情况,使用ajax获取查询出来的数据,而这些数据中某个字段是日期datetime格式,在模板中显示的样式很怪异.由于前端使用了js控件,也不能使用django的模板过滤器. 所以 ...
- java.math.BigDecimal cannot be cast to java.lang.Integer
问题来源: 在数据库中查询一个列表的长度时,需要转换为Integer类型,我刚开始直接转就报错了.因为在数据库中用count(*) 聚合函数返回的值类型为BigDecimal,不能直接转换为Integ ...
- 1. JavaScript学习笔记——JS基础
1. JavaScript基础 1.1 语法 严格区分大小写 标识符,第一个字符可以是 $,建议使用小驼峰法, 保留字.关键字.true.false.null不能作为标识符 JavaScript是用U ...
- js高级程序设计 笔记 --- 表单
一,基础知识 在html中,表单是form元素,而在js中,表单对应的是HTMLFormElement类型,继承自HTMLElement,其独特的属性和方法有(常见): action:接收请求的URL ...