Filter löschen
Filter löschen

matrix correlation in different directions

1 Ansicht (letzte 30 Tage)
Oded Scharf
Oded Scharf am 2 Dez. 2020
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

Antworten (0)

Kategorien

Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by