7

I am doing a lot of image processing in C and I need a good, reasonably lightweight, and above all FAST matrix manipulation library with a permissive license. I am mostly focussing on affine transformations and matrix inversions, so i do not need anything too sophisticated or bloated.

Primarily I would like something that is very fast (using SSE perhaps?), with a clean API and (hopefully) prepackaged by many of the unix package management systems.

Note this is for C not for C++.

Thanks

:)

horseyguy
  • 29,455
  • 20
  • 103
  • 145

5 Answers5

8

I'd say BLAS or LAPACK.

Here you have some examples.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
  • this looks great :) but i can't find a precompiled binary of the library anywhere for my (unfortunately right now) windows system. Any idea where i could find it? – horseyguy Apr 14 '10 at 12:33
  • Start looking here: http://blogs.msdn.com/hpctrekker/archive/2009/02/24/hpc-math-attacks-blas-lapack-linpack-atlas-dgemm-acml-mkl-cuda.aspx – High Performance Mark Apr 14 '10 at 12:55
  • 2
    BLAS and LAPACK are generally considered interfaces, in the same way that OpenGL is an interface with many underlying implementations by graphics card vendors. That said, the fastest BLAS out there right now is GotoBLAS2, but its license is restrictive. Intel and AMD provide their own libraries (MKL and ACML) but those are also restrictive. Stick to the netlib reference implementations if you want truly free. You generally need to compile these yourself for your processor to get the best performance. – Victor Liu Apr 14 '10 at 22:32
  • 1
    @banister: the other option to downloading an existing binary is to build your own. A good way to do so is to use ATLAS (http://math-atlas.sourceforge.net/), which produces a BLAS tuned to your machine. See http://math-atlas.sourceforge.net/errata.html#WinBuild and http://math-atlas.sourceforge.net/errata.html#winpt for windows-specific info (also read the rest of the errata). – stephan Apr 21 '10 at 06:33
8

OpenCV

alt text
(source: willowgarage.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Pratik Deoghare
  • 35,497
  • 30
  • 100
  • 146
2

You could try CUBLAS(CUDA Basic Linear Algebra Subroutines library) with CUDA enabled graphics card to do matrix manipulation on nVidia GPUs. It has quite significant performance boost than other CPU libraries, though it is not that lightweight to your requirement.

This page contains some description and figures about it.

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110
xpxp
  • 47
  • 1
  • 11
1

I found this library and it's brilliant: Meschach

horseyguy
  • 29,455
  • 20
  • 103
  • 145
0

Armadillo have simple interface and can use different LAPACK and BLAS linear algebra libraries

mrgloom
  • 20,061
  • 36
  • 171
  • 301