MCPcopy Create free account
hub / github.com/city-super/Octree-GS / visualize_normal

Function visualize_normal

utils/visualize_utils.py:138–153  ·  view source on GitHub ↗
(inputs, depth_p)

Source from the content-addressed store, hash-verified

136 return -n / norm
137
138def visualize_normal(inputs, depth_p):
139 # Normals
140 uv = th.stack(
141 th.meshgrid(
142 th.arange(depth_p.shape[2]), th.arange(depth_p.shape[1]), indexing="xy"
143 ),
144 dim=0,
145 )[None].float().cuda()
146 position = depthImgToPosCam_Batched(
147 depth_p[None, ...], uv, inputs["focal"], inputs["princpt"]
148 )
149 normal = 0.5 * (computeNormalsFromPosCam_Batched(position) + 1.0)
150 normal = normal[0, [2, 1, 0], :, :] # legacy code assumes BGR format
151 normal_p = tensor2image(normal, label="normal_p")
152
153 return normal_p

Callers

nothing calls this directly

Calls 3

depthImgToPosCam_BatchedFunction · 0.85
tensor2imageFunction · 0.85

Tested by

no test coverage detected