简体   繁体   中英

Programming machine learning, compare two plotted lines with x y coordinates

So I have multiple paths stored, each path would consist of data points x1,y1 | x2, y2 | x3, y3 ... etc

I would like to compare these paths with one another to work out if any similarities are present.

I could run through each point and see if it matched any of the points in the first path, then look to see if the next point matches the next point.

I think this would work if there were no anomalies, but could skip over if the next point did not match.

I would like to build in some level of tolerance eg 10, 10 may match 12, 12 or 8, 8

Is this a good way to compare the data, or is there a better approach?

As a second step I may want to consider time as a value too, so each point would have a time value associated with it.

Some possible approaches you can use:

  1. handle booth paths as polygon and compare them as such

    see: How to compare two shapes?

  2. use OCR algorithms/approaches

    see: OCR and character similarity

  3. transform both paths to synchronized dataset and correlate

    either extract significant points only and/or resample paths to the same point count. Then synchronize booth datasets (as in bullet 1) and use correlation coefficient

[notes]

Depending on the input data you can also exploit DCT/DFT transforms to remove unimportant data (like in JPG compression) And or compare in frequency domain instead of spatial/time domain.

You can also compare obvious things (invariant on rotation and translation) like

  1. area
  2. perimeter length
  3. number of self-intersections
  4. number of inflex points

u could compare the mean and variances of the two set of points. If they are on straight lines, as you hypothesize, you could fit straight lines through the two datasets and then compare the parameters of the two straight lines to infer about their distances. It would be more helpful if you could tell the behavour of the two datasets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM