Image blurring occurs when the object being captured is out of the camera’s focus. The top two figures on the right are an example of an image and its blurred version. Restoring the original image given only the blurred version is one of the most interesting topics in image processing. This process is called deblurring, which will be your task for this problem.
In this problem, all images are in grey-scale (no colours). Images are represented as a 2 dimensional matrix of real numbers, where each cell corresponds to the brightness of the corresponding pixel. Although not mathematically accurate, one way to describe a blurred image is through averaging all the pixels that are within (less than or equal to) a certain Manhattan distance (The Manhattan Distance (sometimes called the Taxicab distance) between two points is the sum of the (absolute) difference of their coordinates. The grid on the lower right illustrates the Manhattan distances from the grayed cell.) from each pixel (including the pixel itself). Here’s an example of how to calculate the blurring of a 3*3 image with a blurring distance of 1:
__poj_jax_start__blur\left(\left[\begin{array}{ccc}2&30&17\\25&7&13\\14&0&35\end{array}\right]\right)=\left[\begin{array}{ccc}\frac{2+30+25}{3}&\frac{2+30+17+7}{4}&\frac{30+17+13}{3}\\[10px]\frac{2+25+7+14}{4}&\frac{30+25+7+13+0}{5}&\frac{17+7+13+35}{4}\\[10px]\frac{25+14+0}{3}&\frac{7+14+0+35}{4}&\frac{13+0+35}{3}\end{array}\right]=\left[\begin{array}{ccc}19&14&20\\12&15&18\\13&14&16\end{array}\right]__poj_jax_end__
Given the blurred version of an image, we are interested in reconstructing the original version assuming that the image was blurred as explained above.