有没有办法使用 iPhone/iPad 相机计算 2D 环境中的 3D 距离/视角?
也许我在研究中问这个问题太早了,但我最好早点知道这是否可能。
想象一下,我在桌子顶部的纸上打印了以下正方形:
桌子是棕色的,所以它与正方形中的任何颜色都不匹配。有没有办法让我从普通的 iPhone 摄像头(非立体视图)计算出我观看表格中的正方形的距离和角度?
最后,我想要的是能够使用相机图像在此之上绘制一个 3D 正方形,但我不确定是否能够计算出该对象的距离和位置在太空中仅使用 2D 图像。任何提示都非常感谢。
Maybe I'm asking this too soon in my research, but I'd better know if this is possible sooner than later.
Imagine I have the following square printed on a paper on top of a table:
The table is brown, so it does not match with any of the colors in the square. Is there a way for me, from a common iPhone camera (non-stereo view), to figure out the distance and angle from which Im looking at the square in the table?
In the end what I'm looking for is being able to draw a 3D square on top of this one using the camera image, but I'm not sure if I am going to be able to figure out the distance and position of the object in space using only a 2D image. Any hints are well appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短回答:http://weblog.bocoup.com/javascript-augmented-reality
大回答:
首先进行色调分离,然后进行矢量化,利用您掌握的矢量,您可能需要执行一些数学技巧来根据矢量位置、透视图和相机位置进行定义。
也许这有帮助:
Short answer: http://weblog.bocoup.com/javascript-augmented-reality
Big answer:
First posterize, Then vectorize, With the vectors in your power you may need to do some math tricks to define, based on the vectors position, the perspective and then the camera position.
Maybe this help:
应该是有可能的扫描图像中的红色/蓝色/黄色图案,然后进行边缘检测以找出正方形的扭曲程度(除了直视视图之外,它们在任何情况下都是平行四边形)。距离取决于相机的变焦设置和扫描分辨率。但基本上你会计算每个方块中有多少个可见像素,然后根据相机的规格运行,你应该能够确定一个粗略的距离。
Oughta be possible. Scan the image for the red/blue/yellow pattern, then do edge detection to figure out how warped the squares are (they'll be parallelograms in anything but straight-on view). Distance would depend on the camera's zoom setting and scan resolution. But basically you'd count how many pixels are visible in each of the squares, run that past the camera's specs and you should be able to determine a rough distance.