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

网站开发课程设计实验报告免费个人网站怎么建立

网站开发课程设计实验报告,免费个人网站怎么建立,素材下载网站,排版设计图片文章目录 参数设置align_dynamic_thing:为了将动态物体的点云数据从上一帧对齐到当前帧流程旋转函数平移公式filter_points_in_ego:筛选出属于特定实例的点get_intermediate_frame_info: 函数用于获取中间帧的信息,包括点云数据、传感器校准信息、自车姿态、边界框及其对应…

文章目录

    • 参数设置
    • align_dynamic_thing:为了将动态物体的点云数据从上一帧对齐到当前帧
      • 流程
    • 旋转函数
    • 平移公式
    • filter_points_in_ego:筛选出属于特定实例的点
    • get_intermediate_frame_info: 函数用于获取中间帧的信息,包括点云数据、传感器校准信息、自车姿态、边界框及其对应的实例标识等
    • intermediate_keyframe_align 函数用于将前一帧的点云数据对齐到当前帧的自车坐标系中,并返回对齐后的点云数据和标签。
    • prev2ego 函数用于将前一帧的点云数据转换到当前帧的自车坐标系中。该函数考虑了旋转和平移,并可选地应用速度和时间差来进行额外的位移校正。
    • nonkeykeyframe_align 函数用于将非关键帧的点云数据对齐到当前帧的自车坐标系中
    • 将前一帧的点云数据对齐到当前帧的自车坐标系中
    • 为未标记的中间点云数据搜索标签

必要的包

from nuscenes.nuscenes import NuScenes
from pyquaternion import Quaternion
from nuscenes.utils.data_classes import LidarPointCloud
import numpy as np
from open3d import *
from nuscenes.utils.data_io import load_bin_file
from nuscenes.utils.geometry_utils import points_in_box
import os.path as osp
from functools import partial
from utils.points_process import *
from sklearn.neighbors import KDTree
import open3d as o3d
import argparse

初始化全局字典,用于存储中间静态点、姿态和标签

INTER_STATIC_POINTS = {}
INTER_STATIC_POSE = {}
INTER_STATIC_LABEL = {}

参数设置

dataroot: 数据集的根路径,类型为字符串,默认值为 ‘./project/data/nuscenes/’。

  • save_path: 保存路径,类型为字符串,默认值为 ‘./project/data/nuscenes//occupancy2/’,该参数是可选的。
  • num_sweeps: 每个示例的激光雷达扫描次数,类型为整数,默认值为 10,该参数是可选的。
def parse_args():parser = argparse.ArgumentParser(description='Data converter arg parser')parser.add_argument('--dataroot',type=str,default='./project/data/nuscenes/',help='specify the root path of dataset')parser.add_argument('--save_path',type=str,default='./project/data/nuscenes//occupancy2/',required=False,help='specify sweeps of lidar per example')parser.add_argument('--num_sweeps',type=int,default=10,required=False,help='specify sweeps of lidar per example')args = parser.parse_args()return args

align_dynamic_thing:为了将动态物体的点云数据从上一帧对齐到当前帧

def align_dynamic_thing(box, prev_instance_token, nusc, prev_points, ego_frame_info):if prev_instance_token not in ego_frame_info['instance_tokens']:box_mask = points_in_box(box,prev_points[:3, :])return np.zeros((prev_points.shape[0], 0)), np.zeros((0, )), box_maskbox_mask = points_in_box(box,prev_points[:3, :])box_points = prev_points[:, box_mask].copy()prev_bbox_center = box.centerprev_rotate_matrix = box.rotation_matrixbox_points = rotate(box_points, np.linalg.inv(prev_rotate_matrix), center=prev_bbox_center)target = ego_frame_info['instance_tokens'].index(prev_instance_token)ego_boxes_center = ego_frame_info['boxes'][target].centerbox_points = translate(box_points, ego_boxes_center-prev_bbox_center)box_points = rotate(box_points, ego_frame_info['boxes'][target].rotation_matrix, center=ego_boxes_center)box_points_mask = filter_points_in_ego(box_points, ego_frame_info, prev_instance_token)box_points = box_points[:, box_points_mask]box_label = np.full_like(box_points[0], nusc.lidarseg_name2idx_mapping[box.name]).copy()return box_points, box_label, box_mask

流程

  1. 检查实例标识:
    if prev_instance_token ∉ ego_frame_info[‘instance_tokens’]:
    box_mask = points_in_box(box, prev_points[:3, :])
    return (0, 0, box_mask)

  2. 计算边界框内的点:
    box_mask = points_in_box(box, prev_points[:3, :])
    box_points = prev_points[:, box_mask]

  3. 获取上一帧边界框的中心和旋转矩阵:
    C_prev = box.center
    R_prev = box.rotation_matrix

  4. 将点旋转到原点并平移到当前帧的中心:
    box_points = R_prev^-1 * (box_points - C_prev)

  5. 获取目标边界框的中心和旋转矩阵:
    target = ego_frame_info[‘instance_tokens’].index(prev_instance_token)
    C_ego = ego_frame_info[‘boxes’][target].center
    R_ego = ego_frame_info[‘boxes’][target].rotation_matrix

  6. 平移到当前帧的中心并再次旋转:
    box_points = box_points + (C_ego - C_prev)
    box_points = R_ego * box_points

  7. 过滤当前帧边界框内的点:
    box_points_mask = points_in_box(ego_frame_info[‘boxes’][target], box_points[:3, :])
    box_points = box_points[:, box_points_mask]

  8. 生成点云数据的标签:
    box_label = full_like(box_points[0], nusc.lidarseg_name2idx_mapping[box.name])

  9. 返回结果:
    return (box_points, box_label, box_mask)

numpy.full_like()是根据现有数组的形状和数据类型来创建新数组,而numpy.full()则需要手动指定形状和数据类型。

旋转函数

def rotate(points, rot_matrix: np.ndarray, center=None) -> np.array:"""Applies a rotation.:param rot_matrix: <np.float: 3, 3>. Rotation matrix."""if center is not None:points[:3, :] = np.dot(rot_matrix, points[:3, :]-center[:, None]) + center[:, None]else:points[:3, :] = np.dot(rot_matrix, points[:3, :])return points

在这里插入图片描述

平移公式

def translate(points, x: np.ndarray) -> np.array:"""Applies a translation to the point cloud.:param x: <np.float: 3, 1>. Translation in x, y, z."""for i in range
http://www.yayakq.cn/news/908438/

相关文章:

  • 网站建设如何报价新手如何做网站运营
  • 有什么好的网站查做外贸出口的企业宜昌有做网站的公司吗
  • 预付网站制作费怎么做凭证做视频网站 视频放在哪里找
  • 张家港市做网站的公司教做面点的网站
  • 泰安中呼网站建设有限公司 概况苏州吴江做网站
  • 苏州做网站公司哪家好wordpress 游戏 模板下载地址
  • 清远住房和城乡建设局网站wordpress 百家号
  • 莆田网站建设创意建筑公司起名大全2021最新版的
  • 阐述企业搭建网站的重要性网站建设2019
  • 在服务器上搭建网站广告创意设计欣赏
  • 网站被降权后怎么办自做网站多少钱
  • 一般做外单的有哪些网站陕西建设厅官网首页
  • 广州建网站比较有名的公司婚纱摄影团购网站模板
  • 茶网站设计素材下载木樨园网站建设
  • 传统设计公司网站建设服装网站目的
  • 汕头有没有做网站golang和php 做网站
  • 快手刷热度推广网站杭州网络推广公司排名
  • 如何自建网站写网页用什么语言
  • 惠州网站建设 熊掌号珠海网站制作外包
  • 北京集团公司注册流程全网优化推广
  • 亦庄建设局网站怎么搭建自己的网站
  • 厦门seo优化seo网站营销推广公司
  • 高端网站建设与制作惠州微网站推广方案
  • 做苗木网站哪家做得好南京建设网站公司哪家好
  • python做网站多少钱建筑工程网站免费
  • 重庆教育建设有限公司网站首页廊坊关键词排名优化
  • 中国住房和城乡建设部网站建造师专题网站策划书
  • 网站快速建设视频网站建设交流会
  • 北京公司的网站建设手机靓号网站建设
  • 中小型网站建设哪家好如何做好一个外贸进网站的编辑