资源简介
CTM_image_segmentor matlab 代码,大家有兴趣的可以看一下哈
代码片段和文件信息
function [cgtheta] = cgmo(imradiusnorientvarargin)
% function [cg] = cgmo(imradiusnorient...)
%
% Compute the color gradient at a single scale and multiple
% orientations.
%
% INPUT
% im Grayscale or RGB image values in [01].
% radius Radius of disc for cg.
% norient Number of orientations for cg.
% ‘nbins‘ Number of bins; should be > 1/sigmaSim.
% ‘sigmaSim‘ For color similarity function.
% ‘gamma‘ Gamma correction for LAB [2.5].
% ‘smooth‘ Smoothing method one of
% {‘gaussian‘‘savgol‘‘none‘} default ‘none‘.
% ‘sigmaSmo‘ Sigma for smoothing default to radius.
%
% OUTPUT
% cg Size [hwdnorient] array of cg images
% where d is the dimensionality of the image.
%
% The input parameters {radiusnbinssigmaSimsigmaSmo} should be
% scalars when the input image is grayscale and can be either scalars
% or 3-element vectors when the image is RGB.
%
% See also cgmo.
%
% David R. Martin
% April 2003
% process options
nbins = 32;
sigmaSim = 0.1;
gamma = 2.5;
smooth = ‘none‘;
sigmaSmo = radius;
for i = 1:2:numel(varargin)
opt = varargin{i};
if ~ischar(opt) error(‘option names not a string‘); end
if i==numel(varargin) error(sprintf(‘option ‘‘%s‘‘ has no value‘opt)); end
val = varargin{i+1};
switch opt
case ‘nbins‘ nbins=val;
case ‘sigmaSim‘ sigmaSim=val;
case ‘gamma‘ gamma=val;
case ‘smooth‘
switch val
case {‘none‘‘gaussian‘‘savgol‘} smooth=val;
otherwise error(sprintf(‘invalid option smooth=‘‘%s‘‘‘val));
end
case ‘sigmaSmo‘ sigmaSmo=val;
otherwise error(sprintf(‘invalid option ‘‘%s‘‘‘opt));
end
end
% check arguments
if ndims(im)==2 % grayscale image
if numel(radius)~=1 error(‘radius should have 1 element‘); end
if numel(nbins)~=1 error(‘nbins should have 1 element‘); end
if numel(sigmaSim)~=1 error(‘sigmaSim should have 1 element‘); end
if numel(sigmaSmo)~=1 error(‘sigmaSim should have 1 element‘); end
elseif ndims(im)==3 % RGB image
if numel(radius)==1 radius = radius*ones(31); end
if numel(nbins)==1 nbins = nbins*ones(31); end
if numel(sigmaSim)==1 sigmaSim = sigmaSim*ones(31); end
if numel(sigmaSmo)==1 sigmaSmo = sigmaSmo*ones(31); end
if numel(radius)~=3 error(‘radius should have 1 or 3 elements‘); end
if numel(nbins)~=3 error(‘nbins should have 1 or 3 elements‘); end
if numel(sigmaSim)~=3 error(‘sigmaSim should have 1 or 3 elements‘); end
if numel(sigmaSmo)~=3 error(‘sigmaSmo should have 1 or 3 elements‘); end
radius = radius(:);
nbins = nbins(:);
sigmaSim = sigmaSim(:);
sigmaSmo = sigmaSmo(:);
else
error(‘image not of valid dimension‘);
end
norient = max(1norient);
nbins = max(1nbins);
% min and max values for ab channels of LAB
% used to scale values into the unit interval
abmin = -73;
abmax = 95;
% make sure nbins is large enough with respect to sigmaSim
if any( nbins < 1./sigmaSim )
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-04-05 23:25 CTM_image_segmentor\
文件 6148 2006-06-25 09:21 CTM_image_segmentor\.DS_Store
文件 38411 2012-04-05 22:21 CTM_image_segmentor\00111-heatmap.mat
文件 1900292 2012-04-05 23:24 CTM_image_segmentor\00111-saliencymap.mat
文件 8976 2012-04-05 10:53 CTM_image_segmentor\00211.mat
目录 0 2012-03-28 23:28 CTM_image_segmentor\Benchmark\
文件 2006 2003-03-27 07:51 CTM_image_segmentor\Benchmark\affinityPRMI.m
文件 1344 2003-11-06 09:06 CTM_image_segmentor\Benchmark\benchNewAlg.m
文件 3655 2003-11-04 01:31 CTM_image_segmentor\Benchmark\boundaryBench.m
文件 2220 2003-11-13 00:39 CTM_image_segmentor\Benchmark\boundaryBenchGraphs.m
文件 2387 2003-10-31 23:42 CTM_image_segmentor\Benchmark\boundaryBenchGraphsHuman.m
文件 3398 2003-11-06 02:45 CTM_image_segmentor\Benchmark\boundaryBenchGraphsMulti.m
文件 15216 2003-11-13 01:00 CTM_image_segmentor\Benchmark\boundaryBenchHtml.m
文件 2664 2003-07-04 23:56 CTM_image_segmentor\Benchmark\boundaryBenchHuman.m
文件 2132 2003-11-13 01:34 CTM_image_segmentor\Benchmark\boundaryPR.m
文件 2520 2004-06-23 06:11 CTM_image_segmentor\Benchmark\boundaryPRfast.m
目录 0 2012-03-28 23:28 CTM_image_segmentor\Benchmark\build\
目录 0 2007-04-10 04:36 CTM_image_segmentor\Benchmark\build\ix86_linux\
文件 806 2003-02-02 10:30 CTM_image_segmentor\Benchmark\calcMI.m
文件 2171 2003-11-01 00:39 CTM_image_segmentor\Benchmark\correspondPixels.cc
文件 1637 2003-04-20 10:50 CTM_image_segmentor\Benchmark\correspondPixels.m
文件 1307 2003-11-01 00:41 CTM_image_segmentor\Benchmark\demo.m
文件 419 2003-11-01 01:08 CTM_image_segmentor\Benchmark\GNUmakefile
文件 12024 2003-04-01 04:01 CTM_image_segmentor\Benchmark\match.cc
文件 280 2003-01-31 05:44 CTM_image_segmentor\Benchmark\match.hh
文件 854 2003-03-25 09:14 CTM_image_segmentor\Benchmark\plotMatch.m
文件 2553 2003-11-06 09:08 CTM_image_segmentor\Benchmark\README
文件 760 2003-11-01 00:40 CTM_image_segmentor\Benchmark\testCorrespondPixels.m
文件 289 2003-04-20 10:27 CTM_image_segmentor\Benchmark\upsamplepb.m
文件 4312 2012-03-28 22:49 CTM_image_segmentor\cgmo.m
文件 3317 2003-11-13 01:45 CTM_image_segmentor\CHANGELOG
............此处省略1578个文件信息
评论
共有 条评论