The functionality is as follows:
- The crop() function executes the following tasks:
- Multiplies all pixels with an intensity of 28 with a numpy array of 1s and stores in variable a.
- Checks for all instances where an entire column consists of only pixel intensities of 28 and stores in variable b.
- Deletes all columns (or Y axes) where pixel intensities are 28 for the entire column.
- Plots the resulting image.
-
- Transposes the image in order to perform the preceding set of operations on all the rows (or X axes) in a similar manner.
-
- Multiplies all pixels with an intensity of 28 with a numpy array of 1s and stores in variable d.
- Checks for all instances where an entire column consists of only pixel intensities of 28 and ...