Linked Questions

-1 votes
1 answer
3k views

When I do np.asarray(my_img) or array(my_img).shape it returns (2412L, 3600L, 3L) on a jpg image,but I just want a 2D (2412L, 3600L) array, so how to convert it correctly? Thanks in advance. my_image ...
harrison dong's user avatar
-1 votes
1 answer
813 views

the following: image = Image.open(name, 'r') data = np.array(image.getdata()) data.reshape(image.size) returns: Traceback (most recent call last): File "/home/usr/colorviewer/main.py", ...
PING's user avatar
  • 11
0 votes
1 answer
744 views

I'm trying to compare the structural similarity of two images with the skimage package but it only works if use two images saved on my pc and not when I use an image created by ImageGrab from PIL even ...
Ferdi_ the_best's user avatar
1 vote
0 answers
694 views

from PIL import * image = ImageGrab.grab() from the variable image i would like to obtain a list of lists in witch every pixel is rappresented like [R,G,B] every line of the image by the first index ...
Mezza 's user avatar
  • 23
0 votes
0 answers
107 views

[[ True False False True True True True True True False False True True True True True True True True True True True True True False False True True True True False False ...
user9827152's user avatar
1 vote
0 answers
90 views

I have got the pixel value of an image patch as the following shows, but how should I show them as an image patch by using python? Is there a method in the PIL library? array([[162, 162, 161, 162, ...
Ryuka's user avatar
  • 11
474 votes
8 answers
203k views

What is the difference between NumPy's np.array and np.asarray? When should I use one rather than the other? They seem to generate identical output.
Benjamin Hodgson's user avatar
11 votes
2 answers
17k views

So i have an image lets say small.png and a bigger image big.png .The small image occurs 2 times in the bigger image and i wish to find its location. I tried using numpy and Image but got error '...
vks's user avatar
  • 68.1k
4 votes
2 answers
13k views

I'm not sure how to go about scaling a 2-dimensional array. Given the array below, whose dimensions are 8x10, say I needed to scale it to 5x6 -- I've looked for concrete examples on wikipedia, but ...
coleifer's user avatar
  • 26.4k
9 votes
2 answers
11k views

I'm trying to calculate the similarity (read: Levenshtein distance) of two images, using Python 2.6 and PIL. I plan to us e the python-levenshtein library for fast comparison. Main question: What ...
Attila O.'s user avatar
  • 16.8k
4 votes
3 answers
13k views

I wanted to convert the PIL Image object into a numpy array. I tried using the following codes it showing an error TypeError Traceback (most recent call last) <ipython-input-133-0898103f22f0> ...
Kavin Raju S's user avatar
  • 1,422
4 votes
3 answers
9k views

I have some code that does (independent) operations on a bunch of Python Imaging Library (PIL) Image objects. I would like to try and speed this up using parallel processing, so I read up on the ...
M-V's user avatar
  • 5,227
4 votes
1 answer
7k views

I have some pdf, I want to read them as pictures to get all the pixels info. So I tried first to convert the pdf into jpeg: from pdf2image import convert_from_path img = convert_from_path('mypdf....
GonzaloReig's user avatar
3 votes
1 answer
4k views

I followed a tutorial for creating a simple neural network using signoidal function "Using neural nets to recognize handwritten digits", the tutorial is very simple with theory and code examples. ...
Isabel Cariod's user avatar
0 votes
1 answer
2k views

I want to convert a PIL image to a numpy array. Numpy's asarray function simply puts the image in a 0-dimensional array. (Pdb) p img <PIL.Image._ImageCrop image mode=RGB size=1024x0 at 0x106953560&...
Rose Perrone's user avatar

15 30 50 per page