Images and Vision in Python

18
Images and vision in python Jonathan Street

description

Creating and analysing images in python using PIL, scipy.ndimage and mahotas

Transcript of Images and Vision in Python

Page 1: Images and Vision in Python

Images and vision in python

Jonathan Street

Page 2: Images and Vision in Python

Creation AnalysisPILpypng

Scipy.ndimageMahotaspymorph

Common? Specialist?

Page 3: Images and Vision in Python

PIL

• Reading/writing/converting image files

• Filters/Enhancements

• Likely uses creating thumbnails, drawing graphs etc.

Page 4: Images and Vision in Python

Growing neural gas visualisation

Page 5: Images and Vision in Python
Page 6: Images and Vision in Python

Demo

• Image creation

• Drawing

• Text

• Viewing/saving the image

Page 7: Images and Vision in Python

Windows Gotchas

• Image preview

• Truetype font support– http://www.lfd.uci.edu/~gohlke/pythonlibs/

Page 8: Images and Vision in Python

Vision

Extracting information from images

Page 9: Images and Vision in Python

Ndimage

• Part of scipy

• ~80 different functions

• Convenience functions

• Filters

• Interpolation

• Measurements

• Morphology

Page 10: Images and Vision in Python

Mahotas

• Partly implemented in C++ for speed

• ~40 functions

• Feature detection

• Thresholding

• Transforms

Page 11: Images and Vision in Python

Mahotas

• bbox

• bwperim

• center_of_mass

• close_holes

• convolve

• croptobbox

• cwatershed

• dilate

• distance

• edge

• erode

• euler

• features

• freeimage

• fullhistogram

• get_structuring_elem

• histogram

• imread

• imresize

• imsave

• lbp

• majority_filter

• moments

• morph

• otsu

• rc

• resize

•segmentation•sobel•stretch•tas•texture•thin•thresholding•zernike

Page 12: Images and Vision in Python

PIL <-> Numpy array

PIL[a,b] Numpy array[a,b]

a b

ba

Page 13: Images and Vision in Python

Open Plaques Transcription

“Open Plaques is a service that aims to find and provide data about all the commemorative 'plaques' (often blue and round) that can be found across the UK and worldwide.”

Page 14: Images and Vision in Python
Page 15: Images and Vision in Python
Page 16: Images and Vision in Python
Page 17: Images and Vision in Python
Page 18: Images and Vision in Python

Links

• http://packages.python.org/mahotas

• http://packages.python.org/pymorph

• http://docs.scipy.org/doc/scipy/reference/ndimage.html

• http://www.pythonware.com/products/pil/

• http://pythonvision.org/