Inverts a depth map with numerical stability. Args: ---- depth (np.ndarray): Depth map to be inverted. eps (float): Minimum value to avoid division by zero (default is 1e-6). Returns: ------- np.ndarray: Inverted depth map.
(depth: np.ndarray, eps: float = 1e-6)
| 243 | |
| 244 | |
| 245 | def invert_depth(depth: np.ndarray, eps: float = 1e-6) -> np.ndarray: |
| 246 | """Inverts a depth map with numerical stability. |
| 247 | |
| 248 | Args: |
| 249 | ---- |
| 250 | depth (np.ndarray): Depth map to be inverted. |
| 251 | eps (float): Minimum value to avoid division by zero (default is 1e-6). |
| 252 | |
| 253 | Returns: |
| 254 | ------- |
| 255 | np.ndarray: Inverted depth map. |
| 256 | |
| 257 | """ |
| 258 | inverse_depth = 1.0 / depth.clip(min=eps) |
| 259 | return inverse_depth |
| 260 | |
| 261 | |
| 262 | def SI_boundary_F1( |
no outgoing calls
no test coverage detected