用于通过标记获取相机角度的库
我正在寻找类似于 ARToolKit 的库。它需要支持处理单个图像并搜索该图像的标记。如果它找到一个,我希望它返回基于标记的相机角度/视点。 我通过谷歌找不到任何东西,是否存在这样的东西?
I'm searching for a library similar to ARToolKit. It needs to support processing a single image and search that image for a marker. If it finds one I want it to return the camera angle / viewpoint based of the marker.
I couldn't find anything via Google, does something like this exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我回答这个问题是为了让任何遇到这个问题的人都不必做我所做的同样的研究。
显然,访问和处理单个图像不太符合增强现实的定义。还有另一个关键字我已经忘记了(抱歉),但如果你想使用谷歌,你不应该只关注与 AR 相关的软件。
为了解决我的问题,我使用了两种方法。第一个是将 ARToolKit 与 gstreamer 和 ffmpeg 一起使用。我使用 ffmpeg 将单图像转换为一秒视频,导出 ARTOOLKIT_CONFIG 字符串,然后使用 ARToolKit 渲染图像。这并不是很好,因为这是非常有限的,如果不解析 arttoolkit-opengl 输出,我就无法真正将渲染图像返回给我。
然而,我的第二种方法非常令我满意:我使用 OpenCV-Library 来检测标记。类似的示例可以在这里找到:http://dasl.mem。 drexel.edu/~noahKuntz/openCVTut10.html
然后我导出识别的相机参数并转换它们以适合 Irrlich-Engine 使用的矩阵(我也尝试过 Ogre,但 Irrlicht 对我来说似乎更好),然后将我的对象渲染到图像上。然后我可以使用 Irrlicht 的 transformDataToImage() 函数获得最终结果。
唯一的缺点是我必须运行 X-Server 才能获取渲染的图片,但我可以忍受。
Ps:不要用我上面提到的教程中的方形标记来尝试这个。由于明显的原因,不可能检测到标记的精确旋转。
I'm answering this so anyone stumbling across this problem / question doesn't have to do the same research I did.
Apparently, accessing and processing a single image doesn't quite fit the definition of augmented reality. There is another keyword for this which I already forgot (sorry), but in case you want to use google you should not focus on AR-related software only.
To solve my issue I used two approaches. The first one was to use the ARToolKit together with gstreamer and ffmpeg. I transformed my single-image into one second of video with ffmpeg, exported the ARTOOLKIT_CONFIG string and then rendered the image with ARToolKit. This wasn't really great as this is very limited and I can't really get the rendered image back to me without parsing the artoolkit-opengl output.
My second approach however satisfied me very much: I used the OpenCV-Library to detect a marker. An example for something like that can be found here: http://dasl.mem.drexel.edu/~noahKuntz/openCVTut10.html
I then exported the recognized camera-parameters and transformed them to fit the matrix's used by the Irrlich-Engine (I also tried Ogre but Irrlicht seemed nicer to me) and then rendered my object with it onto the image. I can then obtain the final result with Irrlicht's transformDataToImage() function.
The only downside is I have to have an X-Server running to get the rendered picture but I can live with that.
Ps: Don't try this with the square marker found in the tutorial I mentioned above. It isn't possible to detect the exact rotation of the marker out of obvious reasons.