当前位置: 首页 > news >正文

泰州高端网站建设如何收费网站301跳转怎么做

泰州高端网站建设如何收费,网站301跳转怎么做,网站建设网络推广广告语,微设计公司网站目录 1. 预测的3D轨迹和实际轨迹的动画图,同时动态更新 2 真值轨迹设置为静态的,预测轨迹不断更新 3 网格的三维坐标系有旋转运动,以此全方位展示预测轨迹和真值轨迹之间的空间关系 1. 预测的3D轨迹和实际轨迹的动画图,同时动态更…

目录

 1. 预测的3D轨迹和实际轨迹的动画图,同时动态更新

 2 真值轨迹设置为静态的,预测轨迹不断更新

 3 网格的三维坐标系有旋转运动,以此全方位展示预测轨迹和真值轨迹之间的空间关系


 1. 预测的3D轨迹和实际轨迹的动画图,同时动态更新

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation, PillowWriter# 假设您有两组连续平滑的姿势数据集,一组表示预测值,一组表示真值
# 每个数据点包含姿势信息 [x, y, z, roll, pitch, yaw]
# 这里使用一些示例数据,您需要替换为您的实际数据
num_poses = 200  # 增加轨迹点数
t = np.linspace(0, 20, num_poses)  # 时间点,使轨迹变得更长
# 生成示例数据来表示预测值轨迹
x_pred = np.sin(t)
y_pred = np.cos(t)
z_pred = np.linspace(0, 10, num_poses)
# 生成示例数据来表示真值轨迹
x_true = np.sin(t) + 0.5  # 真值轨迹稍微偏移
y_true = np.cos(t) + 0.5
z_true = np.linspace(0, 10, num_poses)# 创建一个 3D 图形
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')# 创建空的轨迹线,一个红色表示预测值,一个蓝色表示真值
line_pred, = ax.plot([], [], [], marker='o', linestyle='-', markersize=4, color='red', label='Predicted Trajectory')
line_true, = ax.plot([], [], [], marker='o', linestyle='-', markersize=4, color='green', label='True Trajectory')# 设置图形标题和轴标签
ax.set_title('Pose Trajectories (Predicted vs. True)')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')# 添加图例
ax.legend(loc='upper right')# 初始化函数,用于绘制空轨迹线
def init():line_pred.set_data([], [])line_pred.set_3d_properties([])line_true.set_data([], [])line_true.set_3d_properties([])return line_pred, line_true# 更新函数,用于更新轨迹线的数据
def update(frame):line_pred.set_data(x_pred[:frame], y_pred[:frame])line_pred.set_3d_properties(z_pred[:frame])line_true.set_data(x_true[:frame], y_true[:frame])line_true.set_3d_properties(z_true[:frame])# 扩大坐标范围,以包围轨迹ax.set_xlim(min(x_true) - 1, max(x_true) + 1)ax.set_ylim(min(y_true) - 1, max(y_true) + 1)ax.set_zlim(min(z_true) - 1, max(z_true) + 1)return line_pred, line_true# 创建动画对象
ani = FuncAnimation(fig, update, frames=num_poses, init_func=init, blit=True)# 创建一个文件名为animation.gif的视频文件,使用PillowWriter
ani.save('animation_gt.gif', writer=PillowWriter(fps=30))# 显示动画
plt.show()

2 真值轨迹设置为静态的,预测轨迹不断更新

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation, PillowWriter# 假设您有两组连续平滑的姿势数据集,一组表示预测值,一组表示真值
# 每个数据点包含姿势信息 [x, y, z, roll, pitch, yaw]
# 这里使用一些示例数据,您需要替换为您的实际数据
num_poses = 200  # 增加轨迹点数
t = np.linspace(0, 20, num_poses)  # 时间点,使轨迹变得更长
# 生成示例数据来表示预测值轨迹
x_pred = np.sin(t)
y_pred = np.cos(t)
z_pred = np.linspace(0, 10, num_poses)
# 生成示例数据来表示真值轨迹
x_true = np.sin(t) + np.random.uniform(-0.2, 0.3)  # 真值轨迹稍微偏移
y_true = np.sin(t) + np.random.uniform(-0.2, 0.3)  # 真值轨迹稍微偏移
z_true = np.linspace(0, 10, num_poses)# 创建一个 3D 图形
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')# 创建空的轨迹线,一个红色表示预测值,一个绿色表示真值
line_pred, = ax.plot([], [], [], marker='o', linestyle='-', markersize=4, color='red', label='Predicted Trajectory')
line_true, = ax.plot(x_true, y_true, z_true, marker='o', linestyle='-', markersize=4, color='green', label='True Trajectory')# 设置图形标题和轴标签
ax.set_title('Pose Trajectories (Predicted vs. True)')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')# 添加图例
ax.legend(loc='upper right')# 设置轨迹显示范围
ax.set_xlim(-2, 2)  # X轴范围
ax.set_ylim(-2, 2)  # Y轴范围
ax.set_zlim(0, 12)  # Z轴范围# 初始化函数,用于绘制空轨迹线
def init():line_pred.set_data([], [])line_pred.set_3d_properties([])return line_pred, line_true# 更新函数,用于更新预测轨迹的数据
def update(frame):line_pred.set_data(x_pred[:frame], y_pred[:frame])line_pred.set_3d_properties(z_pred[:frame])return line_pred, line_true# 创建动画对象
ani = FuncAnimation(fig, update, frames=num_poses, init_func=init, blit=True)# 创建一个文件名为animation.gif的视频文件,使用PillowWriter
ani.save('animation_1.gif', writer=PillowWriter(fps=30))# 显示动画
plt.show()

3 网格的三维坐标系有旋转运动,以此全方位展示预测轨迹和真值轨迹之间的空间关系

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.animation import FuncAnimation, PillowWriter# 假设您有两组连续平滑的姿势数据集,一组表示预测值,一组表示真值
# 每个数据点包含姿势信息 [x, y, z, roll, pitch, yaw]
# 这里使用一些示例数据,您需要替换为您的实际数据
num_poses = 200  # 增加轨迹点数
t = np.linspace(0, 20, num_poses)  # 时间点,使轨迹变得更长
# 生成示例数据来表示预测值轨迹
x_pred = np.sin(t)
y_pred = np.cos(t)
z_pred = np.linspace(0, 10, num_poses)
# 生成示例数据来表示真值轨迹
x_true = np.sin(t) + 0.5  # 真值轨迹稍微偏移
y_true = np.cos(t) + 0.5
z_true = np.linspace(0, 10, num_poses)# 创建一个 3D 图形
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')# 创建空的轨迹线,一个红色表示预测值,一个蓝色表示真值
line_pred, = ax.plot([], [], [], marker='o', linestyle='-', markersize=4, color='red', label='Predicted Trajectory')
line_true, = ax.plot(x_true, y_true, z_true, marker='o', linestyle='-', markersize=4, color='blue', label='True Trajectory')# 设置图形标题和轴标签
ax.set_title('Pose Trajectories (Predicted vs. True)')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')# 添加图例
ax.legend(loc='upper right')# 设置轨迹显示范围
ax.set_xlim(-2, 2)  # X轴范围
ax.set_ylim(-2, 2)  # Y轴范围
ax.set_zlim(0, 12)  # Z轴范围# 初始化函数,用于绘制空轨迹线
def init():line_pred.set_data([], [])line_pred.set_3d_properties([])return line_pred, line_true# 更新函数,用于更新预测轨迹的数据和整体的旋转运动
def update(frame):line_pred.set_data(x_pred[:frame], y_pred[:frame])line_pred.set_3d_properties(z_pred[:frame])# 添加整体的旋转运动ax.view_init(elev=20, azim=frame)  # 调整视角,azim控制旋转return line_pred, line_true# 创建动画对象
ani = FuncAnimation(fig, update, frames=num_poses, init_func=init, blit=True)# 创建一个文件名为animation.gif的视频文件,使用PillowWriter
ani.save('animation.gif', writer=PillowWriter(fps=30))# 显示动画
plt.show()

更新函数中使用了ax.view_init来控制整体的旋转运动,elev参数用于调整仰角,azim参数用于控制旋转。您可以根据需要调整elevazim的值来实现所需的旋转效果。

 

http://www.yayakq.cn/news/557470/

相关文章:

  • 手机网站在哪里找到wdcp搭建网站教程
  • 网站正在建设中 模版做怎么样的自己的网站
  • 西安网站优化公司公司网站百度搜不到
  • 商城网站解决方案wordpress登录页logo修改
  • 搜索引擎优化介绍流程优化
  • 网站被k什么意思电商创业怎么做
  • 网站建设的背景意义付费电影网站源码
  • 保山市建设局网站企业所得税怎么交
  • 做网站税费中国学校网站前台模板
  • 长春工程建设信息网站php语言网站开发公司北京
  • html网站设计模板下载都江堰网站建设培训学校
  • 简约好看的网站模板免费下载设计师案例网站
  • html5手机网站开发工具昆山市住房和城乡建设网站
  • 网站备案需要提交什么资料哪个杭州seo好
  • 广州番禺网站公司哪家好网站数据库建设方案
  • 保定网站优化如何搭建手机网站源码
  • 网络营销是什么娄底网站seo
  • 成都网站建设cdajcx手机网站备案密码找回的方法
  • asp网站开发 基础2022最新国际新闻10条简短
  • 在线制作网站宣传视频不同风格的网页
  • 临汾网站建设电话好的建设网站公司简介
  • 农产品品牌策划方案免费网站分析seo报告是坑吗
  • 盐城外贸网站建设网站搭建关键词排名
  • 常德网站建设企业万网有跟企业做网站吗
  • 泉州定制网站建设淘宝电脑版登录入口
  • 网站排名所以关键词下降互联网创业项目创意
  • 企业营销网站做网站推广的销售电话开场白
  • 公司电子商务平台和企业网站建设和维护工作管理办法做淘宝客网站流量选择
  • 如何介绍自己做的网站推广计划表格
  • 网站开发 流程图WordPress问答插件路由