Args: intrinsics: (..., 3, 3) intrinsics matrices. width: width of the image. height: height of the image. Returns: pixel_width: (...) pixel width. = 1 / (normalized focal length * width)
(intrinsics: Tensor, width: int, height: int)
| 93 | |
| 94 | |
| 95 | def get_pixel_width(intrinsics: Tensor, width: int, height: int) -> Tensor: |
| 96 | """ |
| 97 | Args: |
| 98 | intrinsics: (..., 3, 3) intrinsics matrices. |
| 99 | width: width of the image. |
| 100 | height: height of the image. |
| 101 | |
| 102 | Returns: |
| 103 | pixel_width: (...) pixel width. = 1 / (normalized focal length * width) |
| 104 | """ |
| 105 | assert width == height, "Currently, only square images are supported." |
| 106 | pixel_width = torch.reciprocal((intrinsics[..., 0, 0] * intrinsics[..., 1, 1]).sqrt() * width) |
| 107 | return pixel_width |
| 108 | |
| 109 | |
| 110 | def volume_rendering(color: Tensor, sigma: Tensor, z_vals: Tensor, ray_length: Tensor, rgb: bool = True, depth: bool = True) -> Tuple[Tensor, Tensor, Tensor]: |
no outgoing calls
no test coverage detected