HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50518 - Histogram Equalization

Guest
• Review clarifications (4)

Section problems

• 50807 - Euro to Leke
• 50871 - Harmonic Mean
• 50521 - Pound to Grams
• 50292 - Average of 4 Marks
• 50432 - Numbers and Squares
• 50510 - What floor are they?
• 50870 - ZScore normalization
• 50797 - Nr of Missing Guests
• 50518 - Histogram Equalization
• 50522 - Multiplication Table - 2
• 50814 - Buying Books from Internet
• 50812 - Total Discount for the clients
• 51003 - Double Prime
• 50435 - City Electric Bills
• 50527 - Sum of LCMs
• 50440 - Call Center
• 50342 - 100 Factorial

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