Questions tagged [euclidean-distance]

the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula.

In mathematics, the Euclidean distance or Euclidean metric is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula. By using this formula as distance, Euclidean space (or even any inner product space) becomes a metric space. The associated norm is called the Euclidean norm.

http://en.wikipedia.org/wiki/Euclidean_distance

941 questions
4
votes
2 answers

How to find the euclidian distance between the centroid of an object in one frame and the adjacent frame

We are doing a project in vehicle counting (using OpenCV). Now we have to find the euclidian distance from the centroid of the object in one frame to the adjacent frame? In our project we have done up to finding the centroid.
user1244643
  • 61
  • 2
  • 5
4
votes
8 answers

Python: reduce on tuple of tuples

I am trying to compute in Python the length of the path from a point A to a point B going through a list of intermediary points. I know how to do it but I do want to use the reduce Built-in function. Why I tried so far, please note that it is…
lc2817
  • 3,722
  • 16
  • 40
4
votes
3 answers

Minimum distance between two axis-aligned boxes in n-dimensions

Question: How can I efficiently compute the minimum distance between two axis-aligned boxes in n-dimensions? Box format: The boxes, A and B, are given by their minimum and maximum points, A_min, A_max, B_min, B_max, each of which is a n-dimensional…
Nick Alger
  • 984
  • 7
  • 26
4
votes
3 answers

How much worse is sRGB than L*a*b* when computing the eucleidan distance between colors?

L*a*b* is the best way of doing it, but converting to it is complicated, and I'm lazy. How much accuracy am I giving up by operating on sRGB directly?
Ansis Māliņš
  • 1,684
  • 15
  • 35
4
votes
2 answers

Can we cluster Multivariate Time Series dataset in Python

I have a dataset with many financial signal values for different stocks at different times.For example StockName Date Signal1 Signal2 ---------------------------------- Stock1 1/1/20 a b Stock1 1/2/20 c d . . . Stock2 …
4
votes
4 answers

(Speed Challenge) Any faster method to calculate distance matrix between rows of two matrices, in terms of Euclidean distance?

First of all, this is NOT the problem of calculating Euclidean distance between two matrices. Assuming I have two matrices x and y, e.g., set.seed(1) x <- matrix(rnorm(15), ncol=5) y <- matrix(rnorm(20), ncol=5) where > x [,1] [,2]…
ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81
4
votes
1 answer

Find distance to nearest neighbor in 2d array

I have a 2D array and I want to find for each (x, y) point the distance to its nearest neighbor as fast as possible. I can do this using scipy.spatial.distance.cdist: import numpy as np from scipy.spatial.distance import cdist # Random data data =…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
4
votes
4 answers

draw a graph where the distance between vertices correspond to the edge weights

Is there an algorithm that gives me coordinates of vertices in a graph, when I give him a weighted graph and the edge weights between vertices points to the distance between vertices? Something like: public _ArrayOfCoordinatesForVertices_…
4
votes
2 answers

calculating average distance of nearest neighbours in pandas dataframe

I have a set of objects and their positions over time. I would like to get the distance between each car and their nearest neighbour, and calculate an average of this for each time point. An example dataframe is as follows: time = [0, 0, 0, 1, 1,…
UserR6
  • 493
  • 7
  • 15
4
votes
4 answers

How to apply euclidean distance function to a groupby object in pandas dataframe?

I have a set of objects and their positions over time. I would like to get the average distance between objects for each time point. An example dataframe is as follows: time = [0, 0, 0, 1, 1, 2, 2] x = [216, 218, 217, 280, 290, 130, 132] y = [13,…
UserR6
  • 493
  • 7
  • 15
4
votes
1 answer

Vectorized implementation for Euclidean distance

I am trying to compute a vectorized implementation of Euclidean distance(between each element in X and Y using inner product). The data as follows: X = np.random.uniform(low=0, high=1, size=(10000, 5)) Y = np.random.uniform(low=0, high=1,…
tavalendo
  • 857
  • 2
  • 11
  • 30
4
votes
0 answers

Calculate Euclidean distance using Painless in Elasticsearch

I would like to sort results from Elasticsearch according to Euclidean distance between document double array and double array from "params". For now I am using my own solution that calculate this distance. Could I use some library method to…
Uladzislau Kaminski
  • 2,113
  • 2
  • 14
  • 33
4
votes
1 answer

Wrong Euclidean distance H2O calculations R

I am using H2O with R to calculate the euclidean distance between 2 data.frames: set.seed(121) #create the data df1<-data.frame(matrix(rnorm(1000),ncol=10)) df2<-data.frame(matrix(rnorm(300),ncol=10)) #init h2o h2o.init() #transform to…
Jesus
  • 462
  • 6
  • 13
4
votes
1 answer

What is the complexity of dist()?

I used the dist function in R and I am wondering the time complexity of it. I know that the hierarchical clustering has a N^2*logN time complexity. And hierarchical clustering is composed of two parts as below codes in R. > d <-…
sclee1
  • 1,095
  • 1
  • 15
  • 36
4
votes
2 answers

A* with manhattan distance or euclidean distance for maze solving?

I have obtained all the possible paths of maze through image processing. Now, I want to use A* algorithm in order to find shortest path of maze. However, I am confused as to whether euclidean distance will be a better heuristic or manhattan…
Curious
  • 127
  • 3
  • 11