HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Image Processing and compression > problem:


50518 - Histogram Equalization

Guest
• Review clarifications (4)

Volume problems

• 50519 - Image Filtering
• 50829 - Decode an Image
• 50518 - Histogram Equalization
• 50535 - Image Compression
• 067. 50512 - Coding redundancy

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Histogram Equalization

In digital image processing Histogram Equalization is a common method to distribute intensity values equally to entire range of intensity values. The following function is used to distribute the intensity values:


where r is the input image, s is the transformed image, L represents the intensity range (2n-1 , either 7, 15, 31, 128, 255 or etc. ) pr(rj) is the frequency of the intensity value of (rj).

Question: Write a program that reads MxN image information and it prints the distribution of intensities for the new image.

Input specification
You will be given two integers in the beginning: the number of rows (M) and the number of columns (N). Then in the following M lines you will be given N integers where 1 ≤ M ≤ 300 and 1 ≤ N ≤ 300. Note: You need to identify L from the given data.

Output specification
Show the new distribution of intensities in increasing order. Do not show an intensity if it is not used in the new image.

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


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

www.contester.ru