Ask Your Question
0

cv2.imread returns None

asked 2016-02-23 03:20:58 -0500

JJG gravatar image

as the title states, when I do

im = cv2.imread("path\to\image.jpg")

and I've made sure the image is there, I get None in im I've imported cv2, and can't think of why this is happening. (Python 2.7, opencv 3.0.0). anyone have any idea? Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-02-23 03:52:09 -0500

zshn25 gravatar image

Try replacing \ with / in your path to image. Also, try copying the image in your program folder and just give

im = cv2.imread("image.jpg")

cv2.imshow("", im)

cv2.waitKey(0)

edit flag offensive delete link more

Comments

I had to put the image in the program folder to make it work... lame.

wannaBrobot gravatar imagewannaBrobot ( 2018-07-12 18:40:05 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-23 03:20:58 -0500

Seen: 7,394 times

Last updated: Feb 23 '16