How to calculate horizontal and vertical correlation of an image in matlab???

34 visualizaciones (últimos 30 días)
  • How to calculate horizontal and vertical correlation of an image in matlab???
  1 comentario
Hyderkkk
Hyderkkk el 26 de Sept. de 2021
IA=rgb2gray(im2double(orginal ));
c_diag = corrcoef(IA(1:end-1, 1:end-1), IA(2:end, 2:end));
c_vert = corrcoef(IA(1:end-1, :), IA(2:end, :));
c_horz = corrcoef(IA(:, 1:end-1, :), IA(:, 2:end));
figure;
subplot(3,3,1)
plot(IA(1:end-1, 1:end-1), IA(2:end, 2:end),'b'),title(sprintf('%s Horizontal Orginal image',b));
subplot(3,3,2)
plot(IA(1:end-1, :), IA(2:end, :),'b'),title(sprintf('%s Vertical Orginal image',b));
subplot(3,3,3)
plot(IA(:, 1:end-1, :), IA(:, 2:end),'b'),title(sprintf('%s Diagonal Orginal image',b));
IAA=rgb2gray(im2double(encrption));
c_diage = corrcoef(IAA(1:end-1, 1:end-1), IAA(2:end, 2:end))
c_verte = corrcoef(IAA(1:end-1, :), IAA(2:end, :))
c_horze = corrcoef(IAA(:, 1:end-1, :), IAA(:, 2:end))
subplot(3,3,4)
plot(IAA(1:end-1, 1:end-1), IAA(2:end, 2:end),'r'),title(sprintf('%s Horizontal chiphered image ',b));
subplot(3,3,5)
plot(IAA(1:end-1, :), IA(2:end, :),'r'),title(sprintf('%s Vertical chiphered image',b));
subplot(3,3,6)
plot(IAA(:, 1:end-1, :), IA(:, 2:end),'r'),title(sprintf('%s Diagonal chiphered image',b));

Iniciar sesión para comentar.

Respuestas (3)

elhabib
elhabib el 30 de Oct. de 2017
% horizontal function rxy=H_correlation(image1)
P=double(image1);
x1 = double(P(:,1:end-1));
y1 = double(P(:,2:end));
randIndex1 = randperm(numel(x1));
randIndex1 = randIndex1(1:1000);
x = x1(randIndex1);
y = y1(randIndex1);
Ex=(1/(1000))*sum(x);
Ey=(1/(1000))*sum(y);
Dx=(1/(1000))*sum((x(:)-Ex).^2);
Dy=(1/(1000))*sum((y(:)-Ey).^2);
coxy=(1/(1000))*(sum((x-Ex).*(y-Ey)));
rxy=coxy/(sqrt(Dx*Dy));
% vertical
function Vxy=V_correlation(image1)
P=double(image1);
x1 = double(P(1:end-1,:));
y1 = double(P(2:end,:));
randIndex1 = randperm(numel(x1));
randIndex1 = randIndex1(1:1000);
x = x1(randIndex1);
y = y1(randIndex1);
Ex=(1/(1000))*sum(x);
Ey=(1/(1000))*sum(y);
Dx=(1/(1000))*sum((x(:)-Ex).^2);
Dy=(1/(1000))*sum((y(:)-Ey).^2);
coxy=(1/(1000))*(sum((x-Ex).*(y-Ey)));
Vxy=coxy/(sqrt(Dx*Dy));
  3 comentarios
Ankur Nandal
Ankur Nandal el 30 de Ag. de 2021
Dear Abunakar,
Please check the initialization of x1 and X2.

Iniciar sesión para comentar.


Mahdiyar
Mahdiyar el 10 de Abr. de 2015
Hi singhal
May you explain more about horizontal and vertical correlation?
Regards,

praveen singhal
praveen singhal el 10 de Abr. de 2015
Hello sir, This paper use horizontal,vertical and diagonal correlation of an image.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by