Jaypee
Jaypee

Reputation: 53

Python OpenCV cv2.imshow() not working in windows

I'm trying to load a sample image using python 3.6 OpenCV. I do not know why my image is not loaded when I run my program. This is my code:

import cv2
import time

test1=cv2.imread("C:/Users/JP/Desktop/JP Files/Python/Python
Programs/FaceRecog/data/test1.jpg")
cv2.imshow("Test", test1)

I already changed the slash to C:\UsersJP\Desktop\JP Files\Python\Python Programs\FaceRecog\data\test1.jpg but still no luck.

Upvotes: 0

Views: 830

Answers (1)

paru kumar
paru kumar

Reputation: 31

Did you try by adding cv2.waitkey(0) at the end of the program. Hope it will work!!!!

Upvotes: 1

Related Questions