Open3d 获取并排序点云包围盒的八个numpy角点,从下四角开始到上四角;

Open3d获取到的包围盒的包围盒八点的顺序是三角面,一遍走完8点的排序,我想要的是底部四点+顶部四点最后合成的八个numpy点

思路:将八点按Z轴值分为上四点和下四点,然后再分别排序,最后再组合输出

核心代码:

    # 根据 Z 值对点进行排序
    sorted_points = bottom_points_np[np.argsort(bottom_points_np[:, 2])]
    # 获取 Z 值最小的四个点
    points = sorted_points[:4]
    # 计算中心点坐标
    center = np.mean(points, axis=0)
    # 计算每个点相对于中心点的极坐标角度np.arctan2(y,x)
    angles = np.arctan2(points[:, 1] - center[1], points[:, 0] - center[0])
    # 对角度进行排序
    sorted_indices = np.argsort(angles)
    points = points[sorted_indices]

import json
import copy
import numpy as np
import open3d as o3d

'''
作者 &#x
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值