Apply AffineTransform for the image(s). Args: img (ndarray): of shape HxW, HxWxC, or NxHxWxC. The array can be of type uint8 in range [0, 255], or floating point in range [0, 1] or [0, 255]. Returns: ndarray: the image
(self, img: np.ndarray)
| 104 | self._set_attributes(locals()) |
| 105 | |
| 106 | def apply_image(self, img: np.ndarray) -> np.ndarray: |
| 107 | """ |
| 108 | Apply AffineTransform for the image(s). |
| 109 | |
| 110 | Args: |
| 111 | img (ndarray): of shape HxW, HxWxC, or NxHxWxC. The array can be |
| 112 | of type uint8 in range [0, 255], or floating point in range |
| 113 | [0, 1] or [0, 255]. |
| 114 | Returns: |
| 115 | ndarray: the image(s) after applying affine transform. |
| 116 | """ |
| 117 | return cv2.warpAffine(img, self.affine, self.output_size, flags=cv2.INTER_LINEAR, borderValue=self.border_value) |
| 118 | |
| 119 | def apply_coords(self, coords: np.ndarray) -> np.ndarray: |
| 120 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected