EUCLIDEAN_DISTANCE_CVIP

euclidean_distance_cvip() - calculates the Euclidean distance between two feature vectors.

Contents

SYNTAX

d =  euclidean_distance_cvip( vector1, vector2)

Input Parameters include :

output Parameter include :

DESCRIPTION

The Euclidean distance for two vector x, and y is defined as:

$$|| x - y ||_2 = \sqrt{\sum_{i=1}^n (x_i - y_i)^2}$$

The functions calculates the euclidean distance between the two input feature vectors according to the above formula.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% input vectors

 vector1 = [1 3 4 2];

 vector2 = [-3 3.2 sqrt(2) pi];

% euclidean distance between two vectors.

 d = euclidean_distance_cvip( vector1, vector2);

 fprintf('Euclidean Distance: %d', d);
Euclidean Distance: 4.901992e+00

CREDITS

Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website