0
点赞
收藏
分享

微信扫一扫

等距圆柱投影

1 理论部分

符号说明

符号含义
λ \lambda λ经度
ϕ \phi ϕ纬度
ϕ 1 \phi_1 ϕ1标准纬线
ϕ 0 \phi_0 ϕ0中心经线
λ 0 \lambda_0 λ0中心纬线
x x x平面横坐标
y y y平面纵坐标
R R R球体半径

1.1 Forward 投影

从球的表面投影到平面。

x = R ( λ − λ 0 ) c o s ϕ 1 y = R ( ϕ − ϕ 0 ) \begin{aligned} x&=R(\lambda-\lambda_0)cos\phi_1 \\ y&=R(\phi-\phi_0) \end{aligned} xy=R(λλ0)cosϕ1=R(ϕϕ0)

1.2 Reverse 投影

从平面投影到球表面。
λ = x R c o s ϕ 1 + λ 0 ϕ = y R + ϕ 0 \begin{aligned} \lambda&=\frac{x}{Rcos\phi_1}+\lambda_0 \\ \phi&=\frac{y}{R}+\phi_0 \end{aligned} λϕ=Rcosϕ1x+λ0=Ry+ϕ0

1.3 标准纬线

标准纬线是圆柱与球体相切或相割的纬线。

StandardParallelSecantCylindrical

对于全景图片(视频)来说,标准纬线为赤道。此时 c o s ϕ 1 = 1 cos\phi_1=1 cosϕ1=1

幻灯片1

1.4 极坐标转直角坐标

1.4.1 表示图

tmp

1.4.2 Python 代码

import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as p3d
import math
from PIL import Image

fig = plt.figure()
ax = p3d.Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)

z = []
x = []
y = []
c = []
img = Image.open('000.png')
img_array = np.array(img, dtype=np.float) / 255.0
N, M, C = img_array.shape

r = (N / math.pi + M / (2 * math.pi)) / 2
for j in range(N):
    for i in range(M):
        theta = j / N * math.pi
        phi = (i - (M - 1) / 2) / M * 2 * math.pi
        x.append(r * math.sin(theta) * math.cos(phi))
        y.append(r * math.sin(theta) * math.sin(phi))
        z.append(r * math.cos(theta))
        c.append((img_array[j, i, 0], img_array[j, i, 1], img_array[j, i, 2]))

ax.scatter(x, y, z, c=c)
plt.show()

2 效果展示

2.1 原图

2.2 效果图

为展示方便,绘制在了球体外表面。

000_360_1
000_360_2

2.3 稀疏图

外表面。
000_360_1
000_360_2

2.3 稀疏图

Figure_1

举报

相关推荐

0 条评论