Frequency-tuned Salient Region Detection MATLAB代碼出錯修改方法

來源:互聯網
上載者:User

標籤:style   blog   http   ar   io   color   os   使用   sp   

論文: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) 2009 Radhakrishna Achanta [EPFL]% Contact: [email protected]%---------------------------------------------------------% Citation:% @InProceedings{LCAV-CONF-2009-012,%    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        = 2009% }%---------------------------------------------------------% 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 pathgfrgb = imfilter(img, fspecial(‘gaussian‘, 3, 3), ‘symmetric‘, ‘conv‘);%symmetric映像大小通過鏡像反射其邊界來擴充 conv通過使用卷積來完成%fspecial(‘gaussian‘, 3, 3)產生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(:,:,1)); lm = mean(mean(l));a = double(lab(:,:,2)); am = mean(mean(a));b = double(lab(:,:,3)); bm = mean(mean(b));%---------------------------------------------------------% Finally compute the saliency map and display it.%---------------------------------------------------------sm = (l-lm).^2 + (a-am).^2 + (b-bm).^2;imshow(sm,[]);%---------------------------------------------------------

 :

Frequency-tuned Salient Region Detection MATLAB代碼出錯修改方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.