Image Recognition Library Python

First download Pillow as:

pip install Pillow

Then execute sample program:

from PIL import Image
import numpy as np

i = Image.open(‘ashish.jpg’)
arrays = np.asarray(i)
print(arrays)

 

This should print as  below:

 

[[[241 241 233]
[241 241 233]
[243 240 233]
…,
[255 248 238]
[255 251 242]
[255 253 246]]

[[241 241 233]
[241 241 233]
[243 240 233]
…,
[253 249 238]
[255 251 242]
[255 253 246]]

[[241 241 233]
[241 241 233]
[243 240 233]
…,
[253 249 238]
[255 252 243]
[255 254 247]]

…,
[[ 81 80 85]
[ 50 50 52]
[ 52 52 54]
…,
[255 254 255]
[254 253 255]
[254 253 255]]

[[ 64 63 68]
[ 53 53 55]
[ 52 52 54]
…,
[255 254 255]
[254 253 255]
[254 253 255]]

[[ 54 53 58]
[ 57 57 59]
[ 52 52 54]
…,
[255 254 255]
[254 253 255]
[254 253 255]]]

Advertisements

About qainterviews

Software Geek,QA Expert,Blogger
This entry was posted in Image Recognition, Python, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s