1 | initial version |
probably easier, to retrieve the pixels from the opengl context, than from the highgui window:
Mat screen(h,w,CV_8UC3);
glReadPixels (0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, screen.data);
2 | No.2 Revision |
probably easier, to retrieve the pixels from the opengl context, than from the highgui window:
Mat screen(h,w,CV_8UC3);
glReadPixels (0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, screen.data);
(i'm not sure, but w might need to be a multiple of 4 for this)