mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-18 19:33:33 +08:00
Revert "Revert "Merge branch 'dev' of https://github.com/LmeSzinc/AzurLaneAutoScript into dev""
This reverts commit ac9303012c.
This commit is contained in:
17
module/base/mask.py
Normal file
17
module/base/mask.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user