当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3999:Kind of a Blur

题目描述
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__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]

Given the blurred version of an image, we are interested in reconstructing the original version assuming that the image was blurred as explained above.
输入解释
Input consists of several test cases. Each case is specified on H + 1 lines. The first line specifies three non negative integers specifying the width W, the height H of the blurred image and the blurring distance D respectively where (1 ≤ W,H ≤ 10) and (D ≤ min(W/2,H/2)). The remaining H lines specify the gray-level of each pixel in the blurred image. Each line specifies W non-negative real numbers given up to the 2nd decimal place. The value of all the given real numbers will be less than 100.
Zero or more lines (made entirely of white spaces) may appear between cases. The last line of the input file consists of three zeros.
输出解释
For each test case, print a W * H matrix of real numbers specifying the deblurred version of the image. Each element in the matrix should be approximated to 2 decimal places and right justified in a field of width 8. Separate the output of each two consecutive test cases by an empty line. Do not print an empty line after the last test case. It is guaranteed that there is exactly one unique solution for every test case.
输入样例
2 2 1
1 1
1 1

3 3 1
19 14 20
12 15 18
13 14 16

4 4 2
14 15 14 15
14 15 14 15
14 15 14 15
14 15 14 15

0 0 0
输出样例
    1.00    1.00
    1.00    1.00

    2.00   30.00   17.00
   25.00    7.00   13.00
   14.00    0.00   35.00

    1.00   27.00    2.00   28.00
   21.00   12.00   17.00    8.00
   21.00   12.00   17.00    8.00
    1.00   27.00    2.00   28.00

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 anarc 2009

源链接: POJ-3999

最后修改于 2020-10-29T07:17:54+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536