Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In opencv-python tutorials core operations basic operations on images accessing pixel value throws an error

Here is the code(with error as i am working directly on the shell as instructed by the website) same as on the website:

import cv2 import numpy as np img = cv2.imread('result.jpg') px = img[100,100]

Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> px = img[100,100] TypeError: 'NoneType' object has no attribute '__getitem__'

Thanks :)

click to hide/show revision 2
No.2 Revision

updated 2017-07-13 01:30:58 -0600

berak gravatar image

In opencv-python tutorials core operations basic operations on images accessing pixel value throws an error

Here is the code(with error as i am working directly on the shell as instructed by the website) same as on the website:

>>> import cv2
 >>> import numpy as np
 >>> img = cv2.imread('result.jpg')
 >>> px = img[100,100]

img[100,100]

Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> px = img[100,100] TypeError: 'NoneType' object has no attribute '__getitem__'

'__getitem__'

Thanks :)