mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 23:18:22 +08:00
Opt: Allow to set multiple template scaling ratios
This commit is contained in:
@@ -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