mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 16:47:03 +08:00
Add: Dreamwaker's Butterfly (event_20200917) TS1 T1
- Dev: Fix relative_crop import
This commit is contained in:
@@ -43,27 +43,28 @@ FOLDER = ''
|
||||
NAME = 'Deutschland'
|
||||
NODE = 'D5'
|
||||
|
||||
for folder in [FOLDER, os.path.join(FOLDER, NAME)]:
|
||||
if not os.path.exists(folder):
|
||||
os.mkdir(folder)
|
||||
if __name__ == '__main__':
|
||||
for folder in [FOLDER, os.path.join(FOLDER, NAME)]:
|
||||
if not os.path.exists(folder):
|
||||
os.mkdir(folder)
|
||||
|
||||
cfg = AzurLaneConfig(CONFIG).merge(Config())
|
||||
al = ModuleBase(cfg)
|
||||
view = View(cfg)
|
||||
al.device.screenshot()
|
||||
view.load(al.device.image)
|
||||
grid = view[node2location(NODE.upper())]
|
||||
cfg = AzurLaneConfig(CONFIG).merge(Config())
|
||||
al = ModuleBase(cfg)
|
||||
view = View(cfg)
|
||||
al.device.screenshot()
|
||||
view.load(al.device.image)
|
||||
grid = view[node2location(NODE.upper())]
|
||||
|
||||
print('Please check if it is cropping the right area')
|
||||
image = rgb2gray(grid.relative_crop((-0.5, -1, 0.5, 0), shape=(60, 60)))
|
||||
image = Image.fromarray(image, mode='L').show()
|
||||
|
||||
images = []
|
||||
for n in range(300):
|
||||
print(n)
|
||||
images.append(al.device.screenshot())
|
||||
for n, image in enumerate(images):
|
||||
grid.image = np.array(image)
|
||||
print('Please check if it is cropping the right area')
|
||||
image = rgb2gray(grid.relative_crop((-0.5, -1, 0.5, 0), shape=(60, 60)))
|
||||
image = Image.fromarray(image, mode='L')
|
||||
image.save(os.path.join(FOLDER, NAME, f'{n}.png'))
|
||||
image = Image.fromarray(image, mode='L').show()
|
||||
|
||||
images = []
|
||||
for n in range(300):
|
||||
print(n)
|
||||
images.append(al.device.screenshot())
|
||||
for n, image in enumerate(images):
|
||||
grid.image = np.array(image)
|
||||
image = rgb2gray(grid.relative_crop((-0.5, -1, 0.5, 0), shape=(60, 60)))
|
||||
image = Image.fromarray(image, mode='L')
|
||||
image.save(os.path.join(FOLDER, NAME, f'{n}.png'))
|
||||
|
||||
Reference in New Issue
Block a user