For local enhancement using mean and variance, the condition is:
The region or neighborhood used for calculating the mean and variance should be sufficiently homogeneous to avoid distortions due to abrupt intensity changes or edges.
This condition ensures that the local enhancement will be effective, as the statistical measures (mean and variance) will better represent the local features and texture without being influenced by significant edges or sharp transitions in the image or data.