Search code examples
c++image-processingimagemagickintel-ipp

How to use the Intel IPL library in ImageMagick and How to convert from IPL to ImageMagick?


I've just got a intel ipl library(ipl21.dll on the web). Now I'd like to build with ipl library with vc++2010. But there is not anywhere some example like how to build and apply image processing with ipl library.(I found document but it does not help me)

Would you please help me how to build ipl library with vc++2010, also some example like how to use ipl library in image processing.

Especially, I am working on ImageMagick. So firstly I read a image file by ImageMagick library. It is works well. Additionally I want to use ipl libray to image processing from readed image data.

Especially, I want to know that how to use ipl library from ImageMagick read data. Then after processing done, how to convert from ipl to ImageMagicK ?


Solution

  • I do not know the history for sure, and I am happy to be corrected... but I believe OpenCV is based on, and can do everything that IPL used to do, including SSE[23]/MMX/CUDA etc. It seems to me you might be better off ditching ImageMagick and IPL and replacing both with OpenCV - or exploring the OpenCL algorithms in ImageMagick. Hopefully others will comment and enlighten us.

    Anyway, if you have loaded an image using ImageMagick and you want access to the bitmap data (pixels), so you can put them into an IPL data-structure, the easiest is probably something like this:

    #include <cstdlib>
    #include <iostream>
    #include <Magick++.h>
    
    using namespace std;
    
    int main ( int argc, char *argv[] )
    {
       // Initialize ImageMagick
       Magick::InitializeMagick(*argv);
    
       int row,col;
       Magick::Image image;
       int bytes=512*512*3;           // I happen to know Lena is 512x512 and RGB - i.e. 3 bytes/pixel
       unsigned char buffer[bytes];
    
       // Read in Lena
       image.read("lena.png");
    
       // Convert Lena to a bunch of bytes
       image.write(0,0,512,512,"RGB",Magick::CharPixel,buffer);
    
       // Now "buffer" points to the raw pixels and you can put them into IPL structures