I am using Matlab for my image processing research. In order to speed up my programs i am searching for a scientific numerical library C/C++. So what is the best choice?
In my opinion, the best library depends upon several factors:
1. The specific problem you have to face (e.g. linear algebra, non-linear systems, ordinary differential equations, partial differential equations, etc.)
2. How much the speed is important for your calculation.
3. How much is important to have a user-friendly interface.
4. Serial vs Shared memory vs Distributed memory
Unfortunately points 2 and 3 usually cannot be achieved at the same time: in general very user-friendly libraries tend to be a little bit slower.
In the following you can find my suggestions.
1. Vector/Matrix and linear algebra
I think that the Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page) and Blaze (https://code.google.com/p/blaze-lib/) libraries are very nice: they exploit the OO nature of C++ and therefore they are very easy to use. At the same time they are very fast. In particular, Eigen has also the possibility to solve linear systems using several types of decompositions and includes several useful classes and functions for image manipulation.
The Intel MKL libraries (which are the BLAS/LAPACK implementation provided by Intel) remain the best choice if you are mainly interested in speed and you are using Intel processors. Unfortunately they are not C++ and they are quite complex to use and the interface is not so easy. Please consider that they are written in FORTRAN but a C interface is provided.
You can have a more complete list of available libraries at the following address:
http://www.netlib.org/utk/people/JackDongarra/la-sw.html
2. Ordinary differential equations
There are several solvers for ordinary differential equations, but most of them are in FORTRAN (VODE, LSODE, RADAU, DASPK, etc.) or in C (CVODE). The only real C++ solver, at least to my knowledge, is ODEINT (http://headmyshoulder.github.io/odeint-v2/). I tried this library only for non-stiff problems and works very well, it is easy to use and very fast. A very good alternative (not completely C++) is the BzzMath library (http://homes.chem.polimi.it/gbuzzi/), very powerful for stiff-problems.
3. Large problems (requiring shared or distributed memory)
The best option, which is full C++, is Trilinos (http://trilinos.sandia.gov/). It provides a lot of classes and functions to manage vectors and matrices in parallel, to solve linear and non-linear systems, to solve ordinary differential equations and calculate eigenvalues, etc. The library is enormous and quite complex to use and can be used also in serial. A simpler alternative (which is simple C) is PETSc (http://www.mcs.anl.gov/petsc/).
The first result on google search is this http://www.gnu.org/software/gsl/
For image processing I can recommend http://opencv.org/ with some basic numeric operations.
If you are using Matlab. look at:
http://www.mathworks.es/support/compilers/interface.html
But if you want speed, GSL is the best choice:
http://www.gnu.org/software/gsl/
Thanks to all.
I am trying to use gsl with visual c++ 2010, but I can't build it.
is there any solution to build GSL under windows especially VS?
I am very happy with Eigen.
"Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms."
http://eigen.tuxfamily.org/
I setup the Eigen library with Visual Studio, it is very simple to do this. The syntax is simple to use too, but I think that it is not including enough nemurical functionalities like the GSL library.
Boost (www.boost.org) compares well, is full featured and well distributed. Good V&V distributed as well.
Itk and imagej for imaging
Cern root, pooma are "general purpose" libraries, therr are others, depending on the problem...
To give concrete examples, I think Eigen is a great choice for things such as matrix/vector operations like SVD or eigen-analysis, but for other applications such as solving polynomials, I've been very happy with GSL's results. Eigen can also perform polynomial solves but it's part of its "unsupported modules". I think the answer to this question depends on which specific problems you're trying to solve. In general, the set of Eigen, GSL, Boost and OpenCV is good enough to work with just about anything in image processing (and computer vision).
I have been satisfied with the performance of Eigen on high-dimentional Matrix operations. For computational geometry problems I would definitely suggest Eigen.
For image processing research in C++ best library is CImg. http://cimg.sourceforge.net/
I found ALGLib (http://www.alglib.net) very useful. It has a lot of algorithms that are very well implemented. In addition, it is open source so that you can have a look at the source code and find out yourself if the implementations suites your needs. Another plus is that it is really easy to use and include.
For fair pricing of derivatives in Finance Quantlib library is the best choice
I do like Armadillo (http://arma.sourceforge.net/docs.html) which is quite fast and well documented. In case you are interested in R as well, there is also a very handy interface for R called RcppArmadillo)
The best library depends upon your individual needs. The best documented C++ open library is OpenCV. MATLAB will export as C/C++ or produce executables which run nearly as fast as C/C++.
The current nightly build of OpenCV supports many functions in OpenCL with the OCL module. It also has direct support of MATLAB. OpenCV 2.4.7 has some of that. Many of the core primitives look a lot like MATLAB.
I found the comment that OpenCV didn't play well with CUDA of concern. This is disconcerting when one considers that the CUDA modules in OpenCV were developed by NVIDIA.
I would suggest Eigen and Armadillo.
Eigen is the easiest to use (header only).
Armadillo require compilation but it's usage is very close to matlab syntax.
In my opinion, the best library depends upon several factors:
1. The specific problem you have to face (e.g. linear algebra, non-linear systems, ordinary differential equations, partial differential equations, etc.)
2. How much the speed is important for your calculation.
3. How much is important to have a user-friendly interface.
4. Serial vs Shared memory vs Distributed memory
Unfortunately points 2 and 3 usually cannot be achieved at the same time: in general very user-friendly libraries tend to be a little bit slower.
In the following you can find my suggestions.
1. Vector/Matrix and linear algebra
I think that the Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page) and Blaze (https://code.google.com/p/blaze-lib/) libraries are very nice: they exploit the OO nature of C++ and therefore they are very easy to use. At the same time they are very fast. In particular, Eigen has also the possibility to solve linear systems using several types of decompositions and includes several useful classes and functions for image manipulation.
The Intel MKL libraries (which are the BLAS/LAPACK implementation provided by Intel) remain the best choice if you are mainly interested in speed and you are using Intel processors. Unfortunately they are not C++ and they are quite complex to use and the interface is not so easy. Please consider that they are written in FORTRAN but a C interface is provided.
You can have a more complete list of available libraries at the following address:
http://www.netlib.org/utk/people/JackDongarra/la-sw.html
2. Ordinary differential equations
There are several solvers for ordinary differential equations, but most of them are in FORTRAN (VODE, LSODE, RADAU, DASPK, etc.) or in C (CVODE). The only real C++ solver, at least to my knowledge, is ODEINT (http://headmyshoulder.github.io/odeint-v2/). I tried this library only for non-stiff problems and works very well, it is easy to use and very fast. A very good alternative (not completely C++) is the BzzMath library (http://homes.chem.polimi.it/gbuzzi/), very powerful for stiff-problems.
3. Large problems (requiring shared or distributed memory)
The best option, which is full C++, is Trilinos (http://trilinos.sandia.gov/). It provides a lot of classes and functions to manage vectors and matrices in parallel, to solve linear and non-linear systems, to solve ordinary differential equations and calculate eigenvalues, etc. The library is enormous and quite complex to use and can be used also in serial. A simpler alternative (which is simple C) is PETSc (http://www.mcs.anl.gov/petsc/).
We use GSL but I don't know how it compares with others. Can anyone explain its good and bad sides (as Alberto Cuoci did for other libraries)?
We, CoCoA, focus on exact/symbolic computations, but we now develop some hybrid algorithms as well.
ITK (medical image analysis)
POOMA (general purpose numerical analysis)
Open DX (visual programming, general purpose num analysis)
ImageJ (image analysis, works well with matlab and R)
R (numerical and statistics)
octave (general purpose library and matlab compatible environment)
cern ROOT (numerical and stat analysis)
...
The request appears to be for a library to accelerate image processing in a manner compatible with his work with Matlab. If that is the case, so far as I know, only OpenCV is a compiled image processing library which uses hardware accelerators on board the computer which also has a compatible call structure with Matlab.
If his request is for a numerical library which will accelerate his Matlab code after it is exported to C/C++, then he is limited to Boost and GNU Scientific if he is using Linux and Boost or Intel's accelerated numerical library if he's using Windows.
After C... C++ is the best choice to speed up image processing. Forget about C#, Java and Matlab.
while doing image processing the best library is OpenCv. You can integrat it with c++ and matlab too. it makes your work meaningful and saves time, openly available.
We also use CImg (http://cimg.sourceforge.net), for the purely image-related aspects (I/O, resizing, normalization, display on screen ...). It is a single template header, which makes its "install" very easy (at the cost of a slightly longer compilation time), and runs on Windows, Mac and Linux.
It handles 3D multichannel images of any data type, and the low-level data can be very conveniently accessed and passed to any library that would perform the intensive computations (BLAS, ATLAS, FFTW ...). Since we deal with "real-time", we developed in-house CUDA kernels and use other CUDA-based libraries for best performance.
If before you were using Matlab, probably lapack is a best choice. For me it was easier to start with CLapack http://icl.eecs.utk.edu/lapack-for-windows/clapack/index.html (OS Windows, IDE Visual Studio). But as you need to solve image processing tasks, may be some image processing library on base of math libraries would be easier (but usually you have just to spend more time on their compilation as they use aditional libraries). Among image processing that were not mentioned abouve are PCL and Nasa Vision Workbench, but they are a bit specifical ones.
Of course also ACML-AMD, INTEL-MKL for linear algebra, and ARPACK++ for eigenproblem
I think VXL should be one:
http://vxl.sourceforge.net
VXL (the Vision-something-Libraries) is a collection of C++ libraries designed for computer vision research and implementation. It was created from TargetJr and the IUE with the aim of making a light, fast and consistent system. VXL is written in ANSI/ISO C++ and is designed to be portable over many platforms. The core libraries in VXL are:
vnl (numerics): Numerical containers and algorithms. e.g. matrices, vectors, decompositions, optimisers.
vil (imaging): Loading, saving and manipulating images in many common file formats, including very large images.
vgl (geometry): Geometry for points, curves and other elementary objects in 1, 2 or 3 dimensions.
vsl (streaming I/O), vbl (basic templates), vul (utilities): Miscellaneous platform-independent functionality.
As well as the core libraries, there are libraries covering numerical algorithms, image processing, co-ordinate systems, camera geometry, stereo, video manipulation, structure recovery from motion, probability modelling, GUI design, classification, robust estimation, feature tracking, topology, structure manipulation, 3d imaging, and much more.
Libraries should be selected based on the task. For geometry related stuff, vxl, vul, vil are good.
For using higher level point processing PCL is better which can be ported to mobile platforms using ROS.
For features OpenCV, VLfeat is good.
For optimization check the routines in NUmerical recipes
For vectors, matrix.. Eigen is recommended.
More specific libraries
NVIdia 3D vision processing using Cuda
CudaBlas, Cudafft, cudaSparse for Nvidia GPU
IMSL is a very good library too. I've been using it especially for eigenvector/eigenvalue problems, but it is not limited to that.I t covers all the major kind of problems and it is very fast.
What about using the new programming language "Halide" which is designed to make it easier to write high-performance image? http://halide-lang.org/
we used in our research, C++ programming and MATLAB both are giving same results on spectral clustering to obtain the eigenvalue latent roots time complexity
Maybe Matlab uses Lapack-Blas for linear algebra, Arpack for eigenproblem and many other libs as you can see in the manual.
Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page)
LAPACK (http://www.netlib.org/lapack)
I use PETSC (http://www.mcs.anl.gov/petsc/), which can be compiled with OpenMPI or MPICH, on Linux, of course (or on Windows using Cygwin, but I've no success to do it). For visualization and image processing, the best choice is VTK (http://www.vtk.org/).
http://www.simunova.com/mtl4 gives an extension of boost for the linear algebra
I'm just a fresh sudent so I know nothing.
I think Github is a good website about program.
I agree with Albert Cuoci (that it depends upon what type of math, etc.) and Daniele Panetta (that you should look at licensing), and would like to add that you MAY need to consider (in addition) other factors, such as:
Is "the fastest" speed important? (will you be crunching through monstrous amounts of graphical data and don't want to wait a week for answers...). Packages vary in optimization - several have been optimized for particular platforms, and specialize in image processing. Some will benefit by using multiple cores - so faster - and others will not, etc. IF you are using a "modern" Intel processor (multiple cores), Intel provides free for non-commercial use a highly optimized multi-threaded MKL( https://software.intel.com/en-us/intel-mkl/details ) and Matlibh is supported (. https://software.intel.com/en-us/articles/using-intel-mkl-with-matlab ). Depending upon which operating system, etc., this may work for you (graphics paper - from 2013, so not brand new - http://static.ph.ed.ac.uk/dissertations/hpc-msc/2012-2013/Medical%20Image%20Processing%20on%20Intel%20Parallel%20Framework.pdf
There are several ones, for example:
Armadillo: http://arma.sourceforge.net/
Eigen: http://eigen.tuxfamily.org/index.php?title=Main_Page
Dlib: http://dlib.net
Boost (Math and numerics): http://www.boost.org/doc/libs/1_64_0/?view=category_math
In many cases, you could still optimize you code in Matlab to run almost as fast as native C++ code. For instance, you could replace loops by vector expressions (sources are abundant). Another option is to profile your code to see where bottlenecks are (look up "Matlab profiler").
Armadillo 8.3 now is providing good support to MKL. I like Armadillo because it is a c++ template library mimics a lot of features in Matlab. For solving differential equations you may consider other solver libraries like cusparse (GPU), pardiso (CPU), superLU (CPU+GPU), viennaCL (CPU+GPU), etc. Those solvers often embed support to multi-threading as well, like OpenMP. For further parallelism at multi-cup level you may need to consider MPI which has good support in c/c++
Since your application in Image Processing, OpenCV will be the best choice for you. It has lot's of functionalities inbuilt with some nice visualization front-ends.
The problem I felt in going with just a Numerical computation library is you will find it difficult to visualize the results immediately. And if you are a researcher, you will understand that fast way to iterate is more important than your code efficiency.
If you are still skeptical to use OpenCV for complete processing, you can try combining it with other LA packages - like Armadillo. I found armadillo very intuitive to code. You can find a more about armadillo+openCV in this thread: https://stackoverflow.com/questions/26973970/conversion-between-cvmat-and-armamat
And if you are ready to explore other programming languages, checkout Julia (https://julialang.org/). The syntax is very similar to Matlab and python, but this guy runs as fast as c++. Check out some benchmarks here: https://julialang.org/benchmarks/ . Julia is a language built for numerical computation. So porting you old code from Matlab will not be that difficult. Also checkout this: https://juliaimages.github.io/latest/
Good Luck,
vish
If you are familiar numpy, I recommend xtensor: https://github.com/QuantStack/xtensor.
Eigen is another good library for C++ computation.
Nevertheless, if you need something faster than eigen or xtensor and you are comfort with C++ programming, you can go through Armadillo with OpenBlass.
https://en.wikipedia.org/wiki/List_of_numerical_libraries
https://stackoverflow.com/questions/2982711/c-image-processing-libraries
The Boost template library is probably the best all around package you'll find, and includes timing and overhead measurement tools to wring out hte algorithms you build.
OpenCV has some usefull numerical functionality: https://opencv.org/
Take a look at this: https://www.amazon.com/Numerical-Recipes-Art-Scientific-Computing/dp/0521750334
hello
opencv is fast(C++)
but you can use python-opencv for many reason:
1-opencv-python=opencv-C++
2-python is simpler than C++
3-you can easily make GUI for your python-code
4-....etc
Hello. You can find a library for your application from the list:
C
C++
VISPACK is a standard visualization software library for manipulating level-set surface models
For a smooth transition form Matlab to C/C++ language .. and get an excellent speed up uses CUDA + Matlab
https://www.mathworks.com/help/images/image-processing-on-a-gpu.html
then, ... all the numerical libraries are being ported to CUDA ... eg cuSPARSE vs MKL, ... FFTW vs. MKL, etc.
A good list is here:
https://en.wikipedia.org/wiki/List_of_numerical_libraries
Armadillo + dlib
http://arma.sourceforge.net/
http://dlib.net/
https://www.gnu.org/software/gsl/
Free software under the GNU License. For C and C++.
Also Intel Math Kernel Library
https://software.intel.com/en-us/mkl
Open CV is the fastest library to solve your problems. C++ or you also can use python environment for opencv.
hello
best and fast library is opencv
you can use opencv in C++ and python
in python opencv+numpy is very practical
for algebraic problems you can use BLAS (it's parallel). openCV for image processing.
IMSL C Numerical Library provides mathematical and statistical functionality. IMSL C Numerical Library provides the essential building blocks needed to develop analytic tools.
If you are doing nonlinear optimization, you can check out Ipopt:
http://www.coin-or.org/Ipopt/
It is completely written in C++
author won the Wilkinson prize for numerical analysis
https://en.wikipedia.org/wiki/J._H._Wilkinson_Prize_for_Numerical_Software#2011
Using Matlab function file , you can you use any of the c library
it depends on image processing functions and requirements.
Try http://dlib.net/; free, easy to use and very fast for high performance computing.
Hello, Aissa Boulmerka
since you use image_processing you can use
#include
you can find it at
http://dlib.net/
as Oguz, Umut Salman tell you