Monday, January 15, 2007

2007-01-15 Headmaps

I think I figured out how I intend to do the headmaps.

Gonna make it a image, with a gausian peak at our points..

Something like:
x=[1:20]; y=[1:20]; x=[1:.3:50]; y=[1:.3:50]; [X,Y]=meshgrid(x,y);
f=inline('(1/(2*pi*s)).*exp(-(((x-a).^2+(y-b).^2)/(2*s^2)))','x','y', 's', 'a', 'b');

% Test points
A = f(X,Y, 3, 25, 25);
A = A + f(X,Y, 3, 10, 25);
A = A + f(X,Y, 3, 25, 45);
A = A + f(X,Y, 3, 15, 45);
A = A + f(X,Y, 3, 19, 35);

A = 1000*A;

ibg = image(A);
colormap jet

% lets put a transparent circle on this
t = 0:.1:2*pi;
[imheight,imwidth] = size(A(:,:,1));
x = round((1/2)*imwidth*cos(t)+round(imwidth/2));
y = round((1/2)*imheight*sin(t)+round(imheight/2));
imCircleAlphaData = roipoly(A,x,y);
set(ibg,'AlphaData',double(imCircleAlphaData));


End result:


No comments: