Prepare Images For CNN
How are images looked at by computers?
Matrices
Number in matrix represents darkness of image in that position (darker part → larger #)
How are coloured images looked at by computers?
Matrices, but with extra dimension (RGB)
Stack of 3 matrices
Reshaping Numpy Arrays
We have a numpy array (
images
) of these dimensions:(x, )
Need 4D array for input shape whose product is
So we can take and reshape as:
Plotting Images as Numpy Arrays
Creating Labels with Numpy Arrays
Last updated