[IPOL discuss] use of Eigen for PCA/SVD computation in demo blm_color_dimensional_filtering

José Luis Lisani joseluis.lisani at uib.es
Fri May 20 17:19:00 CEST 2011


this is a follow up of the discussion "SVD for IPOL: which library, and 

I just wanted to share my experience with the various options that were 

I  wanted to find a substitute for a PCA computation function from 
Numerical Recipes

- CImg:
I tried what David proposed and it worked fine
(except for a bug in the compilation line, it should be:
g++ -o toto toto.cpp -Dcimg_display_type=0)

The only drawback is that I don't need a whole image processing library,
just a linear algebra library

- GSL:
It also worked fine, but then I tried to follow Enric's suggestion
(ie. 'The desired code from GSL can be easily copy-pasted into your 
I spent two days trying to isolate the SVD functions that I needed but
I was unable to do it (too many dependencies between the source codes
and on global variables that were set during the GSL installation process).
So I gave up this option.

- Eigen:
it works fine and it is very easy to use.
I added the 'Eigen' folder to my source code (it adds  'only' 2.16MB)
and now it can be compiled without problem with any C++ compiler
(it even works fine with Visual C++ Express).
The code is now slightly slower than my original code (the one using
Numerical Recipes) but it is OK.
The main drawback is that valgrind detects several errors in Eigen,
which raises doubts about the quality of the code.

If you want, you can take a look at the code, available from the web page:

José Luis

More information about the discuss mailing list