1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-09 18:39:04 +08:00
AzurLaneAutoScript/module/base/mask.py
LmeSzinc f16fda59de Add: Mask class
- Copy module/map/ui_mask.png to assets/mask/MASK_MAP_UI.png
2020-07-05 23:21:27 +08:00

18 lines
364 B
Python

import cv2
import numpy as np
from PIL import Image
from module.base.template import Template
class Mask(Template):
@property
def image(self):
if self._image is None:
self._image = np.array(Image.open(self.file).convert('L'))
return self._image
def apply(self, image):
return cv2.bitwise_and(image, self.image)