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
0
votes
0 answers

Calculate the Euclidean distance for 2 different size arrays

I have two numpy arrays with the dimension of 2*1 and 2*149. Which function should I use to calculate the Euclidean distance for 2 different size arrays?
dinesh12
  • 23
  • 5
0
votes
1 answer

Calculating distance between SURF features in OpenCV

I want to be able to get a distance between SURF features in OpenCV. I'm using HDBSCAN to match multiple instance of an object in the image by clustering the features which requires calculating distances between the SURF descriptors. I know…
0
votes
5 answers

Partition neighbor points given a euclidean distance range

Given two points P,Q and a delta, I defined the equivalence relation ~=, where P ~= Q if EuclideanDistance(P,Q) <= delta. Now, given a set S of n points, in the example S = (A, B, C, D, E, F) and n = 6 (the fact points are actually endpoints of…
ceztko
  • 14,736
  • 5
  • 58
  • 73
0
votes
0 answers

Compute pairwise euclidean distance values in pandas DataFrame using itertools.combinations

I have a pandas dataframe after reading in a .csv file that resembles: import itertools as it import pandas as pd import numpy as np import scipy as sp x = np.random.randn(5) y = np.sin(x) z = np.sin(x)+1 df = pd.DataFrame({'x':x, 'y':y,…
lf208
  • 77
  • 5
0
votes
1 answer

Need help optimizing speed for a loop/dot-product function in C++

I've identified a function in a tightloop that's responsible for 50% of the time in my program(finding nearest neighbors). It calculates the euclidean distance between two unit vectors. Is there any way to make this run faster? (currently I am using…
ijklr
  • 145
  • 8
0
votes
1 answer

I am not getting the actual distance as output from CVS file

I want to calculate the distance between two co-ordinates, which are stored in a CVS file. There are two column mentioned in CVS files for X and Y Co-ordinates respectively. I want to apply Euclidean Distance Formula between those stored points and…
0
votes
1 answer

Euclidean distance between each record with other records in an array

so i have an array [nm] and i need to code in c++ the Euclidean distance between each row and the other rows in the array and store it in a new distance-array [nn] which every cell's value is the distance between the intersected…
0
votes
1 answer

Similarity Metrics

I am trying to research on different metrics and found many ssimilarity metrics : Euclidean distance Dynamic Time Warping, Edit Distance with Real Penalty DISSIM , Sequence Weighted Alignment model, Spatial Assembling Distance. However I had a…
0
votes
1 answer

How to find the distance(physical in m and pixels) between two object(points) in image in OpenCV and C+++?

Im using OpenCV and C++. I have already done the code where can find the center of the object. I also have the prior information about the distance between the camera and object(s) in the image. I need to compute the distance (real physical one in m…
bob
  • 363
  • 3
  • 8
  • 21
0
votes
0 answers

Determination of a given point's closeness to a given set of points [Without using euclidean distance]

I am faced with a problem in which I have to determine weather a random point(Cartesian co-ordinate) is closer in range[euclidean distance] to a set 'N' of points. I cannot use the following methods as time complexity will increase significantly…
0
votes
3 answers

Take a groups from one table and use other tables to calculate euclidean distance

I would like to calculate euclidean distance between specific profiles. The biggest problem is how to get specific rows together to calculate a distance between them. In the first table I have stored the groups with the names of rows from different…
Shaxi Liver
  • 1,052
  • 3
  • 25
  • 47
0
votes
0 answers

implementation of distance transform of given binary image

I am looking for a python implementation of distance transform of a given binary image. No existing library code is to be used. This is what I have done so far - #function to find EUCLIDIAN distance to nearest wall from current cell def…
0
votes
1 answer

Mean of 2-dimensional data points

I have these data points: > a1 = c(2,10) > a2 = c(2,5) > a3 = c(8,4) And I'd like to find the 2 dimensional mean (edit: Centroid) of those data points with r. I have tried the following: >mean(c(a1,a2,a3)) but it only gives me a one-dimensional…
ArmorCode
  • 739
  • 4
  • 15
  • 33
0
votes
1 answer

Given specific lat/lon calculate closest point from csv list of lat/lon

Need help with efficient python code(using pandas) to find which vehicle at what time passed closest to incident_sw =(35.7158, -120.7640). I'm having trouble formulating a Euclidean distance to sort through below df and print which vehicle and its…
CatLady
  • 31
  • 6
0
votes
1 answer

MATLAB: Computing euclidean distance in an efficient way?

What I am currently doing is computing the euclidean distance between all elements in a vector (the elements are pixel locations in a 2D image) to see if the elements are close to each other. I create a reference vector that takes on the value of…
Mike S
  • 13
  • 4