31

What are some cross platform and high performance image libraries for image processing (resizing and finding the color/hue histograms). No gui needed. This is for C/C++.

So far I have looked in to

  • OpenCV
  • GIL as part of Boost
  • DevIL
  • CImg

My questions

  • How's the performance of the ones I have listed above
  • What are some other libraries

Your input much appreciated.

The Unknown
  • 19,224
  • 29
  • 77
  • 93
  • 2
    IMHO, this question is imprecise. Do you expect to get analysed library vs library performance? It's nearly impossible without asking more specific questions. Instead, it would be more reasonable to ask for comparison of implementation of specific algorithms implemented in those libraries you are interested in. – mloskot Jan 23 '10 at 20:44

11 Answers11

13

OpenCV has quite good performance. It should be sufficient for most cases.

To improve performance, you can also use OpenCV together with Intel IPP, which is however a non-free commercial product. If OpenCV detects that IPP is installed it will use it where possible.

As a third option you can use IPP directly. IPP was designed with high performance (on Intel architectures) as a goal. It is optimized to use the intel SIMD instructions.

Dani van der Meer
  • 6,169
  • 3
  • 26
  • 45
10

imagemagick is quite popular.

CiNN
  • 9,752
  • 6
  • 44
  • 57
4

I help maintain libvips, a free, cross-platform C/C++ scientific image-processing library. It is fast and works well on very large images.

I did a very simple benchmark: load a 10,000 x 10,000 pixel RGB tif, crop 100 pixels off every edge, shrink 10%, sharpen, and save again. On this trivial test at least, vips is more than twice as fast as anything else I've tried.

The C++ API is documented here. For example:

#include <vips/vips8>

using namespace vips;

int
main( int argc, char **argv )
{
        // startup, load plugins, init support libraries, etc.
        if (VIPS_INIT(argv[0]))
                vips_error_exit(NULL);  

        // the "sequential" access hint means we plan to only read this image
        // top-to-bottom (eg. no 90 degree rotates) ... this means libvips can 
        // stream the image and run decode and processing in 
        // parallel on separate threads
        VImage image = VImage::new_from_file(argv[1],
                VImage::option()->set("access", "sequential")); 

        // shrink to 20% and find the histogram
        VImage hist = image.resize(0.2).hist_find(); 

        hist.write_to_file(argv[2]);

        return 0;
}

You can run this program with any input and output image format, for example:

$ g++ -g -Wall resize.cpp `pkg-config vips-cpp --cflags --libs`
$ ./a.out ~/pics/wtc.jpg x.csv

And it'll read the JPG input and write the histogram to the CSV file.

jcupitt
  • 10,213
  • 2
  • 23
  • 39
  • what would be the faster alternative to OpenCV's `warpPerspective` from your library? `vips_quadratic`? To get an idea of `warpPerspective`, take a look here: http://imgur.com/a/yiF55, see the logo_warped image. That's what it does with a transformation matrix from one set of corners to other (homography matrix). Thanks. – bad_keypoints Oct 08 '15 at 11:19
  • That's correct, `vips_quadratic()` can do a perspective warp. I'll make you an example program. – jcupitt Oct 08 '15 at 12:04
  • Ooop, I think `vips_quadratic()` is unfinished and unusable, for your use anyway, hence the lack of docs. Sorry. I'll add a note to the TODO that it needs sorting out. – jcupitt Oct 08 '15 at 16:38
4

I don't think I've seen anything better in features and performance than HALCON from MVTec. It provides all sort computer vision and image processing algorithms out-of-the-box and plenty of real life examples. The library uses multithreading as much as algorithms could possibly allow and GPU when available. It's very cross-platform and provides a fantastic IDE that will allow you to export your prototype code (algorithm) to many languages including C, C++, C# and more.

One of the best features of this library is how they treat region objects. It is just incredibly smart and efficient both for storage and mask processing. Unfortunately OpenCV has a lot to learn from it.

The main problem with this package is the price (stupidly high) but if you are working on a project where you don't need to deploy runtime licenses (e.g. SaaS) then this is the way to go, look no further if you require serious image processing and computer vision.

Darien Pardinas
  • 5,910
  • 1
  • 41
  • 48
4

Don't forget to look at CxImage - I've used it professionally in globally deployed graphics intensive mobile phone applications, where it performed perfectly and it's so full of features. Do check it out!

stakx - no longer contributing
  • 83,039
  • 20
  • 168
  • 268
Johann Gerell
  • 24,991
  • 10
  • 72
  • 122
3

There is a simple and free open source cross-platform image processing library Simd. As follows from its description:

It provides many useful high performance algorithms for image processing such as: pixel format conversion, image scaling and filtration, extraction of statistic information from images, motion detection.

The algorithms are optimized with using of different SIMD CPU extensions: SSE, SSE2, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX-512 for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC, NEON for ARM.

Akira
  • 213
  • 2
  • 11
ErmIg
  • 3,980
  • 1
  • 27
  • 40
2

You might want to look at IM. It builds on several platforms, and has support for (modular) image file formats, a variety of image representations, and a wide array of transformations and operators. A GUI tool, IMLab, for demonstrating image processing operators based on the IM library is also available.

RBerteig
  • 41,948
  • 7
  • 88
  • 128
2

There are also VTK and ITK, with a huge amount of manifold image processing algorithms.

mem64k
  • 748
  • 1
  • 11
  • 25
  • VTK and ITK are very solid dependable libraries, however in my experience I have found these highly templated libraries a bit laborious to work with. The 800 something page manual also is a bit daunting at first, however the algorithms included tend be from centers of research so are often state of the art. I cannot compare on performance thou, as I have no used any other library. I found it to OK. – binarycreations Apr 28 '10 at 23:58
1

There are also:

mloskot
  • 37,086
  • 11
  • 109
  • 136
1

ExactImage is a fast C++ image processing library. Unlike many other library frameworks it allows operation in several color spaces and bit depths natively, resulting in low memory and computational requirements.

Biga
  • 531
  • 4
  • 9
0

We used Accusoft for quite a while, but for very specific reasons we switched to LeadTools, which exists for windows only. Accusoft has a very clear and much more well defined interface than leadtools. Both libraries are very robust and both claim to read more or less all existing file types. Both also have quite responsive support.

RED SOFT ADAIR
  • 12,032
  • 10
  • 54
  • 92