增强现实 - 图像尺寸转换 [英] Augmented reality - Image size transform

查看:155
本文介绍了增强现实 - 图像尺寸转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的一个应用程序,将显示在相机视图(基本上是一个增强现实)的图像,但发现该图像不会出现真实的。这样做的原因是因为我的图片大小不改变以同样的方式,事情在现实生活中做的。

I am currently working on an app that will display images on the camera view (basically an augmented reality), but are finding that the images don't appear "real". The reason for this is because the size of my images do not change the same way that things in real life do.

我的数据是:图像原始尺寸(高度,宽度),图像位置(经纬度,长,ALT),手机的位置为此手机和图像之间的距离

The data I have is: the image original size (height,width), image location (lat,long, alt), the phone location an therefor the distance between the phone and the image.

例如,假设我把图像的增强现实的纬度= 43,长= -70,ALT = 0。如果我开始走路更接近这一点上我的电话,我们应该看到的图像越来越大,因为我们接近,但就现在的规模增长是线性的。然而,正如我们开始步行更接近图像在现实生活中,我们将看到它变得更大,根据一个特定的功能。

For example, let's say I placed an image in augmented reality at lat = 43, long = -70, alt = 0. If I started walking closer to this point with my phone, we should see the image getting larger as we get closer, but as of right now that increase in size is linear. However, as we started walking closer to the image in real life we would see it getting bigger according to a specific function.

任何想法,什么功能可能是什么?

Any ideas as to what that function might be?

推荐答案

免责声明:这是所有在我看来,我没有确切的功能

Disclaimer: This is all in my opinion and I do not have exact functions.

第1步:视口假设

什么,你需要考虑的视域。走路时,你有视觉的区域。让我们通过考虑看时,一般的人不使用它们的周边视力简化这种情况下(为简单起见,显然这不是在现实生活中真)。考虑到期待的时候,您可以查看180度 - 并且没有外设,让我们假设由左,右45度被删除。这将present视口是宽90度时,在其底部观看者会看出来以直角三角45度到左侧,和45度到右侧。请注意,这一切都不是测量或纯粹的科学,但对于制作增强现实的某些假设可以使处理更容易。

What you need to consider is a viewport. When walking, you have an area of vision. Let us simplify this scenario by considering that when looking, the average person does not use their peripheral vision (for simplicity, obviously this is not true in real life). Considering that when looking forward, you view 180 degrees - and without peripheral, let us assume that 45 degrees from both left and right are removed. This is going to present a viewport which is 90 degrees wide, at its base the viewer will look out at a right angle triangle 45 degrees to the left, and 45 degrees to the right. Please note that none of this is measured or purely scientific, but for making augmented-reality certain assumptions can make processing a lot easier.

第2步:造福视口

现在,基于视窗的previous定义 - 思考这一观点的一部分,从一个大的距离的物体将占据。这实际上就可以开始产生真正的数学:)!当你关闭时,对象将获得更大,因为它占用的观点的较大部分。该对象占用的视图的一部分是要的物体的尺寸和视图的大小之间的关系。在这种情况下,视图的大小是视区的弧长!

Now, based on the previous definition of the viewport - consider what part of that view an object from a large distance will occupy. This can actually begin to generate real math :)! As you close in, the object will get bigger because it takes up a larger part of the view. The part of the view that the object takes up is going to a relation between the size of the object and the size of the view. In this case, the size of the view is the arclength of the viewport!

第三步:一些数学

让我们再作假设,以简化这个过程。让我们假设,并不是把真实的弧,我们认为视口的斜边。当从远处的ð,以90度的观点看,视口的斜边将

Let us make another assumption to simplify the process. Lets assume that instead of viewing the real arc, we view the hypotenuse of the viewport. When looking from a distance d, with a view of 90 degrees, the hypotenuse of the viewport will be

hypotenuse = 2.83 * d
//Note: 2.83 is approx. 2 * sqr. root of 2

第四步:结论和应用

所以,如果你是从一个物体站立100英尺,那么你的视口将是283英尺。如果对象,例如汽车的前部,占用6英尺,那么这将是仅二百八十三分之六= 2%的完整视图的

So if you are standing 100 feet from an object, then your viewport is going to be 283 feet. If the object, such as the front of a car, takes up 6 feet, then that would be only 6/283 = 2% of the full view.

不过,如果你是从同一辆车站在50英尺,则关系将是众目睽睽的一百四十一分之六= 4%。

However, if you are standing 50 feet from that same car, then the relation would be 6 / 141 = 4% of the full view.

您可以看到,这是明显的线性关系。如果您知道是什么物体的大小(可以调用取值),那么该视图的百分比,应该采取将

You can see that this is clearly a linear relationship. If you know what the size of the object is (lets call that s), then the percent of the view that should take would be

view % = s / 2.83d

还什么这里示出的是,确定所述对象的大小是非常重要的,并可能很难从只是一个单一的.JPG图像来推断。我能有这是2500px由2500px大小5足球图片。难道说,这是巨大的?没有,但它看起来很大,如果它的大小只有假设是从总像素数。按照同样的思路,我可以有地球的100像素由100像素的图片,但我希望不会显示为微小的。

Also what is shown here is that determining the size of the object is very important and could be hard to infer from just a single .jpg image. I could have a picture of a size 5 soccer ball which was 2500px by 2500px. Does that mean that it is huge? No, but it would look huge if the only assumption of its size was from the total pixel count. Along the same lines I could have a 100px by 100px picture of earth but I would hope that doesn't show up as tiny.

解出对象的大小将产生的结果,允许一个用户接近的对象在增强现实。知道如何为用户接近缩放图像是相当琐碎。

Solving for the size of the object will yield results allowing for a user to approach an object in augmented reality. Knowing how to scale the image as a user approaches is rather trivial.

这篇关于增强现实 - 图像尺寸转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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