Slide 1

Slide 1 text

Image processing with scikit-image Emmanuelle Gouillart Surface, Glass and Interfaces, CNRS/Saint-Gobain @EGouillart

Slide 2

Slide 2 text

The revolution of images

Slide 3

Slide 3 text

The revolution of images

Slide 4

Slide 4 text

A flood of images several 108 images uploaded on Facebook each day

Slide 5

Slide 5 text

A flood of images hundreds of terabytes of scientific data for scientific experiment http://sdo.gsfc.nasa.gov/

Slide 6

Slide 6 text

A flood of images hundreds of terabytes of scientific data for scientific experiment http://sdo.gsfc.nasa.gov/ Image processing Manipulating images in order to retrieve new images or image characteristics (features, measurements, ...) Often combined with machine learning

Slide 7

Slide 7 text

Why use scikit-image? Lots of excellent tools available: OpenCV (computer vision), ImageJ (GUI-based software), ITK, ... Native NumPy compatibility Gentle learning curve Variety of features Versatile - 3D-friendly

Slide 8

Slide 8 text

Datasheet Package statistics http://scikit-image.org/ Release 0.11 (1 - 2 release per year) Available in most Scientific Python Distributions: Canopy, Anaconda, . . . Packaged on Ubuntu/Debian Among 1000 best ranked packages on PyPi Development model Mature algorithms Only Python + Cython code for easier maintainability Thorough code review by others: readability, PEP8, efficiency, ... Core team of 5 − 10 persons (close to applications)

Slide 9

Slide 9 text

Manipulating images as numerical (numpy) arrays Pixels are arrays elements import numpy as np image = np. ones ((5, 5)) image [0, 0] = 0 image [2, :] = 0 x

Slide 10

Slide 10 text

Manipulating images as numerical (numpy) arrays Pixels are arrays elements import numpy as np image = np. ones ((5, 5)) image [0, 0] = 0 image [2, :] = 0 x >>> coffee.shape (400, 600, 3) >>> red channel = coffee[..., 0] >>> image 3d = np.ones((100, 100, 100))

Slide 11

Slide 11 text

NumPy-native: images as NumPy arrays NumPy arrays as arguments and outputs >>> from skimage import io , f i l t e r s >>> c a m e r a a r r a y = i o . imread ( ’ camera image . png ’ ) >>> type( c a m e r a a r r a y ) >>> c a m e r a a r r a y . dtype dtype ( ’ uint8 ’ ) >>> f i l t e r e d a r r a y = f i l t e r s . g a u s s i a n f i l t e r ( camera array , sigma =5) >>> type( f i l t e r e d a r r a y ) >>> import m a t p l o t l i b . p y p l o t as p l t >>> p l t .imshow( f i l t e r e d a r r a y , cmap= ’ gray ’ ) x

Slide 12

Slide 12 text

An API relying mostly on functions skimage . f i l t e r s . g a u s s i a n f i l t e r (image , sigma , output = None, mode= ’ n e a r e st ’ , c v a l =0, m u l t i c h a n n e l =None) Multi - d i m e n s i o n a l Gaussian filter Parameters ---------- image : array - l i k e input image ( g r a y s c a l e or c o l o r ) to filter. sigma : s c a l a r or sequence of s c a l a r s st and ard d e v i a t i o n f o r Gaussian k e r n e l . The st and ard d e v i a t i o n s of the Gaussian filter are g i v e n f o r each a x i s as a sequence , or as a s i n g l e number , in which case i t i s equal f o r all axes . output : array , o p t i o n a l The ‘‘ output ‘‘ parameter p a s s e s an a r r a y in which to s t o r e the filter output .

Slide 13

Slide 13 text

Getting started: finding documentation

Slide 14

Slide 14 text

Gallery of examples

Slide 15

Slide 15 text

Getting started: finding documentation

Slide 16

Slide 16 text

Filtering: transforming image data skimage.filter, skimage.exposure, skimage.restoration

Slide 17

Slide 17 text

Extracting features skimage.feature, skimage.filter

Slide 18

Slide 18 text

Feature extraction followed by classification Combining scikit-image and scikit-learn Extract features (skimage.feature) Pixels intensity values (R, G, B) Local gradients More advanced descriptors: HOGs, Gabor, ... Train classifier with known regions here, random forest classifier Classify pixels

Slide 19

Slide 19 text

Geometrical transformations skimage.transform scale, zoom, rotate, swirl, warp, ...

Slide 20

Slide 20 text

Segmentation: labelling regions skimage.segmentation

Slide 21

Slide 21 text

Measures on images skimage.measure

Slide 22

Slide 22 text

Versatile use for 2D, 2D-RGB, 3D... >>> from skimage import measure >>> l a b e l s 2 d = measure . l a b e l ( image 2d ) >>> l a b e l s 3 d = measure . l a b e l ( image 3d ) x

Slide 23

Slide 23 text

Try it out! http://scikit-image.org/ Feedback welcome github.com/scikit-image/scikit-image Please cite the paper