5

Is there any way to convert OpenGL's GLuint texture type to OpenCV's cv::Mat ?

XterNalz
  • 325
  • 1
  • 5
  • 10
  • I have got just the oposite function, texture2opencvMat, if you are interested http://stackoverflow.com/q/9126002/744859 – Jav_Rock Aug 28 '12 at 07:40

1 Answers1

6

You may want to take a look at this question which asks about converting from glReadPixels into a cv::Mat, which is exactly the same problem when using glGetTexImage instead of glReadPixels.

My answer to this question explains how to directly read the texture data into the cv::Mat's storage with all possible pitfalls (like padding, color ordering, ...).

Community
  • 1
  • 1
Christian Rau
  • 45,360
  • 10
  • 108
  • 185