Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mat image; // in my code I am reading image as Mat so need to convert it to IplImage
- image = imread(inFileName, CV_LOAD_IMAGE_COLOR);
- IplImage* imgIpl = new IplImage(image);
- // You have to supply the dimension of the image to hold the pixels:
- gil::rgb8_image_t img(imgIpl->width, imgIpl->height);
- // A view concept does not copy pixels at all. All gil algorithms operates on view by the way.
- gil::rgb8_view_t imgView = gil::interleaved_view(imgIpl->width, imgIpl->height, (gil::rgb8_pixel_t*)imgIpl->imageData, imgIpl->width*3);
- // To copy data use:
- gil::copy_pixels(imgView, gil::view(img));
Advertisement
Add Comment
Please, Sign In to add comment