Resize depth map and bring to CPU (numpy). Args: depth (tensor): depth width (int): image width height (int): image height Returns: array: processed depth
(depth, width, height)
| 149 | |
| 150 | |
| 151 | def resize_depth(depth, width, height): |
| 152 | """Resize depth map and bring to CPU (numpy). |
| 153 | |
| 154 | Args: |
| 155 | depth (tensor): depth |
| 156 | width (int): image width |
| 157 | height (int): image height |
| 158 | |
| 159 | Returns: |
| 160 | array: processed depth |
| 161 | """ |
| 162 | depth = torch.squeeze(depth[0, :, :, :]).to("cpu") |
| 163 | |
| 164 | depth_resized = cv2.resize( |
| 165 | depth.numpy(), (width, height), interpolation=cv2.INTER_CUBIC |
| 166 | ) |
| 167 | |
| 168 | return depth_resized |
| 169 | |
| 170 | def write_depth(path, depth, bits=1): |
| 171 | """Write depth map to pfm and png file. |
nothing calls this directly
no outgoing calls
no test coverage detected