16 lines
483 B
Matlab
16 lines
483 B
Matlab
function AD = attache_donnees_RVB(I,moyennes,variances)
|
|
[nx,ny,nc] = size(I);
|
|
N = length(moyennes);
|
|
AD = zeros(nx,ny,N);
|
|
for i = 1:nx
|
|
for j = 1:ny
|
|
for k = 1:N
|
|
sigma(:,:) = variances(k,:,:);
|
|
x(:) = I(i,j,:);
|
|
mu(:) = moyennes(k,:);
|
|
AD(i,j,k) = 1/((2*pi)^(nc/2)*sqrt(det(sigma))) ...
|
|
* exp(-1/2*(x-mu)*(sigma\(x-mu)'));
|
|
end
|
|
end
|
|
end
|
|
end |