For local enhancement using mean and variance, the condition is:
The local region should be sufficiently small to capture local variations but large enough to provide reliable statistical calculations (mean and variance).
This ensures that the calculated mean and variance reflect the local characteristics, such as texture and contrast, without being influenced by large-scale features or noise. If the region is too large, it may smooth out important local details; if it's too small, the statistics may become unreliable.