build: versionCode 7→8 + Release #8 + APK 3.5MB
This commit is contained in:
23
ocr_screen2.py
Normal file
23
ocr_screen2.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import sys
|
||||
import io
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||
|
||||
from PIL import Image
|
||||
|
||||
img = Image.open(r"D:\Yuzu-GCA\screen2.png")
|
||||
print(f"Format: {img.format}, Size: {img.size}, Mode: {img.mode}")
|
||||
|
||||
# Try pytesseract OCR
|
||||
try:
|
||||
import pytesseract
|
||||
|
||||
# Configure tesseract path if needed
|
||||
# pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
|
||||
|
||||
text = pytesseract.image_to_string(img, lang='chi_sim+eng')
|
||||
print("\n=== OCR Result ===")
|
||||
print(text)
|
||||
except ImportError:
|
||||
print("\npytesseract not available")
|
||||
except Exception as e:
|
||||
print(f"\nOCR error: {e}")
|
||||
Reference in New Issue
Block a user