For local enhancement using mean and variance, the key condition is:
The region or neighborhood for calculating the mean and variance must be chosen such that it is not affected by abrupt changes in intensity (edges or discontinuities).
In other words, for effective local enhancement, the local region must be homogeneous enough to allow meaningful statistical calculation of mean and variance. If the region contains significant edges or texture, the calculated mean and variance might not reflect the intended local characteristics and could lead to improper enhancement.
This ensures that the statistical measures (mean and variance) used for enhancement represent a uniform portion of the image or data, enhancing local features without introducing artifacts from edge effects or noise.