Posted By

browny on 01/25/11


Tagged

opencv


Versions (?)

[OpenCV] IplImage Image pixel access method


 / Published in: C++
 

  1. // copy src image content to dst image
  2.  
  3. for (int j = 0; j < src->height; j++) {
  4.  
  5. uchar* pSrc = (uchar*) (src->imageData + j * src->widthStep);
  6. uchar* pDst = (uchar*) (dst->imageData + j * dst->widthStep);
  7.  
  8. for (int k = 0; k < src->width; k++) {
  9. for (int i = 0; i < 3; ++i) {
  10. pDst [3 * k + i] = pSrc [3 * k + i];
  11.  
  12. }
  13. }
  14. }

Report this snippet  

You need to login to post a comment.