I am developing software that stores 128D vector with SIFT descriptor of an image. Then I want to get all image similars to a given image, but the similarity between image are the euclidean distance. How can i calculate the euclidean distance between this vectors?
Asked
Active
Viewed 1,593 times
1
-
The [Euclidean Distance](https://en.wikipedia.org/wiki/Euclidean_distance) page on Wikipedia may be worth reviewing. Not sure what this has to do with [tag:mongodb] – jq170727 Oct 03 '17 at 04:45
-
You cannot (reasonably) do this calculation inside of MongoDB. You'll have to do that in application code. – Thilo Oct 03 '17 at 04:59
1 Answers
-2
MongoDB supports 2d indexes and geospatial queries. Please first check 2d Indexes to know how to properly structure the index.
After that, you can calculate the Euclidian distance on a 2d plane with queries.
Also check this Stackoverflow post. (But remember not to set spherical
to true
, since your space is 2D).

abmirayo
- 173
- 2
- 15
-
It just required to store embedding into the column and need to find square root using aggregation – Arjun Kava Apr 09 '19 at 08:45