Tuesday, November 30, 2010

Emacs as an IDE


Wednesday, April 7, 2010

Fast rendering 2D projections of 3D model data

The renderer performs a high speed rendering of a Autodesk 3DS model, using OpenGL offscreen rendering. The rendered image could be pixel intensities, surface normal values or other attributes.

Given a 3DS model like this:

For a given rotation, shift and scale, a 2D projection like this is rendered. Intensity values are returned/stored in memory for further processing.

Alternatively, other attributes like surface normal components could also be rendered instead of the color intensities.

For example x, y, z components of the model surface normals have been rendered in the 3 images below.

Tuesday, March 16, 2010

shell script to rename all UPPERCASE files to lowercase

for f in *; do
g=`expr "xxx$f" : 'xxx\(.*\)' | tr '[A-Z]' '[a-z]'`
mv "$f" "$g"

Tuesday, March 9, 2010

Notes on compiling mex file without gcc version warning


Changed mexopts.sh as (Matlab2009b/bim/mexopts.sh is changed use mex -setup to select that conf as the default after the changes)

# StorageVersion: 1.0
# CkeyName: GNU C
# CkeyManufacturer: GNU
# CkeyLanguage: C
# CkeyVersion:


#Srimal: we allow // style comments due to opencv .h files

Friday, March 5, 2010

Run mex functions using opencv 2.0 code with MATLAB R2009b

We get this error:

??? Invalid MEX-file '/home/srimal/svnworking/renderer/mexLossC/mexLossC.mexglx':
/home/srimal/MatlabR2009b/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by


ln -s /usr/lib/libstdc++.so.6.0.13 ~/MatlabR2009b/sys/os/glnx86/libstdc++.so.6

Allow C // style comments in MATLAB mex functions

Remove the -ansi CFLAG





in MatlabR2009b/bin/mexopts.sh

and use

mex -setup to select this conf.

Thursday, March 4, 2010

OpenCV 2.00 with eclipse

To get the compile options,

$ pkg-config opencv --cflags --libs
-I/usr/local/include/opencv -L/usr/local/lib -lcv -lhighgui -lcvaux -lml -lcxcore

Include the above in eclipse project properties.

Tuesday, March 2, 2010

Compiling programs that use GSL

$ gcc myprogram.c `pkg-config --cflags --libs gsl` -o myprogram

add compiler / linker settings (alt+enter) to match (individually -I -L -l ...fileds)
$ pkg-config --cflags --libs gsl
-I/usr/local/include -L/usr/local/lib -lgsl -lgslcblas -lm

Eclipse and SVN (dont use eclipse tools - use cmdline svn)

1 All eclipse svn methods failed and/or too messy
2 manually svn ci into some dir (~/svnworking)
3 create new eclipse workspace ~/eclipse_workspace_svnworking
4 switch to that
5 in eclipse Import> General > Existing project into workspace (select dir from ~/svnworking which was previously checked out manually using svn)
6 this will change the code in ~/eclipse_workspace_svnworking directly
7 svn ci as usual from a terminal