[ad8447]: / (2) PyTorch_HistoTNet / util / normImageTo255.py

Download this file

11 lines (8 with data), 162 Bytes

1
2
3
4
5
6
7
8
9
import numpy as np
def normImageTo255(x):
minX = np.min(x)
maxX = np.max(x)
x2 = x - minX
x3 = x2 / (maxX-minX)
x4 = x3 * 255
return x4