sub_crop
- lib.align.aligned_utils.sub_crop(image: npt.NDArray[np.uint8], offset: npt.NDArray[np.int32], out_size: int) npt.NDArray[np.uint8]
- lib.align.aligned_utils.sub_crop(image: npt.NDArray[np.float32], offset: npt.NDArray[np.int32], out_size: int) npt.NDArray[np.float32]
Obtain an aligned sub-crop from a larger aligned image. Handles OOB. Output is zero padded
- Parameters:
image (npt.NDArray[np.uint8 | np.float32]) – The (H, W, C) full size extracted image.
offset (npt.NDArray[np.int32]) – The (x, y) offset to shift the sub-crop.
out_size (int) – The output size of the sub-crop.
- Return type:
npt.NDArray[np.uint8 | np.float32]