mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-07-01 12:26:27 +00:00
fix: unicode character in image path
This commit is contained in:
9
src/arcaea_offline_ocr/utils.py
Normal file
9
src/arcaea_offline_ocr/utils.py
Normal file
@ -0,0 +1,9 @@
|
||||
from cv2 import IMREAD_UNCHANGED, Mat, imdecode
|
||||
from numpy import fromfile as np_fromfile
|
||||
from numpy import uint8
|
||||
|
||||
|
||||
def imread_unicode(filepath: str) -> Mat:
|
||||
# https://stackoverflow.com/a/57872297/16484891
|
||||
# CC BY-SA 4.0
|
||||
return imdecode(np_fromfile(filepath, dtype=uint8), IMREAD_UNCHANGED)
|
Reference in New Issue
Block a user