The Unknown
The Unknown

Reputation: 19714

Fast Cross-Platform C/C++ Image Processing Libraries

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

My questions

Your input much appreciated.

Upvotes: 31

Views: 44218

Answers (11)

jcupitt
jcupitt

Reputation: 11190

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.

Upvotes: 3

ErmIg
ErmIg

Reputation: 4038

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.

Upvotes: 3

Dani van der Meer
Dani van der Meer

Reputation: 6207

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.

Upvotes: 14

Johann Gerell
Johann Gerell

Reputation: 25581

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!

Upvotes: 4

Darien Pardinas
Darien Pardinas

Reputation: 6186

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.

Upvotes: 3

Biga
Biga

Reputation: 571

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.

Upvotes: 1

mloskot
mloskot

Reputation: 38912

There are also:

Upvotes: 1

RED SOFT ADAIR
RED SOFT ADAIR

Reputation: 12218

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.

Upvotes: 0

mem64k
mem64k

Reputation: 748

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

Upvotes: 2

RBerteig
RBerteig

Reputation: 43336

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.

Upvotes: 2

CiNN
CiNN

Reputation: 9870

imagemagick is quite popular.

Upvotes: 10

Related Questions