Answers for "how to check if image read is successful in python cv2"

2

check if image is empty opencv python

if (type(img) is np.ndarray): 
     #do stuff with image
Posted by: Guest on October-05-2020
0

python opencv check image read

import cv2 
import os.path

while not os.path.isfile("myImage.jpg"):
    #ignore if no such file is present.
    pass

img = cv2.imread("myImage.jpg", 0)

cv2.imwrite("result.jpg", img)
Posted by: Guest on June-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language