CodePudding user response:
I think you need to clarify is similar to what you wantIs invalid can give some similar, or only compare the results of fitting curve is similar to
If it is 1, you must first remove noise by algorithm, to calculate the fitting curve
As for the two curves are similar, but also points are based on points, shapes, segmentation, etc.,
I think waiting for you to determine the corresponding algorithm to find good, no matter what your demand is mature algorithms have
CodePudding user response:
Similarity determination algorithm is too much, I only choose some commonly usedA brief Java code of the cosine similarity of
public class CosineCompare {
/* */cosine similarity algorithm
Public static void main (String [] args) throws the Exception {
Double [] curve_1={1, 4, 5, 7, 8, 9, 6, 5, 3, 2, 1};//coordinates
Double [] curve_2={1, 1.2, 8, 20, 9, 8, 6, 5, 3, 2, 1};//coordinates
Double x=0, y=0, z=0;
For (int I=0; iX +=curve_1 curve_1 [I] * [I];
Y +=curve_2 curve_2 [I] * [I];
Z +=curve_1 curve_2 [I] * [I];
}
X=math.h SQRT (x);
Y=math.h SQRT (y);
System. The out. Println (z/(x * y));
}
}
This is a Frechet similarity
https://blog.csdn.net/qq_35570161/article/details/82120424
These are some conventional explanation
https://blog.csdn.net/weixin_39050022/article/details/80732249