フィルターのクリア

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

11 ビュー (過去 30 日間)
praveen singhal
praveen singhal 2015 年 4 月 10 日
コメント済み: Ahmed raafat 2022 年 10 月 22 日
  • How to calculate horizontal and vertical correlation of an image in matlab???
  1 件のコメント
Hyderkkk
Hyderkkk 2021 年 9 月 26 日
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));

サインインしてコメントする。

回答 (3 件)

elhabib
elhabib 2017 年 10 月 30 日
% 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 件のコメント
Ankur Nandal
Ankur Nandal 2021 年 8 月 30 日
Dear Abunakar,
Please check the initialization of x1 and X2.
Ahmed raafat
Ahmed raafat 2022 年 10 月 22 日
Thank you Sir
Thank You Very Very Much

サインインしてコメントする。


Mahdiyar
Mahdiyar 2015 年 4 月 10 日
Hi singhal
May you explain more about horizontal and vertical correlation?
Regards,

praveen singhal
praveen singhal 2015 年 4 月 10 日
Hello sir, This paper use horizontal,vertical and diagonal correlation of an image.

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by