1

Hi I am using Intel IPL library and ImageMagicK Library. When I firstly get image date from ImageMagicK I put the data to IPL. Then IPL can get image data.

When I display what I got a image data form IPL. I found the result image data is always flip verticalized. you can see as following the problem.

Here is the original image and then I've got a resulting image as shown.

But the result are all the same when I changed the options IPL_ORIGIN_TL, IPL_ORIGIN_BL.

the code like this.

    m_image.read(fileposition);

   IplImage* IPL_image = iplCreateImageHeader( 
      3,                            // number of channels
      0,                            // alpha channel
      IPL_DEPTH_8U,                 // data of byte type 
      "RGB", "BGR",                 // color model and channel seq
      IPL_DATA_ORDER_PIXEL,         // channel arrangement
      IPL_ORIGIN_TL,                // bottom left orientation
      IPL_ALIGN_DWORD,              // 4 bytes align
      m_image.columns(),
      m_image.rows(),                   // image width and height
      NULL,                         // ROI
      NULL, NULL, NULL              // no mask ROI, image ID, not tiled
   );

   iplAllocateImage(IPL_image,0,0);


    Magick2Ipl(m_image,IPL_image);

     ipView( IPL_image, "RGB", is_modal );



void Cmfc_test5Dlg::Magick2Ipl(Image magicImage, IplImage* cvImage)
{
   int width= magicImage.size().width();
   int height = magicImage.size().height();
   int buff_size = width*height*3;
   unsigned char* buffer = new unsigned char[buff_size];

   magicImage.write(0,0, width, height, "BGR", Magick::CharPixel, buffer);

   memcpy(cvImage->imageData, buffer, cvImage->imageSize);
  delete[] buffer;
}

What am I missing ? Does anyone know what should I do for solving? Why the result image are always vertical flipping?

bural
  • 61
  • 2
  • 11

0 Answers0