mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-04-11 09:30:17 +00:00
feat: imread_unicode
can now pass flags
to cv2.imdecode
This commit is contained in:
parent
92c4945037
commit
b89e5e96d3
@ -11,10 +11,10 @@ from .types import Mat, XYWHRect
|
||||
__all__ = ["imread_unicode"]
|
||||
|
||||
|
||||
def imread_unicode(filepath: str) -> Mat:
|
||||
def imread_unicode(filepath: str, flags: int = cv2.IMREAD_UNCHANGED) -> Mat:
|
||||
# https://stackoverflow.com/a/57872297/16484891
|
||||
# CC BY-SA 4.0
|
||||
return cv2.imdecode(np.fromfile(filepath, dtype=np.uint8), cv2.IMREAD_UNCHANGED)
|
||||
return cv2.imdecode(np.fromfile(filepath, dtype=np.uint8), flags)
|
||||
|
||||
|
||||
def construct_int_xywh_rect(
|
||||
|
Loading…
x
Reference in New Issue
Block a user