Theoretical background
Here, we present a short theoretical introduction to the representativity analysis of binary images.
REV concept.
Representative Elemental Volume (REV) concept is a useful characteristic of the system heterogeneity. By definition, REV is the smallest volume in which large fluctuations of observed quantities or calculated metric no longer occur. So, subdomains with volumes larger than REV can be treated as homogenous.
The common technique for some metric REV analysis is cutting subsamples of growing sizes from a given sample and comparison of the studied metric values for them. One can perform REV analysis for a scalar metric \(S\) by checking if the values of \(S\) converge to a stable value with an increasing subsample volume of the studied sample. Two criteria can be applied for the estimation of such a convergence:
the difference in values of \(S\) for subsamples of different sizes becomes negligible (I);
the deviations of \(S\) for subsamples of fixed size becomes negligible (II).
We call REV obtained using criteria (I) and (II) deterministic (dREV) and statistical (sREV), respectively.
For a vector metric \(\boldsymbol{V}\) the same criteria can be used as well, with the substitution of the difference in scalar values by the distance between vectors.
Subsamples selection.

At i-th selection step subsamples for REV analysis SC \(_k(i)\) are taken as it is shawn in the figure above. Total number of selection steps \(N\) is input parameter for computations.
The reliable sREV analysis is possible only if subsamples do not overlap or their overlap is limited. Therefore, we introduce the \(N_{sREV}\) parameter. For \(i \le N_{sREV}\), we cut from the considered sample all 9 subsamples SC \(_k(i)\). For \(i > N_{sREV}\), only the center subsamples SC \(_0(i)\) are cut.
REV size estimation. Scalar metric.
For the estimation of sREV size for scalar metric \(S\), we first calculate its values \(S_{ik}\) for the subsamples SC \(_k(i)\), and then obtain mean value \(\bar{S_i}\), standard deviation \(\sigma_i\) and, finally, use the following formula:
where \(\varepsilon_{sREV}\) is sREV threshold. The value, obtained using Eq. (1), is assigned to the attribute sREV_size_1 of an REVAnalyzer object in the case of scalar metric REV analysis.
For the estimation of dREV size we use two different formulas:
and
where \(S_0\) is the metirc value for the uncut analyzed image and \(\varepsilon_{dREV}\) is dREV threshold. The values, obtained using Eqs. (2) and (3), are assigned, respectively, to the attributes dREV_size_1 and dREV_size_2 of an REVAnalyzer object in the case of scalar metric REV analysis.
REV size estimation. Vector metric.
One can apply the methods for REV size estimation for scalar metric \(S\) described above to the vector metric \(\boldsymbol{V}\), using some adjustments. Let some descriptor \(D_i\) defined at \(i\)-th subcube is vectorized into the vector \(\boldsymbol{V_i}(N_{\textrm{bins}}(i), s(i), r(i))\), where number of bins \(N_{\textrm{bins}}(i)\), bin size \(s(i)\) and range \(r(i)\) are vectorization parameters. We fix bin size equal for all the subcubes: \(s(i)\) = const, and require that vector \(\boldsymbol{V_{i+1}}\) obtained from \(D\) at the next increment step should have the same dimension (equal to number of bins) and range, as \(\boldsymbol{V_i}\). If ranges \(r(i)\) and \(r(i+1)\) coincide, this condition is satisfied automatically, in opposite case, vector \(\boldsymbol{V_{i+1}}\) is modified to the vector \(\boldsymbol{V*_{i+1}}\) as the following: bins, present in \(r(i)\) but absent in \(r(i+1)\) are added to \(\boldsymbol{V_{i+1}}\) and filled by zeroes, bins absent in \(r(i)\) but present in \(r(i+1)\) are removed from \(\boldsymbol{V_{i+1}}\) (see figure below).

At each selection step \(i\) we take subsamples SC \(_k(i)\) and SC \(_l(i+1)\) and compute the normalized distance between the vectors \(\boldsymbol{V_{l(i+1)}}\) and \(\boldsymbol{V_{ki}}\):
Order of the vector norm \(||\boldsymbol{V}||\) is the input parameter of any vectorizer used in PARSE library.
For the estimation of dREV and sREV sizes for vector metric, fist we calculate mean values \(\bar{\delta}(i)\) over all pairs of indices (\(k\), \(l\)), its standard deviation \(\sigma_i\) and normalized standard deviation \(\sigma_{norm}(i) = \sigma_i/ \bar{\delta}(i)\).
Then for the estimation of dREV size we use the following formula:
where \(\varepsilon_{dREV}\) is dREV threshold. The value, obtained using Eq. (5), is assigned to the attribute dREV_size_1 of an REVAnalyzer object in the case of vector metric REV analysis.
For the estimation of sREV size we use two following formulas:
and
where \(D(i) = \varepsilon_{dREV}\), if \(\bar{\delta}(i) < \varepsilon_{dREV}\) and \(D(i) = \bar{\delta}(i)\) if \(\bar{\delta}(i) \ge \varepsilon_{dREV}\); \(\varepsilon_{sREV}\) is sREV threshold. The values, obtained using Eqs. (6) and (7), are assigned, respectively, to the attributes sREV_size_1 and sREV_size_2 of an REVAnalyzer object in the case of scalar metric REV analysis.
Image comparison.
To compare image samples \(A\) and \(B\) using descriptor \(D\) susceptible to vectorization one can make modification as decribed above and calculate the distance value:
Stationarity analysis.
We propose the following empirical stationarity criterion in our library. For all \(i = 1, ..\le N_{sREV}-1\) and \(k,l = 0,..8\) we compute the values
and
Then we check out the satisfaction of following condition:
Here, \(\varepsilon_{st}\) is stationarity threshold.