def getRMScontrast(matrix):
 matrix = matrix.flat
 RMScontrast = ((sum(((matrix - numpy.mean(matrix)) ** 2)) / len(matrix)) ** 0.5)
 return RMScontrast

def getRMScontrast ( matrix ) : matrix = matrix . flat RMScontrast = ( ( sum ( ( ( matrix - numpy . mean ( matrix ) ) ** 2 ) ) / len ( matrix ) ) ** 0.5 ) return RMScontrast
returns the rms contrast of a array .