ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Unsorted > задача:


50519 - Image Filtering

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50430 - ATM
• 50489 - Football Championship
• 50391 - Cinema Tickets
• 50820 - Post Office
• 50810 - Print Office
• 50952 - Derby Tirana
• 50443 - Dajte Express
• 50819 - Linked Numbers
• 50519 - Image Filtering
• 50798 - Passing the course
• 50799 - OSHEE Electric Bill
• 50833 - Min of Odd Positions
• 50821 - Derivative of an array
• 50808 - Total Distance Traveled
• 50817 - The Knight Move
• 50537 - esreveR Triangle
• 50402 - Hello World!

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Image Filtering

In image processing, images are filtered (convolved) using different filters. Different filters provide different results on images: like noise filtering, or sharpening images. When filtering, the filter (or the window) is moved on every pixel and according to neighboring pixels values and the values in the window, new values are calculated. When filtering images, according to the size of the window, image is either padded zeros or the bordering pixels are replicated.

Question: Write a program that reads an image and a filter, then your program should print the highest pixel of the image.

Input specification
In the first line you will be given two integers for the image size: the number of rows (m) and the number of columns (n) where 1 ≤ m ≤ 1,000 and 1 ≤ n ≤ 1,000. Then in the following m lines you will be given n integers where each integer is between 0 and 255. Then in the following line, you will be given the size of filtering window (r and c) where r and c are between 1 and 20 (for simplicity r and c will be odd numbers). The following r lines will have c integers which are between 0 and 255.

Output specification
in the first line, show the highest value. Then show convolved image by rounding to the nearest integer. Note: The image is divided by the sum of the values in the filter. Leave the output as it's, if the sum of the filter is 0.

Sample Input I
3 4
5 6 3 9
10 3 6 10
4 8 7 6
3 3
1 2 1
2 4 2
1 2 1
Sample Output I
6
3 4 4 4
5 6 6 6
3 5 5 4


Для отправки решений необходимо выполнить вход.

www.contester.ru