matrix correlation in different directions

1 次查看(过去 30 天)
Hey,
I would like to write a function thats gets two matrices and a direction (x-axis (o degrees)\yaxis (90 degrees)\diagonal (45 degrees)) and calculates the correlation in that direction.
for example, if I have matrices A and B, then
C = direction_corr(A,B,angle)
will give the correlation between the rotated matrices. So 0 is the regular correlation and 45 will give:
C=[sum(A(end,1)*B(1,end)),sum(A(end-1:end,1:2).*B(1:2,end-1:end),'all')...]
the 0 and 90 cases are easy, but I'm not sure what to do about the diagonal case. If i use imrotate it interpolates pixels and give me a wrong result.
Thanks in advence,
Oded

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by