Filter löschen
Filter löschen

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

22 Ansichten (letzte 30 Tage)
  • How to calculate horizontal and vertical correlation of an image in matlab???
  1 Kommentar
Hyderkkk
Hyderkkk am 26 Sep. 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));

Melden Sie sich an, um zu kommentieren.

Antworten (3)

elhabib
elhabib am 30 Okt. 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 Kommentare
Ankur Nandal
Ankur Nandal am 30 Aug. 2021
Dear Abunakar,
Please check the initialization of x1 and X2.

Melden Sie sich an, um zu kommentieren.


Mahdiyar
Mahdiyar am 10 Apr. 2015
Hi singhal
May you explain more about horizontal and vertical correlation?
Regards,

praveen singhal
praveen singhal am 10 Apr. 2015
Hello sir, This paper use horizontal,vertical and diagonal correlation of an image.

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by