⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spatm.m

📁 matlab的模式识别toolbox
💻 M
字号:
%SPATM Augment image dataset with spatial label information%%	E = SPATM(D,S)% E = D*SPATM([],S)%% INPUT%        D     image dataset classified by a classifier%        S     smoothing parameter (optional, default: sigma = 1.0)%% OUTPUT%        E     augmented dataset with additional spatial information%% DESCRIPTION% If D = A*W*CLASSC, the output of a classification of a dataset A% containing feature images, then E is an augmented version of D:% E = [D T]. T contains the spatial information in D, such that% it adds for each class of which the objects in D are assigned to,% a Gaussian convoluted (std. dev s) 0/1 image with '1'-s on the% pixel positions (objects) of that class. T is normalized such that% its row sums are 1. It thereby effectively contains Parzen estimates% of the posterior class probabilities if the image is considered as a% feature space. Default: S = 1.%% Spatial and feature information can be combined by feeding E into% a class combiner, e.g: A*W*CLASSC*SPATM([],2)*MAXC%% SEE ALSO% DATASETS, MAPPINGS, PREX_SPATM% Copyright: R.P.W. Duin, duin@ph.tn.tudelft.nl% Faculty of Applied Sciences, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlands% $Id: spatm.m,v 1.7 2005/01/25 14:38:53 davidt Exp $function b = spatm(a,s)		prtrace(mfilename);		if nargin < 2, s = 1; end	if nargin < 1 | isempty(a)		b = mapping('spatm','fixed',s);		return	end		% assertion: the image with pixels being objects is required	isfeatim(a);		% initialize the label-image y:	[m,k,c] = getsize(a);	[n1,n2] = getobjsize(a);	%DXD Avoid that the feature labels might be reordered...	%[labt,x,newlablist] = renumlab(getfeatlab(a),labeld(a));	[dummy,x] = max(a,[],2);	y = zeros(n1,n2,max(x));	y((x(:)-1)*n1*n2 + [1:n1*n2]') = ones(n1,n2);	% make the label-image a dataset:	z = im2feat(y);	% Store also all the useful things like prior or lablist	z = setdat(a,z);	% smooth the label-image and add it to the dataset a:	b = [a datgauss(z,s)];	%b = datgauss(z,s);return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -