问题
In every paper i read about encryption they like to show the correlation coefficients of their encrypted image by showing 3 values: Horizontal correlation coefficient . vertical correlation coefficient. diagonal correlation coefficient . and they show these 3 values for encrypted image and also for plain image(lena). My question is how to do this in matlab ? and if there is no matlab function for it , what are the equation they are using to get those 3 values ?
Table 2 Correlation coefficients of two adjacent pixels in two images example:
Plain-image Ciphered image
Horizontal 0.92401 0.01589
Vertical 0.95612 0.06538
Diagonal 0.92659 0.03231
Any lead would be helpful , thanks
回答1:
If I understood it correctly, you would like to perform a correlation analyis for pairs of pixels within a certain given image.
In principle I would go for the cov
function: in your specific case, cov
will retrieve a [2*2]
symmetric matrix. The diagonal elements will represent your horizontal and vertical correlation coefficients, whereas the lower (upper) triangular elements will stay for the diagonal correlation coefficient.
I hope this will help you.
来源:https://stackoverflow.com/questions/16095429/how-to-get-correlation-coefficients-in-matlab