简体   繁体   English

数学问题:三角形,金字塔,旋转,平移,缩放

[英]Mathematical Issue: Triangle, Pyramid, Rotation, Translation, Zoom

Another tricky question. 另一个棘手的问题。 What you can see here is my physical pyramid built with 3 leds which form a triangle in 1 plane and another led in the mid center, about 18mm above the other 3. The 4th one makes the triangle to a pyramid. 你在这里可以看到的是我的物理金字塔,它由3个LED组成,在1个平面上形成一个三角形,另一个在中间的中心,在另一个上方约18mm处。第四个使三角形成为金字塔。 (You may can see it better if you look on the right triangle. This one is rotated about the horizontal achsis, and you can see a diode on a stick very well). (如果你看一下正确的三角形,你可能会看到它更好。这一个绕水平方向旋转,你可以很好地看到一个二极管上的二极管)。

示例三角形

The second picture shows my running program. 第二张图显示了我正在运行的程序。 The left box shows the raw picture of the leds (photo with ir-filter). 左侧框显示LED的原始图片(带有红外滤镜的照片)。 The picture in the center shows that my program found the points and is also able to tell which point is which, based on some conditions (like C is always where the both lines with maximal distance betweens diodes intersect; and the both longest lengths are always a and b). 中心的图片显示我的程序找到了点并且还能够根据某些条件判断哪个点是哪个点(比如C总是二极管之间的最大距离相交的两条线;两个最长的长度总是a和b)。 But dont care about this, i know the points are 100% correctly found. 但不关心这一点,我知道这些点是100%正确找到的。

Then on the right picture are some calculated values, like the height between C and c and so on. 然后右边的图片是一些计算值,比如C和c之间的高度等等。 I would be able to calculate more, but i didnt bother to care for now, cause I am stuck. 我可以计算更多,但我现在没有理会,因为我被卡住了。

I want to calculate the pyramids rotation and translation in the 3 dimensional space. 我想计算三维空间中的金字塔旋转和平移。

The yellow points are the leds after rotation arround an axis throught the center of the triangle in camera z- direction. 黄色点是在相机z方向上穿过三角形中心的轴旋转后的LED。 So now i do not have to worry about this, when calculating the other 2. The Rotation arround the horizontal axis, and the rotation arround the vertical axis. 所以现在我不必担心这个,在计算另一个时2.旋转围绕水平轴,旋转围绕垂直轴。 I could easily calculate this with the lengths of the distance from the center of the triangle to the 4th diode (as you can see the 4th diode moves on the image plane with rotation), or the lengths of the both axes. 我可以很容易地计算出从三角形中心到第四个二极管的距离的长度(你可以看到第四个二极管在图像平面上随着旋转移动),或两个轴的长度。

But my problem is the unknown depth. 但我的问题是未知的深度。

It affects all lengths (a,b,c, and also the lengths from the center to the 4th diode if we call this d and e). 它会影响所有长度(a,b,c,以及从中心到第4个二极管的长度,如果我们称之为d和e)。 I know the measurments of the real pyramid, with a tolerance of +-5% or so, but they get also affected by the zoom. 我知道真金字塔的测量值,公差为±5%左右,但它们也受到变焦的影响。 So how do i deal with this? 那我该怎么处理呢?

I thought of an equation with a ratio between something with the lengths of the horizontal axis, the length of the vertical axis, the angles alpha, beta and gamma, and the lengths d and e. 我想到了一个方程式,其中某个东西与水平轴的长度,垂直轴的长度,角度α,β和γ以及长度d和e之间的比率。

Alpha, beta and gamma only get affected by rotation arround the axes (which i want to know. i want to know the rotation and the zoom), where a rotation arround one axis has the opposite effect than a rotation arround the other. Alpha,beta和gamma只受到轴周围旋转的影响(我想知道。我想知道旋转和变焦),其中一个轴的旋转与另一个轴的旋转相反。 So if you rotate arround both axes in the same angle, the ratio between the length of the axes is the same as before. 因此,如果以相同的角度旋转两个轴,则轴的长度与之前的比率相同。

The zoom (real: how close it is to the camera; what i want to know in 1st place: multiplication factor 2x, 3x,0.5, 0,4322344,.....) does not affect the angles, but all the lengths: a,b,c,d,e,hc (vertical length of axis), hx (i have not calculated it yet, but it would be easy. the name hx can vary, i just thought of something random right now; it is the length of the horizontal axis) in the same way (i guess). 变焦(真实:它与相机的接近程度;我想知道的第一位:乘法因子2x,3x,0.5,03432344,......)不影响角度,但所有长度:a,b,c,d,e,hc(轴的垂直长度),hx(我尚未计算它,但它很容易。名称hx可以变化,我只想到现在随机的东西;它是水平轴的长度)以同样的方式(我猜)。

You see i have thought of many, but i think i am too dumb. 你看我想到了很多,但我觉得我太笨了。

So, is there any math genius out there wo can give me the right equations, for either the rotation OR/AND the zoomfactor? 那么,有没有任何数学天才可以给我正确的方程式,对于旋转OR /和zoomfactor?

(i also thought about using Posit/Downhill- Simplex, and so on, but this would be the nicest, since i already know so much, like all Points, and so on and so on) (我也考虑过使用Posit / Downhill- Simplex,等等,但这将是最好的,因为我已经知道了很多,像所有点,等等)

Please, please, i need your help really bad! 拜托,拜托,我需要你的帮助真的很糟糕! I am writing this in C++ and with help of OpenCV if you need to know, but i think its more a mathematical problem. 如果你需要知道的话,我用C ++编写并在OpenCV的帮助下编写,但我认为这更像是一个数学问题。

Thanks in advance! 提前致谢!

Ah, and Alpha seems to be always the same as Beta! 啊,Alpha似乎总是和Beta一样!

Edit: Had to delete the second picture 编辑:不得不删除第二张图片

看看Boost Geometry还是这里

Have a look at SolvePnP() in OpenCV. 看看OpenCV中的SolvePnP() Even if you don't use it directly, the documentation has citations for the methods used. 即使您不直接使用它,文档也会引用所使用的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM