Daily Archives: September 17, 2007

an inefficient 3D point viewer

Given a disparity map and a color image, want to view the 3D scene created by these 2 images:

clear;
% load images
Index=imread(‘disparity.bmp’);
C=double(imread(‘fly_1.jpg’))/255;

s = size(C);
m = s(1,1); % row
n = s(1,2); % columm

figure;
for x=1:1:m
for y=1:1:n
plot3(x, y, Index(x,y,1), ‘color’, [C(x,y,1), C(x,y,2), C(x,y,3)]), hold on;
end
end

执行的时候效率非常低,当还有1G free memory的时候就抱错说out of memory,估计是这种做法让Matlab觉得太恶心了。使用figure的3d旋转按钮多按了几次,结果连Matlab就直接退出了。
(用plot来画大量的点的时候效率就低,加上每个点都指定不同的color,估计就更不行了。)

tex4ht

The Translation Process
http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn37.html

The system can be activated with a sequence of commands of the following form, typically embedded within a script.
latex x (or ‘tex x’)
latex x
latex x
tex4ht x
t4ht x
The three compilations with La(TeX) are needed to ensure proper links.

在使用tex4ht的时候,要导入tex4ht.sty and *.4ht style files。如果要显示数学公式,还要安装imagemagick供t4ht使用。产生页面效果很好。