MCPcopy Create free account
hub / github.com/Thinklab-SJTU/Bench2Drive / build_projection_matrix

Function build_projection_matrix

tools/utils.py:137–148  ·  view source on GitHub ↗
(w, h, fov, is_behind_camera=False)

Source from the content-addressed store, hash-verified

135 return math.sqrt((loc1.x-loc2.x)**2+(loc1.y-loc2.y)**2)
136
137def build_projection_matrix(w, h, fov, is_behind_camera=False):
138 focal = w / (2.0 * np.tan(fov * np.pi / 360.0))
139 K = np.identity(3)
140
141 if is_behind_camera:
142 K[0, 0] = K[1, 1] = -focal
143 else:
144 K[0, 0] = K[1, 1] = focal
145
146 K[0, 2] = w / 2.0
147 K[1, 2] = h / 2.0
148 return K
149
150def convert_depth(data):
151 """

Callers 1

get_sensors_annoMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected