python opencv check image read

Solutions on MaxInterview for python opencv check image read by the best coders in the world

showing results for - "python opencv check image read"
Benjamin
04 Jul 2017
1import cv2 
2import os.path
3
4while not os.path.isfile("myImage.jpg"):
5    #ignore if no such file is present.
6    pass
7
8img = cv2.imread("myImage.jpg", 0)
9
10cv2.imwrite("result.jpg", img)