How do I just get pixel data when using imread? [closed]

asked 2018-07-30 21:06:57 -0500

Shmall27 gravatar image

updated 2018-07-31 19:24:04 -0500

When I use imread on an image then append it to an array and print the array, it gives me the file name plus the dtype in the same array as the pixel data. Is there a way I can get just the pixel data in the array easily?

Ex: [[204, 176, 245], [204, 176, 245], [204, 176, 245], ..., [202, 173, 246], [201, 172, 245], [201, 172, 245]]], dtype=uint8) '3.3.jpg']

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2018-07-30 22:52:55.686639

Comments

numpy arrays ARE just pixel data.

NO, it does not print or even know the filename (you're making that up)

this not even an opencv problem, you really have to learn about numpy !

berak gravatar imageberak ( 2018-07-30 22:52:21 -0500 )edit

@berak I'm not making it up. When I do just one image it prints fine but when I append that image to an array it prints that file name and dtype, so how do I fix that? (Also I don't understand why you tell me that I have to learn more about numpy when you could just be helpful and answer the question instead of saying "you really have to learn about numpy !" It's hard to learn about things when I get answers like yours.)

Ex of singular imread: [[[216 209 214] [217 210 215] [221 214 217] ... [223 221 211] [223 218 215] [215 208 211]]

Ex of appended imreads in array: [[204, 176, 245], [204, 176, 245], [204, 176, 245], ..., [202, 173, 246], [201, 172, 245], [201, 172, 245]]], dtype=uint8), '3.3.jpg'

Shmall27 gravatar imageShmall27 ( 2018-07-31 19:21:47 -0500 )edit