如何在Matlab中获得相关系数 [英] How to get correlation coefficients in matlab

查看:262
本文介绍了如何在Matlab中获得相关系数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我读过的每篇关于加密的论文中,他们都喜欢通过显示3个值来显示其加密图像的相关系数: 水平相关系数. 垂直相关系数. 对角线相关系数. 并显示加密图像和纯图像(lena)的这3个值. 我的问题是如何在matlab中执行此操作?如果没有matlab函数,它们用来获取这3个值的方程是什么?

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 ?

表2 两幅图像中两个相邻像素的相关系数 例如:

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

推荐答案

如果我正确理解它,则希望对给定图像中的成对像素执行相关分析.

If I understood it correctly, you would like to perform a correlation analyis for pairs of pixels within a certain given image.

原则上,我会使用cov函数:在您的特定情况下,cov将检索[2*2]对称矩阵.对角线元素将代表您的水平垂直相关系数,而下部(上部)三角形元素将保留为对角线相关系数.

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.

这篇关于如何在Matlab中获得相关系数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆