将OpenGL纹理转换为OpenCV Mat [英] Convert OpenGL texture to OpenCV Mat

查看:456
本文介绍了将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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆