attenuateborders.m
来自「显著区域检测。求的图像中感兴趣区域的位置」· M 代码 · 共 36 行
M
36 行
% attentuateBorders - linearly attentuates the border of data.%% result = attenuateBorders(data,borderSize)% linearly attenuates a border region of borderSize% on all sides of the 2d data array.% This file is part of the SaliencyToolbox - Copyright (C) 2006-2007% by Dirk B. Walther and the California Institute of Technology.% See the enclosed LICENSE.TXT document for the license agreement. % More information about this project is available at: % http://www.saliencytoolbox.netfunction result = attenuateBorders(data,borderSize)result = data;dsz = size(data);if (borderSize * 2 > dsz(1)) borderSize = floor(dsz(1) / 2); endif (borderSize * 2 > dsz(2)) borderSize = floor(dsz(2) / 2); endif (borderSize < 1) return; endbs = [1:borderSize];coeffs = bs / (borderSize + 1);% top and bottomrec = repmat(coeffs',1,dsz(2));result(bs,:) = result(bs,:) .* rec;range = dsz(1) - bs + 1;result(range,:) = result(range,:) .* rec;% left and rightrec = repmat(coeffs,dsz(1),1);result(:,bs) = result(:,bs) .* rec;range = dsz(2) - bs + 1;result(:,range) = result(:,range) .* rec;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?