BloodAxe

Untitled

Nov 8th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. Mat image; // in my code I am reading image as Mat so need to convert it to IplImage
  2. image = imread(inFileName, CV_LOAD_IMAGE_COLOR);
  3. IplImage* imgIpl = new IplImage(image);
  4.  
  5. // You have to supply the dimension of the image to hold the pixels:
  6. gil::rgb8_image_t img(imgIpl->width, imgIpl->height);
  7.  
  8. // A view concept does not copy pixels at all. All gil algorithms operates on view by the way.
  9. gil::rgb8_view_t imgView = gil::interleaved_view(imgIpl->width, imgIpl->height, (gil::rgb8_pixel_t*)imgIpl->imageData, imgIpl->width*3);
  10.  
  11. // To copy data use:
  12. gil::copy_pixels(imgView, gil::view(img));
Advertisement
Add Comment
Please, Sign In to add comment