mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-07-01 04:16:27 +00:00
11 lines
273 B
Python
11 lines
273 B
Python
import cv2
|
|
import numpy as np
|
|
|
|
__all__ = ["imread_unicode"]
|
|
|
|
|
|
def imread_unicode(filepath: str, flags: int = cv2.IMREAD_UNCHANGED):
|
|
# https://stackoverflow.com/a/57872297/16484891
|
|
# CC BY-SA 4.0
|
|
return cv2.imdecode(np.fromfile(filepath, dtype=np.uint8), flags)
|