[Tutor] Error in get pixel value in coordinate (x, y) using getPixel(x, y)

Whees Northbee ch.de2.2309 at gmail.com
Thu Aug 7 13:49:02 CEST 2014


Please help me... I'm using python 2.7.6, numpy 1.8.1, opencv 2.4.9..
I want to get pixel value in one number like 255 not each value like these
R(190), G(23), B(45) from coordinate (x,y)...
I try these code
m_samples[k][i][j]=getPixel(img,row,col)

But get error:
NameError: name 'getPixel' is not defined

If I change the format become:
m_samples[k][i][j]=img.getPixel(row,col)

Still error:
AttributeError: 'numpy.ndarray' object has no attribute 'getpixel'

Please help me..

Thanks,

Northbee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140807/ee2633ae/attachment.html>


More information about the Tutor mailing list