Part 1 - How computers represent images
A greyscale pixel and the values it can take on, from black to white
A greyscale pixel with floating point values, from black to white
Two different colours with the RGB values needed to generate them
Two different colours with their hexadecimal RGB values
The same colours with their RGB hex colour codes.
A small image of a cat with the image’s overall shape.
Part 2 - What is convolution?
kernel = (1.0 / 9.0) * [ [1, 1, 1], [1, 1, 1], [1, 1, 1] ]
kernel =[ [-1, -1, -1], [-1, 9, -1], [-1, -1, -1] ]
kernel = [ [1, 2, 1], [2, 4, 2], [1, 2, 1] ] kernel *= 1.0 / 16.0
kernel = [ [-1, -2, -1], [0, 0, 0], [1, 2 ,1] ]
kernel
Part 3 - What is PIL?
Image
from PIL import Image
Part 4 - What is NumPy?
Visualisations of the shape of some example NumPy arrays
Visualisation of the same data with different dimension structure
Quiz questions - NumPy Representation
us_image_shape = (50, 50) # Practically, greyscale images may have an extra channel when imported... us_image_shape = (50, 50, 1)
# There are 3 channels for colour and the dimensions of # 1080p video are 1920 x 1080. derm_image_shape = (1920, 1080, 3)
# There are 16 images in each batch, and each # image is 256 x 256. cxr_batch_shape = (16, 256, 256)
Any questions?