Computes the spatial weighted covariance of a pair of pixels in a given image.
spaCov(img, i1, i2, j1, j2, K)
the given image
the row index of the first pixel in the pair.
the column index of the first pixel in the pair.
the row index of the second pixel in the pair.
the column index of the second pixel in the pair.
the weighted matrix.
The spatial weighted covariance.
Bui, A.T. and Apley., D.W. (2018a) "A Monitoring and Diagnostic Approach for Stochastic Textured Surfaces", Technometrics, 60, 1-13.