计算边界框
查看所有提示

计算边界框

def get_bounding_box(camera_dict): import numpy as np # 初始化最小值和最大值 min_point = np.array([float('inf')] * 3) max_point = np.array([-float('inf')] * 3) for camera_id, transform in camera_dict.items(): # 从变换矩阵中提取平移 translation = transform[:3, 3] # 更新最小值和最大值 min_point = np.minimum(min_point, translation) max_point = np.maximum(max_point, translation) return tuple(min_point), tuple(max_point)

关键词

  • Python
  • 生成
  • 函数
  • 机器学习
  • 边界框
  • 变换矩阵
  • 数据科学
  • Numpy
  • 图像处理
  • 计算机视觉

来源