we know that one of the richest library for image manipulating is ImageMagick, but its document specially in Magick++ is not as rich as its library. by the way, this is my first experience to use ImageMagicK and Opencv. if you want to convert from IplImage to Image and vice versa, just put these two funtion inside you source file.
Code: Select all
Image Ipl2Magick(IplImage* iplImage)
{
Image mgk(iplImage->width, iplImage->height, "BGR", CharPixel, (char *)iplImage->imageData);
return mgk;
}
Code: Select all
void Magick2Ipl(Image magicImage, IplImage* cvImage)
{
int width= magicImage.size().width();
int height = magicImage.size().height();
byte* blob= new byte[cvImage->imageSize];
magicImage.write(0,0, width, height, "BGRA", MagickCore::CharPixel, blob);
memcpy(cvImage->imageData, blob, cvImage->imageSize);
delete [] blob;
}
Code: Select all
IplImage* cvimg = cvCreateImage(cvSize(...,...), IPL_DEPTH_8U, 4);