[Tutor] Error in get pixel value in coordinate (x, y) using getPixel(x, y)
Joel Goldstick
joel.goldstick at gmail.com
Thu Aug 7 20:39:20 CEST 2014
On Thu, Aug 7, 2014 at 7:49 AM, Whees Northbee <ch.de2.2309 at gmail.com> wrote:
> 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
>
>What module is getPixel from? Do you have that module imported?
Its best if you show complete traceback, and other relevant code
I'm guessing that img is what you imported from numpy.ndarray. But it
looks to me like getPixel comes from pil
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
--
Joel Goldstick
http://joelgoldstick.com
More information about the Tutor
mailing list