forked from Mrahman17/mmWave-Radar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_match.m
31 lines (23 loc) · 982 Bytes
/
image_match.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
clc; clear all; close all;
% Read two imges
A=('E:\Mahbub\Villanova-mbgan\towards.png');
B=('wlk_Cane\MBGAN\110.png');
% Find Envelop
[UpA,~,DwnA]=env_find(A);
[UpB,~,DwnB]=env_find(B);
figure; imshow(rgb2gray(imread(A)));hold on; plot(UpA); hold off;
figure; imshow(rgb2gray(imread(B)));hold on; plot(UpB);
% DIscrete Frechet Distance, cm
[cm, cSq] = DiscreteFrechetDist(UpA,UpB);
% Dynamic Time-Wrapping distance
dist = dtw(UpA,UpB);
% Structural similarity (SSIM) index
test_img=rgb2gray(imread(B));
ref_img =rgb2gray(imread(A));
ssimval = ssim(test_img,ref_img);
% For 2 group of images, we can find pearson correlation and canonical
% correlation. We need to convert the whole image into a signle Row
% vectors, in this way form a matrix for each group of images. then find
% their correlations
R = corrcoef(group1,group2); % Pearson correlations. look into diagonal values.
[A,B,r] = canoncorr(X,Y); % Cannonical correlations. A,B coefecient, r is the correlations.