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:
@@ -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})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user