Created
February 28, 2017 16:32
-
-
Save castaneai/0f0d00675c91e53eedfd5a008d4c917c to your computer and use it in GitHub Desktop.
cv2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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