Python Forum
Array problem in pylab module - Image processing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array problem in pylab module - Image processing
#1
Hello Python community,
I am trying to load an image into a pylab array. All packages are installed as it should be but I keep receiving the following error when running my code:

img = pl.array(Image.open("Empire2.jpg"))
AttributeError: module 'pylab' has no attribute 'array'

My code is :
from PIL import Image
import pylab as pl

img = pl.array(Image.open("Empire2.jpg"))
pl.imshow(img)
x = [100,100,400,400]
y = [200,300,200,400]
plot(x,y,"r*")
plot(x[:2],y[:2])
title("Plotting the Empire")
show()
I verified for any file named pylab.py in my working directory (from Internet search), but still no luck.

Thanks for the help and Happy New Year to ALL!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem When using canny edge detection,black image returned rickyw2777 1 404 Feb-17-2025, 03:22 AM
Last Post: rickyw2777
  problem with memory_graph module akbarza 5 1,673 Jan-14-2025, 04:31 PM
Last Post: Gribouillis
  tkinter photo image problem jacksfrustration 5 3,204 Jun-27-2024, 12:06 AM
Last Post: AdamHensley
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 8,860 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  problem using coloeama module akbarza 3 1,421 Jan-08-2024, 07:31 AM
Last Post: akbarza
  problem in using subprocess module akbarza 5 3,186 Sep-24-2023, 02:02 PM
Last Post: snippsat
  problem in import module from other folder akbarza 5 9,280 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  problem in using pyqrcode module to create QRcode akbarza 9 6,314 Aug-23-2023, 04:17 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,852 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  Problem with module time and leap seconds Pedroski55 3 2,014 Oct-07-2022, 11:27 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020