forked from Nexnull/Leetcoding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab.py
47 lines (39 loc) · 1.09 KB
/
lab.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
one = [94,209,246,254,93,
182,31,225,187,205,
125,7,203,245,218,
52,254,212,15,214,
243,76,31,187,18]
two = [216,64,45,191,48,
109,210,220,205,64,
50,144,97,251,241,
164,221,226,1,20,
169,87,113,121,31]
a,b,c,d = 0,0,0,0
for i in one:
if 0<=i and i <=63:
a += 1
if 64<=i and i<=127:
b += 1
if 128<=i and i<=191:
c += 1
if 192<=i and i<=255:
d += 1
print(a,b,c,d,a+b+c+d)
a,b,c,d = 0,0,0,0
for i in two:
if 0<=i and i <=63:
a += 1
if 64<=i and i<=127:
b += 1
if 128<=i and i<=191:
c += 1
if 192<=i and i<=255:
d += 1
print(a,b,c,d,a+b+c+d)
"""
Histogram Equalization is a computer image processing technique used to improve contrast in images .
flattening the pixel in histogram evenly and changing amount of pixels
Using grayscala mapping function to do this process to make sure do not loss any pixels
To convert a frequency distribution to a probability distribution and
divide area of the bar or interval of x by the total area of all the Bars.
"""