Friday, March 27, 2009

Install Latex on PC

1. Install ghostscript from the following location: http://pages.cs.wisc.edu/~ghost/
2. Install MikTex http://www.stat.pitt.edu/stoffer/freetex.html#MT: the program includes an update program that can automatically get the latest package from the internet.
3. Install editors such as WinEdt (stored in my hotmail account) 5.3

Monday, March 16, 2009

matlab rotate 3d plot and capture frames

for k=-31:1:31
az = k;
el = 31;
h = surfc(X,Y,LUT1);
view(az,el);
% set(gcf, 'Renderer', 'OpenGL'); % OpenGL driver has issues in Vista????
set(gcf, 'Renderer', 'Zbuffer');
F = getframe;
G = frame2im(F);
imwrite(G, [out_path 'out_' num2str(k, '%04d') '.bmp'], 'bmp');
end

use matlab to generate moving bitmap sequences

clear all, clc, close all;
path_name = '.\';
file_name = 'Master';

I = imread([path_name file_name '.bmp']);
h_speed = -5;
v_speed = 0;

output_path = [ 'E:\demo\overdrive\source\' file_name '_' ...
'h' num2str(abs(h_speed)) ...
'v' num2str(abs(v_speed)) '\'];

mkdir(output_path);
k = 80;

% moving left
for i=1:k/2
imwrite(I, [output_path 'out_' num2str(i, '%04d') '.bmp' ]);
I = circshift(I, [v_speed, h_speed, 0]);
disp(i);
end

% moving right
for i=k/2+1:k
imwrite(I, [output_path 'out_' num2str(i, '%04d') '.bmp' ]);
I = circshift(I, [v_speed, -h_speed, 0]);
disp(i);
end

generating 3D plot

% assuming the LUT is a 256x256 look-up-table ranging from 0..255.


[X Y] = meshgrid([0:1:255]);

figure,surf(X,Y,LUT);

xlim([0 255]);
ylim([0 255]);
zlim([0 255]);

capture frames from matlab plot

imshow(A);
F = getframe;
I = frame2im(F);
imwrite(I, ['c:\temp.bmp'], 'bmp');