mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-05-26 06:07:12 +08:00
Opt: Allow to set multiple template scaling ratios
This commit is contained in:
@@ -71,8 +71,8 @@ class Config:
|
||||
HOMO_CANNY_THRESHOLD = (50, 50)
|
||||
MAP_ENEMY_GENRE_DETECTION_SCALING = {
|
||||
'DD': 1.111,
|
||||
'CL': 1.111,
|
||||
'CA': 1.111,
|
||||
'CL': (1, 1.111),
|
||||
'CA': (1, 1.111),
|
||||
'CV': 1.111,
|
||||
'BB': 1.111,
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ class Config:
|
||||
HOMO_CANNY_THRESHOLD = (60, 60)
|
||||
MAP_ENEMY_GENRE_DETECTION_SCALING = {
|
||||
'DD': 1.111,
|
||||
'CL': 1.111,
|
||||
'CA': 1.111,
|
||||
'CL': (1, 1.111),
|
||||
'CA': (1, 1.111),
|
||||
'CV': 1.111,
|
||||
'BB': 1.111,
|
||||
}
|
||||
|
||||
@@ -77,8 +77,8 @@ class Config:
|
||||
HOMO_CANNY_THRESHOLD = (50, 50)
|
||||
MAP_ENEMY_GENRE_DETECTION_SCALING = {
|
||||
'DD': 1.111,
|
||||
'CL': 1.111,
|
||||
'CA': 1.111,
|
||||
'CL': (1, 1.111),
|
||||
'CA': (1, 1.111),
|
||||
'CV': 1.111,
|
||||
'BB': 1.111,
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ class Config:
|
||||
HOMO_CANNY_THRESHOLD = (60, 60)
|
||||
MAP_ENEMY_GENRE_DETECTION_SCALING = {
|
||||
'DD': 1.111,
|
||||
'CL': 1.111,
|
||||
'CA': 1.111,
|
||||
'CL': (1, 1.111),
|
||||
'CA': (1, 1.111),
|
||||
'CV': 1.111,
|
||||
'BB': 1.111,
|
||||
}
|
||||
|
||||
@@ -168,12 +168,14 @@ class GridPredictor:
|
||||
|
||||
short_name = name[6:] if name.startswith('Siren_') else name
|
||||
scaling = scaling_dic.get(short_name, 1)
|
||||
if scaling not in image_dic:
|
||||
shape = tuple(np.round(np.array((60, 60)) * scaling).astype(int))
|
||||
image_dic[scaling] = rgb2gray(self.relative_crop((-0.5, -1, 0.5, 0), shape=shape))
|
||||
scaling = (scaling,) if not isinstance(scaling, tuple) else scaling
|
||||
for scale in scaling:
|
||||
if scale not in image_dic:
|
||||
shape = tuple(np.round(np.array((60, 60)) * scale).astype(int))
|
||||
image_dic[scale] = rgb2gray(self.relative_crop((-0.5, -1, 0.5, 0), shape=shape))
|
||||
|
||||
if template.match(image_dic[scaling]):
|
||||
return name
|
||||
if template.match(image_dic[scale]):
|
||||
return name
|
||||
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user