December 2018
Intermediate to advanced
764 pages
18h 18m
English
NumPy's linalg.norm is useful for computing the Euclidean distance. The similarity between the query image and target database can be computed between the images by calculating the Euclidean distances between the features as shown here:
dist = np.linalg.norm(np.asarray(query_feature) - np.asarray(target_feature))print(dist)
Running this command should print the following:
16.9965
This is the metric that can be used for similarity calculation. The smaller the Euclidean distance between the query and the target image is, the more similar the images are. Hence, computing the Euclidean distance is a measurement of similarity. Using the features for computing the Euclidean distance is ...
Read now
Unlock full access