将OpenGL纹理转换为OpenCV Mat [英] Convert OpenGL texture to OpenCV Mat
本文介绍了将OpenGL纹理转换为OpenCV Mat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以将OpenGL的GLuint texture
类型转换为OpenCV的cv::Mat
吗?
Is there any way to convert OpenGL's GLuint texture
type to OpenCV's cv::Mat
?
推荐答案
您可能想看看这个问题询问有关从glReadPixels
转换为cv::Mat
的问题,这在使用 glGetTexImage
而不是glReadPixels
.
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
.
我对这个问题的回答解释了如何直接将纹理数据全部读取到cv::Mat
的存储中可能的陷阱(例如填充,颜色排序等).
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, ...).
这篇关于将OpenGL纹理转换为OpenCV Mat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文