two_point_correlation_fft

Import packages

[1]:
import matplotlib.pyplot as plt
import numpy as np
import porespy as ps

ps.visualization.set_mpl_style()
np.random.seed(10)

Genearate image for testing

[2]:
skel = ps.generators.blobs(shape=[500, 500])
im = ps.filters.prune_branches(skel)
fig, ax = plt.subplots()
ax.imshow(im, origin="lower");
../../../_images/examples_metrics_howtos_two_point_correlation_4_0.svg

Apply metric function

Output is a tuple with elements probability and distance

[3]:
x = ps.metrics.two_point_correlation(im=im)
[4]:
plt.figure()
plt.title("Probability vs. Distance")
plt.plot(x.distance, x.probability)
plt.show();
../../../_images/examples_metrics_howtos_two_point_correlation_8_0.svg