Normalization of an image in MATLAB If I have an image whose range is from $-18.3667\cdot10^{-5}$ to $9.3127$, how could I normalize it on the same gradient so that they fall between a specific range, say fro $0$ to $255$?
First, shift: put the minimum to $0$, by compensating the actual minimum $m=−18.3667⋅10^5$ for every pixel: $p\to p - m$. Now your pixels are between $0$ and a new maximum $M = 9.3127 - m$. Finally you want the final image in $[0,255]$. The second operation is scale: multiply by something, so that $0$ remains at $0$, and $M$ is cast to $255$. So you have to multiply by $255/M$.