Flip the coordinates. Args: coords (ndarray): floating point array of shape Nx2. Each row is (x, y). Returns: ndarray: the flipped coordinates. Note: The inputs are floating point coordinates, not pixel indices.
(self, coords: np.ndarray)
| 54 | return np.flip(img, axis=-2) |
| 55 | |
| 56 | def apply_coords(self, coords: np.ndarray) -> np.ndarray: |
| 57 | """ |
| 58 | Flip the coordinates. |
| 59 | |
| 60 | Args: |
| 61 | coords (ndarray): floating point array of shape Nx2. Each row is |
| 62 | (x, y). |
| 63 | Returns: |
| 64 | ndarray: the flipped coordinates. |
| 65 | |
| 66 | Note: |
| 67 | The inputs are floating point coordinates, not pixel indices. |
| 68 | Therefore they are flipped by `(W - x, H - y)`, not |
| 69 | `(W - 1 - x, H - 1 - y)`. |
| 70 | """ |
| 71 | coords[:, 0] = self.width - coords[:, 0] |
| 72 | return coords |
| 73 | |
| 74 | def inverse(self) -> Transform: |
| 75 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected