Your first task is to provide a function called reconstruct that reconstructs an image
using the k-nearest neighbour algorithm. The reconstruct function must take 4 parameters,
the name of the damaged image file, an integer value for k in the k-nearest neighbour
algorithm and two function handles. The first handle to a function that calculates the distance
between 2 pixels and the second a handle that calculates a best colour from a list
of colours each associated with a distance value. The following figures show a damaged
file, a reconstructed file and the original image.
The reconstruct function should load the damaged image file (which may be indexed
or RGB), reconstruct it, show both the original and new images using subplot with
appropriate titles. It should also save the new image with a filename that indicates the
parameters passed to the reconstruct function.