PATTERN_CITY_BLOCK_CVIP

pattern_city_block_cvip() - takes two csv files as input, test and training set, then calculates the city block distance metric by comparing each vector in the test set to each in the training set.

Contents

SYNTAX

d = pattern_city_block_cvip(file_tt, file_tr)

Input Parameters include:

Output Parameters include :

DESCRIPTION

Using city block metric, the function calculates the distance between the vectors in training set and the test set. The distances are returned in a matrix form whose rows represent the test vectors and columns represent the training vectors.

REFERENCE

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

EXAMPLE

% Test set file

 file_tt = 'myTestVectors.CSV';

% Training set file

 file_tr = 'myTrainingVectors.CSV';

% Calling function

 d = pattern_city_block_cvip(file_tt, file_tr)
d =

    25    24    29    25    16    13    13
    37    36    41    19    18    23    23
    25    24    29    17     8    11    11
    38    37    42    20    19    24    24
    25    24    29    15     6    11    11
    24    23    28    22    13    10    10
     0     9    12    18    19    14    14
     9     0     5    17    18    13    13
    12     5     0    22    23    18    18
    18    17    22     0     9    12    12
    19    18    23     9     0     5     5
    14    13    18    12     5     0     0

CREDITS

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