1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 16:47:03 +08:00

Add: Image de-dithering

This commit is contained in:
LmeSzinc
2022-02-05 17:10:37 +08:00
parent 36d805fea7
commit 95d4da328b
9 changed files with 29 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import time
from collections import deque
from datetime import datetime
import cv2
import numpy as np
from PIL import Image
@@ -42,6 +43,10 @@ class Screenshot(Adb, Uiautomator2, AScreenCap):
else:
self.image = self.screenshot_adb()
if self.config.Emulator_ScreenshotDedithering:
# This will take 40-60ms
cv2.fastNlMeansDenoising(self.image, self.image, h=17, templateWindowSize=1, searchWindowSize=2)
if self.config.Error_SaveError:
self.screenshot_deque.append({'time': datetime.now(), 'image': self.image})