我是靠谱客的博主 务实寒风,这篇文章主要介绍python画球面投影_Python中球面投影图像的高程畸变,现在分享给大家,希望可以做个参考。

我的解决方案不能满足您的所有要求。但首先,这可能是一个很好的开端。在import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

import numpy as np

from matplotlib.cbook import get_sample_data

from matplotlib._png import read_png

# Use world image with shape (360 rows, 720 columns)

pngfile = 'temperature_15-115.png'

fn = get_sample_data(pngfile, asfileobj=False)

img = read_png(fn) # get array of color

# Some needed functions / constant

r = 5

pi = np.pi

cos = np.cos

sin = np.sin

sqrt = np.sqrt

# Prep values to match the image shape (360 rows, 720 columns)

phi, theta = np.mgrid[0:pi:360j, 0:2*pi:720j]

# Parametric eq for a distorted globe (for demo purposes)

x = r * sin(phi) * cos(theta)

y = r * sin(phi) * sin(theta)

z = r * cos(phi) + 0.5* sin(sqrt(x**2 + y**2)) * cos(2*theta)

fig = plt.figure()

fig.set_size_inches(9, 9)

ax = fig.add_subplot(111, projection='3d', label='axes1')

# Drape the image (img) on the globe's surface

sp = ax.plot_surface(x, y, z,

rstride=2, cstride=2,

facecolors=img)

ax.set_aspect(1)

plt.show()

结果图像:

最后

以上就是务实寒风最近收集整理的关于python画球面投影_Python中球面投影图像的高程畸变的全部内容,更多相关python画球面投影_Python中球面投影图像内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(127)

评论列表共有 0 条评论

立即
投稿
返回
顶部