1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 00:28:20 +08:00

Add: Attack abyssal boss

This commit is contained in:
LmeSzinc
2021-12-06 20:56:57 +08:00
parent 1290224c50
commit caf51858e9
11 changed files with 347 additions and 74 deletions

View File

@@ -43,9 +43,29 @@ class GridPredictor:
self.homo_invt = cv2.invert(self.homo_data)[1]
def screen2grid(self, points):
"""
Args:
points (np.ndarray): Coordinates from screen, [[x1, y1], [x2, y2], ...]
Returns:
np.ndarray: Coordinates from sea surface, [[x1, y1], [x2, y2], ...]
Coordinate zero point is the upper-left corner.
(0, 0) +------+
| |
| |
+------+ (1, 1)
"""
return perspective_transform(points, self.homo_data) / self.config.HOMO_TILE
def grid2screen(self, points):
"""
Args:
points (np.ndarray): Coordinates from sea surface, [[x1, y1], [x2, y2], ...]
See Also screen2grid().
Returns:
np.ndarray: Coordinates from screen, [[x1, y1], [x2, y2], ...]
"""
return perspective_transform(np.multiply(points, self.config.HOMO_TILE), self.homo_invt)
@cached_property