@@ -0,0 +1,1064 @@
+import numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom numpy import zeros%0A%0Aimga = zeros(%5B128,128%5D)%0A%0Adef histogram_normalization(data,rate):%0A%0A    g,h = np.histogram(data)%0A    m = np.zeros((10,3))%0A    low = data.min()%0A    high = data.max()%0A    for i in np.array(range(10)):%0A        m%5Bi,0%5D = g%5Bi%5D%0A        m%5Bi,1%5D = h%5Bi%5D%0A        m%5Bi,2%5D = h%5Bi+1%5D%0A%0A    g = sorted(g,reverse = True)%0A    S = np.size(g)%0A#    Rate = 0.05%0A    Index = 0%0A%0A    for i in np.array(range(S)):%0A        if g%5Bi%5D/g%5B0%5D %3E rate:%0A            Index = Index + 1%0A%0A    for i in np.array(range(10)):%0A        for j in np.array(range(Index)):%0A            if g%5Bj%5D == m%5Bi,0%5D:%0A                high = m%5Bi,2%5D%0A    print(high)%0A    return high%0A%0A%0Afor y in range(128):%0A    for x in range(128):%0A        if y %3E 39 and y %3C 88 and x %3E 39 and x %3C88:%0A            imga%5Bx,y%5D = 100%0A        if y %3E 59 and y %3C 69 and x %3E 59 and x %3C 69:%0A            imga%5Bx,y%5D = 255%0A%0Arate = 0.1%0Ahigh = histogram_normalization(imga,rate)%0Avol = np.interp(imga, xp=%5Bimga.min(), high%5D, fp=%5B0, 255%5D)%0A%0Aplt.imshow(imga,%22gray%22)%0A%0Afigure()%0Aplt.imshow(vol,%22gray%22)%0A

add test