You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
392 B

import numpy as np
def calculate_distance(w2c1: np.ndarray, w2c2: np.ndarray) -> float:
'''
计算两个相机之间的距离
Args:
w2c1: 相机1的世界坐标到相机坐标变换矩阵
w2c2: 相机2的世界坐标到相机坐标变换矩阵
Returns:
float: 两个相机之间的距离
'''
return np.linalg.norm(w2c1[:3, 3] - w2c2[:3, 3])