mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 03:58:22 +08:00
Opt: Edge detection in Northern Overture Rerun
- Opt: Use bottom edges first, upper edges have higher errors rates
This commit is contained in:
@@ -170,10 +170,10 @@ class Camera(MapOperation):
|
||||
x = self.map.shape[0] - self.view.shape[0] + self.view.center_loca[0]
|
||||
else:
|
||||
x = self.camera[0]
|
||||
if self.view.lower_edge:
|
||||
y = 0 + self.view.center_loca[1]
|
||||
elif self.view.upper_edge:
|
||||
if self.view.upper_edge:
|
||||
y = self.map.shape[1] - self.view.shape[1] + self.view.center_loca[1]
|
||||
elif self.view.lower_edge:
|
||||
y = 0 + self.view.center_loca[1]
|
||||
else:
|
||||
y = self.camera[1]
|
||||
|
||||
|
||||
@@ -66,7 +66,10 @@ class View(MapDetector):
|
||||
grids[loca] = self.grid_class(location=loca, image=image, corner=points, config=self.config)
|
||||
|
||||
# Handle grids offset
|
||||
offset = np.min(list(grids.keys()), axis=0)
|
||||
offset = list(grids.keys())
|
||||
if not len(offset):
|
||||
raise MapDetectionError('No map grids found')
|
||||
offset = np.min(offset, axis=0)
|
||||
if np.sum(np.abs(offset)) > 0:
|
||||
logger.attr_align('grids_offset', tuple(offset.tolist()))
|
||||
self.grids = {}
|
||||
|
||||
Reference in New Issue
Block a user