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

29 visualizzazioni (ultimi 30 giorni)
  • How to calculate horizontal and vertical correlation of an image in matlab???
  1 Commento
Hyderkkk
Hyderkkk il 26 Set 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));

Accedi per commentare.

Risposte (3)

elhabib
elhabib il 30 Ott 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 Commenti

Accedi per commentare.


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

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

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by