Calculation of covariance matrix of image

does someone know how to calculate covariance matrix of an image in pytorch?

Can you mathematically describe what you want? What is covariance of a single image?

Hello,
I was wondering if you still had any thoughts on this. I’m trying to calculate the structural dissimilarity index metric (DSSIM) and there for using the structural similarity metric (SSIM) to do so. As part of the formula, I need to find the covariance of two images x and xT. Do you know how I can go about doing this? I know the numpy.cov seems to through a fit because of the three dimensional shape.