Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created July 18, 2017 08:49
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 ochilab/4b310968347dc251c53fa83875e8f478 to your computer and use it in GitHub Desktop.
Save ochilab/4b310968347dc251c53fa83875e8f478 to your computer and use it in GitHub Desktop.
PILでイメージを読み込んでOpenCV形式に変換する
pil_image = Image.open('C:\\Users\\ochi\\temp\\lenna.jpg')
cv_image = cv2.cvtColor(np.array(pil_image) , cv2.COLOR_RGB2BGR)
cv2.imshow("cv_image",cv_image)
cv2.waitKey(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment