Statistical analysis to define homogeneity and heterogeneity of a population I am seeking a statistical test for deciding if the studied data are homogeneous or not.  For instance an image region is considered to be heterogeneous if there is an abrupt change of intensity. Some techniques such as the coefficient of variation was found to be not robust. In fact, could someone please told me what are other techniques used in the same sense.

EDIT :
In response to this answer, as I am working with data representing intensities of pixels within an image. The heterogeneity reflects a sudden change in the intensity within a region as shown in the images below (the fully black is considered homogeneous while the other black region  has a sudden change in the intensity).
What I am looking for, is a metric that in somehow could make the decision (a binary decision). Does the Gini coefficient has a threshold value commonly used?


 A: @Nilos thanks for the response. As i am working with data representing intnsities of pixels within an image. The heterogneity reflects a sudden change in the intensity within a region as shown in the images below (the fully black is considerd homogeneous while the other black region  has a sudden change in the intensity). What i am looking for, is a metric that in somehow could make the decision ( a binary decision). Does the Gini coefficient has a threshold value commonly used?


A: There will be more than one answer for until you have a unique definition for what you mean by homogeneity for your purpose.
One of the most popular statistical metric which is used to measure homogeneity quantitative economics is the Gini coefficient $G$ which is a single number aimed at measuring the degree of inequality in a distribution. It is most often used in economics to measure how far a country's wealth or income distribution deviates from a totally equal distribution. A Gini coefficient of zero expresses perfect equality or homogeneity, where all values are the same (for example, where everyone has the same income) and 100 expresses perfect inequality or heterogeneity.
