2-point cluster function#

Theory#

If an image consists of isolated clusters (‘islands’ of connected pixels with the same value), the 2-point cluster function can be used to quantify the probability that two points are in the same cluster. It is defined as follows:

\[C_2 (\Delta x) = P \big\{ \mathcal{C}(\vec{x}) = \mathcal{C}(\vec{x}+\Delta\vec{x}) \neq 0 \big\}\]

whereby \(\mathcal{C}\) is an indicator with a unique non-zero index for each cluster.

See also

  1. Torquato (2002). Random Heterogeneous Materials (1st ed.). Springer, New York, USA. doi:10.1007/978-1-4757-6355-3

Example#

_images/C2.svg

Note

Like for the 2-point correlation, a mask can be used. Similarly, the average can be extended to that of an ensemble of images.

C2.py

import GooseEYE
import numpy as np

# generate image, extract 'volume-fraction' for plotting
img = GooseEYE.dummy_circles((500, 500))
phi = np.mean(img)

# 2-point probability for comparison
S2 = GooseEYE.S2((101, 101), img, img)

# determine clusters, based on the binary image
C = GooseEYE.clusters(img)

# 2-point cluster function
C2 = GooseEYE.C2((101, 101), C, C)