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.
euclidean-distance
949
questions
0
votes
1
answer
1k
views
How to show 5 images having smallest Euclidean distance with respect to query image
Suppose I have one query image, and a database in matlab that has 10 images. I can read out and show one image which has smallest Euclidean distance with respect to query image. But now, I want to ...
0
votes
1
answer
1k
views
How to use k-d tree to find nearest neighbor?
I have applied SIFT on one image and got descriptors, then I have used Euclidean distance to find similar descriptors, now I want to use k-d tree to find which descriptors are more similar and ...
0
votes
1
answer
1k
views
How to make pdist ignore a value (Matlab)
I am using pdist to calculate euclidian distances between three dimensional points (in Matlab). However i have some coordinates that i cannot remove from the matrix, but that i want pdist to ignore.
...
0
votes
1
answer
2k
views
euclidean algorithm for image comparison
i am going to develop an application for image comparison on java. For this i have choosen euclidean algorithm. This application involves with 2 images.
1. Actual image
2. Part of the actual image.
...
-1
votes
3
answers
2k
views
how to define a pow2 macro in C++
I want to have definition for pow2C as follows. But my compiler shows it (__tmpDouble__) is already defined. Please help me define it.
#ifndef pow2C
double __tmpDouble__;
#define pow2C(a) ((...
-1
votes
3
answers
2k
views
How to calculate euclidian distance within group in R
If I have a dataframe like this:
ID GroupID X Y
1 a 772.7778 226.5
1 a 806.5645 35.3871
1 a 925.5714 300.9286
1 b 708.0909 165.5455
1 b 630.8235 167.4118
2 a ...
-1
votes
1
answer
260
views
Calculating Euclidean Distance
I have the code below to calculate Euclidean Distance. however, my function does basically nothing. It gives no output and not even an error, it just runs and finishes.
lst_a=[1,2,3,4,5]
lst_b=[1,2,4,...
-1
votes
1
answer
8k
views
Distance between two Points in pandas csv Data-frame
I want to calculate the distance between two coordinates points(Lat1,long1, and Lat2,Long2) for the below data frame.
`name_x rnc_x lat1 long1 scrambling_code name_y rnc_y lat2 long2
...
-1
votes
2
answers
216
views
How to pass an Array as a parameter to a Function/Bifunction?
I need to pass an array as parameter into a BiFunction.
Use case :
Calculate the Euclidean Distance of 2 coordinates given in an array.
coordinate1 and coordinate2 are an array.
The below trial, ...
-1
votes
2
answers
1k
views
Creating a distance matrix from a matrix/list
I have created a list from the input and from the list I have created a matrix also.
list-
('A', 'B', 3)
('A', 'D', 4)
('B', 'D', 4)
('B', 'H', 5)
('C', 'L', 2)
('D', 'F', 1)
('F', 'H', 3)
('G', 'H', ...
-1
votes
2
answers
438
views
Python - Find the first white pixel and last one in each column
how can i find first and last white pixel in a column of binary image . To i calculate distance between points in image
I did but everything is still not resolved , please help me . I have consulted ...
-1
votes
1
answer
202
views
How to calculate distance from a player to a dynamic collision point
I'm trying to create sensors for a car to keep track of the distances from the car to the borders of the track. My goal is to have 5 sensors (see image below) and use them to train a machine learning ...
-1
votes
1
answer
820
views
Find euclidean distance between a tensor and each row tensor of a matrix efficiently in PyTorch
I have a tensor A of size torch.Size([3]) and another tensor B of size torch.Size([4,3]).
I want to find the distance between A and each of the 4 rows of B.
I'm new to Torch and I reckon a for loop ...
-1
votes
1
answer
48
views
How can I migrate from "float" to "points" in MySQL?
I'm looking for a faster way to calculate Euclidean distances in SQL.
Problem I want to solve
The following "Euclidean distance calculation" is slow.
SELECT
id,
sqrt(
power(f1 - (-...
-1
votes
1
answer
64
views
find maximum distance between a series of coordinates of different individuals to a single point
I have a series of tracking data in the form of coordinates from individuals leaving and returning to the same place (ie. all of them leaving from the same coordinates) and would like to find the ...
-1
votes
2
answers
1k
views
Pairwise distance of points in one dimension
Is it possible to calculate the pairwise distance of a set of points in one dimension (all points are in a line) faster than O(n^2)?
-1
votes
1
answer
3k
views
Python - Euclidean Distance between a line and a point in Numpy [duplicate]
I would like to calculate the Euclidean Distance between a line and a point. My line is represented by a numpy matrix as follow:
import pylab as pl
import numpy as np
pl.xlim(-1, 8)
pl.ylim(-1, 8)
...
-1
votes
1
answer
74
views
r match rows that that are similar
I am dealing with few observations like this below. My goal is to identify rows that match/similar to each other based on a Euclidean distance concept, considering vector {x1,x2,x3,x4} and threshold 0....
-1
votes
1
answer
47
views
To check Euclidean distance from center to map region in two regions
I have an 450x450 gray image. The neighbourhood of each pixel to be processed is defined by the Euclidean distance based on two radii, R1 and R2. Hence:
All pixels in the neighbourhood of R1 and R2 ...
-1
votes
1
answer
223
views
extract every two elements in matrix row in r in sequence to calculate euclidean distance
How to extract every two elements in sequence in a matrix and return the result as a matrix so that I could feed the answer in a formula for calculation:
For example, I have a one row matrix with 6 ...
-1
votes
1
answer
1k
views
Fast distance calculation in R
I'm trying to calculate the
1) Euclidean distance, and
2) Mahalanobis distance
for a set of matricies in r. I've been doing it as such:
v1 <- structure(c(0.508, 0.454, 0, 2.156, 0.468, 0.488,...
-1
votes
1
answer
37
views
Two text files with 1,096 individual decimal numbers - subtract each of the elements and total the sum
I have two text files that contain 1,096 values (these are features extracted from a neural network layer).
I want to take the first element of the the first text file and subtract it from the first ...
-1
votes
2
answers
1k
views
Creating distance matrix in R for a matrix in a higher dimensional space
I have created an euclidean distance matrix using dist() function in R.
Below is my R script. As the dimensions of matrix would be 16809 * 16809 while running this script in R I got the error message: ...
-1
votes
2
answers
3k
views
How to calculate distance between several points simultaneously with Euclidean Distance
I know how to get distance between points, however I want to get distance between 2 objects where each object has several points. (See illustration below.)
I want to calculate distance between ...
-1
votes
1
answer
684
views
Distance calculation for coordinates called from a file(Python2.7)
I'm trying to read coordinates from a file and find distance between each two respective atoms in the file.
I want to have the calculated distance in one column and the respective atom names in the ...
-1
votes
1
answer
6k
views
Euclidean distance between two arrays, undeclared identifier
I have this code in calculating euclidean distance. But, I don't know why I'm having this error. array1 and array2 undeclared .
double dist(double x[4] array1, double y[4] array2)
{
double Sum;
...
-1
votes
1
answer
69
views
How to calculate the distance from a point to the boundary of a six-dimensional point cloud?
Suppose I have a six-dimensional point cloud D, it has only one cluster and no noise, and its density is uneven.
Given an examination point C, how to calculate the distance from C to the boundary of D?...
-1
votes
1
answer
389
views
Check if coordinates are within a specific area
I used various sources of information to determine the GPS coordinates of a traffic sign, and plotted them using using plotly.express.scatter_mapbox and add_scattermapbox as follows:
The orange dot ...
-1
votes
2
answers
634
views
How to loop distance calculations for multiple instances using dplyr in r
I have positional data, an example of which is shown below, where time is the time each position was recorded, ref is the reference of each point, x is the x coordinate for each point and y is the y ...
-1
votes
1
answer
448
views
TypeError: family() missing 1 required positional argument: 'rebw'
Getting is error how can I fix it? Please help
here is the complete Error which is showing me in Terminal:
Traceback (most recent call last):
File "Family-tracking-system.py", line 843, in search
...
-1
votes
2
answers
2k
views
Why tsne method use Euclidean distance to compute the similarities in high dimensional data?
I have tried other distance metrics like chebychev distance or Manhatten distance and so on, which are all implemented in tsne in Matlab. Some of them achieve the same good performance as Euclidean ...
-1
votes
1
answer
190
views
Euclidean distance divided by square root of number of arrays?
I have come to learn that if I want to overally compare two vectors in my research, the best way is to use Euclidean distance divided by square root of number of arrays. However I don’t know what this ...
-1
votes
1
answer
23
views
How to find all point around center point in 2D
I have center point x: 0 and y: 0.
How to get all points distance Up to 5?
My code is not perfect:
function getPoints(startX, startY, distance) {
var res = []
for (var i = 1; i < ...
-1
votes
1
answer
6k
views
K-Nearest Neighbor Implementation for Strings (Unstructured data) in Java
I'm looking for implementation for K-Nearest Neighbor algorithm in Java for unstructured data. I found many implementation for numeric data, however how I can implement it and calculate the Euclidean ...
-1
votes
1
answer
502
views
Euclidean Distance vb net
I have a program that I created, the result is not appropriate,
I want to do multiplication between rows of numbers -1, -1, -1 and 1,2, -1
-1x1 = -1
-1x2 = -2
-1x-1 = 1
then the results are summed
...
-1
votes
1
answer
463
views
Item Based Similarity Metric
I am using Mahout Apache to write an item based recommender (based on similar item ratings by users) and I was wondering which of the following two similarity metrics would be the best to use:
...
-1
votes
1
answer
256
views
Recommender Systems: Does using Singular Value Decomposition rule out the possibility of using Euclidean Distance as way of measuring similarity?
I'm learning about recommender systems and learning about different similarity algorithms. Euclidean distance would change as the scale of the objects being compared changes. In that case, would SVD (...
-2
votes
1
answer
664
views
How to measure pairwise distances between two sets of points?
I have two datasets (csv files). Both of them contains latitudes-longitudes of two sets (220 and 4400) of points. Now I want to measure pairwise distances (miles) between these two sets of points (220 ...
-2
votes
1
answer
1k
views
Dist and hclust functions outputting unexpected/incorrect outputs [closed]
I have been attempting to use R as an alternative to MVSP for cluster analysis and PCA. However, R is giving drastically different outputs from MVSP using all the functions that I've found, including ...
-2
votes
2
answers
226
views
How can I speed up my 3D Euclidean distance matrix code [closed]
I have created code to calculate the distance of all objects (tagID) from one another based on x, y, z coordinates (TX, TY, TZ) at each time step (Frame). While this code does work, it is too slow for ...
-2
votes
1
answer
692
views
Calculating distance between points in matlab
Having difficulty understanding the following code in Matlab to calculate Euclidean distance between two points, where X is the data to be classified and label corresponds to cluster membership.
...
-2
votes
1
answer
51
views
How to create spaces in a textbox?
I have a vb net program to take a binary value in the image. This syntax produces
111110
on textbox3.text. I want no spaces at textbox3.text
1 1 1 1 1 0
Dim x, y As Integer
Dim ...
-2
votes
1
answer
55
views
Calculating smallest within trio distance
I have a pandas dataframe similar to the one below:
Output var1 var2 var3
1 0.487981 0.297929 0.214090
1 0.945660 0.031666 0.022674
2 0.119845 0.828661 0....
-2
votes
1
answer
658
views
How do I find the euclidean distance between two lists without using numpy or zip?
How do I find the euclidean distance between two lists without using either the numpy or the zip feature? Furthermore, the lists are of equal length, but the length of the lists are not defined.
For ...
-2
votes
1
answer
411
views
How to clustering based on the distance in Python pandas?
I have two dataframes with two groups of stations information. One for the 15 small stations and another for the 5 main stations.
Small Station Information(15*3):
SmallStation_ID longitude ...
-3
votes
1
answer
7k
views
Normalized distance between two points - MATLAB [closed]
I would like to normalize the euclidean distance between two points so that it becomes between 0 & 1.
The points are represented as follows: (x,y).
Any ideas?
-3
votes
1
answer
97
views
How to find the euclidean distance between X and each sublist of Z using python
The points are
x=[[0.5697071,0.447144773,0.45310486]]
and
z=[[0,0.47144773043356025,0],[0,0.47144773043356025,0.4531048568095023],[0.5697070991026062,0.47144773043356025,0.4531048568095023],[0,0,0]]
...
-4
votes
1
answer
147
views
Incorrect answer of Euclidean Distance Java
I am making a program to calculate the Euclidean Distance of 4 values of Training Data with 4 values of Test Data. For KNN i need to find the Euclidean Distance which i programmed in Java and i am ...
-4
votes
1
answer
2k
views
NAs introduced by coercion error on Numeric Data Frame
I am trying to cluster a Data Frame but when I run the dist Function I get the error "NAs introduced by coercion".
At first I thought if was becuase my DF contained factor vectors, like this:
but I ...