Session 7 Bonus Problem

  1. Write a function that pixelizes an image. User specifies the size of the pixelization, as well as the matrix image to be pixelized.
    Note: To pixelize = average all values in a range of p-by-p pixels and replace the individual values with the average value in that range.
    • The call for the function should be: pixelmagic(X,p), where X is the image matrix to be passed to the function and p the size over which we are pixelizing.
    • Create an output of your function using the X matrix from durer (load durer) and p = 5.
  2. Challenge Problem: Further modify the program making Ts started in class and solve these kinks (as well as those mentioned in class):
    1. Make sure the same number of background pixels are to the left and right of the T.
    2. Make sure the same number of background pixels are above and below the T.