Skip to content

Instantly share code, notes, and snippets.

@castaneai
Created February 28, 2017 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save castaneai/0f0d00675c91e53eedfd5a008d4c917c to your computer and use it in GitHub Desktop.
Save castaneai/0f0d00675c91e53eedfd5a008d4c917c to your computer and use it in GitHub Desktop.
cv2
def imread_yazo(filename, flag):
with open(filename, "rb") as f:
return cv2.imdecode(f.read(), flag)
def imwrite_yazo(filename, img, flag):
with open(filename, "wb") as f:
ext = os.path.splitext(filename)[1]
f.write(cv2.imencode(ext, img, flag))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment