There is nothing complicated in mixing OpenGL and OpenCV. These are just two libraries, one for graphics and one for computer vision. There is no overlap, so you can just include both in your project.
Then this should be a matter of rendering some rectangle or rectangle (or what you want to find using OpenCV) - there are a lot of tutorials for this, then copying the rendered data using the glReadPixels () function to client memory and passing that to OpenCV.
No textbook, most likely, because it's that simple ...
the swine
source share