的平面投影到圆柱体 [英] Projection of a plane onto a cylinder

查看:284
本文介绍了的平面投影到圆柱体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个普通的位图,我想做一个投影上的圆柱体。

I have a plain bitmap and I want to do a projection on a cylinder.

这意味着,我想变换一种方式的图像,这样,如果我打印出来,并环绕柱状缸和从某一个位置它拍照,生成的图像看起来像原来的。

That means, I want to transform the image in a way so that if I print it and wrap around a columnar cylinder and photograph it from a certain position, the resulting image looks like the original.

不过我很失去了所有的预测算法(即通常与地球预测)。

Still I'm quite lost in all the projection algorithms (that are often related to earth projections).

所以,我很感谢提示什么正确的算法可能会和哪些工具,我可以用它应用到我的形象。

So I'd be thankful for hints what the correct algorithm could be and which tools I could use to apply it to my image.

推荐答案

让说,你有lenght的矩形图像:L和高度:H

Let say you have a rectangle image of lenght: L and height: H .

和半径的圆柱体:R和高度H'

and a cylinder of radius : R and height H'

让A(X,Z)是在画面的一个点,

Let A (x,z) be a point in the picture,

A'(X',Y',Z')=(R * COS(X *(二皮音乐/ L)),R * SIN(X *(二皮音乐/ L)),Z *( H'/ H))将是你的A点的投影在你的汽缸。

Then A' (x',y',z') = ( R*cos(x*(2Pi/L)) , R*sin(x*(2Pi/L)) , z*(H'/H)) will be the projection of your point A on your cylinder.

证明:

1。 Z'= Z *(H'/ H)

我第一次适合气缸以图像的大小,这就是为什么我乘以   (H'/ H),和我保持相同的Z轴。 (如果你画它,你会看到它   立刻)

I first fit the cylinder to the image size , that's why I multiply by : (H'/H), and I keep the same z axis. (if you draw it you will see it immediatly)

2。 X'和y'?<​​/ STRONG>

2. x' and y ' ?

我项目中的每个行我的形象成一个圆圈。参数化   的圆的方程为(RCOS(吨),RSIN(t))的用于在吨[0,2PI],则   参数方程映射段(叔在[0,2PI])为圆。这是   正是我们正在努力做的事情。

I project each line of my image into a circle . the parametric equation of a circle is (Rcos(t), Rsin(t)) for t in [0,2PI], the parametric equation map a segment (t in [0,2PI]) to a circle . That's exactly what we are trying to do.

然后如果x描述了线的lenght L,X *(二皮)/ L describres一行   长二皮,我可以用参数方程绘制每点   这条线为圆。

then if x describes a line of lenght L, x*(2pi)/L describres a line of length 2pi and I can use the parametric equation to map each point of this line to a circle.

希望它可以帮助

在previous功能给函数preSS对一个气缸的平面上。

The previous function gave the function to "press" a plane against a cylinder.

这是一个双射,所以从缸中给定的点,你可以很容易地获得原始图片。

This is a bijection, so from a given point in the cylinder you can easily get the original image.

一个(X,Y,Z)从气缸

A(x,y,z) from the cylinder

A'(X',Z')的形象:

A'(x',z') in the image :

Z'= Z *(H / H')

z' = z*(H/H')

和X'= L /(二皮)* {ARCCOS(X / R)*(符号(Y))(MOD(二皮))}

and x' = L/(2Pi)* { arccos(x/R) *(sign(y)) (mod(2Pi)) }

(这是一个pretty的丑陋的公式,但就是这样:D,你需要前preSS模为正值)

(it's a pretty ugly formula but that's it :D and you need to express the modulo as a positive value)

如果您可以应用到你的圆筒形象你如何解开你的图片。

If you can apply that to your cylindrical image you get how to uncoil your picture.

这篇关于的平面投影到圆柱体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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