Skip to content

Instantly share code, notes, and snippets.

@nibasya
Created October 29, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nibasya/99fc6fd07426030a3b697c18ef6e9ff3 to your computer and use it in GitHub Desktop.
Save nibasya/99fc6fd07426030a3b697c18ef6e9ff3 to your computer and use it in GitHub Desktop.
CImage img;
cv::Mat tmp;
int i;
size_t matPitch;
uchar *pTmpData;
BYTE *pImgData;
matPitch = tmp.cols*tmp.elemSize();
pTmpData = tmp.data + (img.GetHeight()-1)*matPitch;
pImgData = (BYTE*)img.GetBits();
for (i = 0; i < img.GetHeight(); i++, pTmpData -= matPitch, pImgData += img.GetPitch())
memcpy(pTmpData, pImgData, matPitch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment