For local enhancement using mean and variance, the key condition is:
The local region should be homogeneous or smooth enough for the mean and variance to provide meaningful statistical measures.
This means that the region used for computing the mean and variance should not contain sharp edges, high-frequency noise, or significant texture variations. If the region is too complex or contains sharp transitions, the calculated statistics (mean and variance) may not effectively enhance the local features, as they would be influenced by these abrupt changes.
In essence, the condition is that the local region should be relatively uniform to ensure the effectiveness of the local enhancement, while still capturing enough local detail.