We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
混合 OpenGL 和 OpenCV 没有什么困难。这些只是两个库,一个用于图形,另一个用于计算机视觉。没有重叠,因此您可以将两者都包含在您的项目中。
然后应该是渲染一些矩形或盒子(或者您希望使用 OpenCV 定位的任何内容) - 有很多相关教程,然后使用 glReadPixels() 函数将渲染数据复制到客户端内存并传递该数据到 OpenCV。
没有教程很可能是因为它太简单了...
您可以:
如果您对默认 OpenGL 窗口感到满意,则可以使用
Init(false)
。如果您想要奇特的位深度和模板缓冲区等等,请使用操作系统的窗口句柄自行初始化 OpenGL。确实有很多教程可以做到这一点。There is nothing difficult in mixing OpenGL and OpenCV. These are just two libraries, one for graphics and the other for computer vision. There is no overlap so you can just include both in your project.
Then it should be a matter of rendering some rectangle or a box (or whatever you wish to locate using OpenCV) - there are plenty of tutorials for that, and then copying the rendered data using the glReadPixels() function to client memory and passing that to OpenCV.
There is no tutorial most likely because it is so simple ...
You can just:
If you're happy with default OpenGL window, you can use the
Init(false)
. If you want fancy bit depths and stencil buffers and whatnot, initialize OpenGL yourself using the OS' window handle. There are really really many tutorials for doing that.