Posted By

browny on 01/28/11


Tagged

opencv


Versions (?)

[OpenCV] Copy SubImage from IplImage using ROI


 / Published in: C++
 

URL: http://nashruddin.com/OpenCV_Region_of_Interest_(ROI)

  1. void getSubImg(IplImage* img, IplImage* subImg, CvRect roiRect) {
  2.  
  3. cvSetImageROI(img, roiRect);
  4. subImg = cvCreateImage(cvGetSize(img), img->depth, img->nChannels);
  5. cvCopy(img, subImg, NULL);
  6. cvResetImageROI(img);
  7.  
  8. }

Report this snippet  

You need to login to post a comment.