def target_distance(target):
camera_fov_vert = 41.41
camera_pitch = 40
# units in inches
target_height = 83
camera_height = 9
# target[0][1] is [1,-1] y coord from top-bottom
y = target[0][1]
return (target_height - camera_height) / math.tan(math.radians((y * camera_fov_vert / 2) + camera_pitch))
评论列表
文章目录