How to get correlation coefficients in matlab

一笑奈何 提交于 2020-01-02 23:09:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!