Scattered data interpolation like the image below?

92 Views Asked by At

I have a set of points and if I draw them on a paper, I have a diagram like below image:

an array of points

I want to find any almost horizontal curve/line in the scattered points, something like below:

thing that I want to reach: the red curve/line

In fact what I want as output is an array of points that are on the line/curve, or the equation which gives me the y component of the point if I set the x value.

As extra explanation, Consider it is the color points of a forehead and forehead wrinkles are going to get detected. there may be no wrinkles or many. They are not horizontal lines necessarily but we expect them to be in the range of a horizontal line. There may be no wrinkles or many, so the process should be smart enough to take care of all the aspects!

I searched for a Java/Android library or code that does the job but didn't find any. I would appreciate if you let me know about the exact mathematical process or any Java/Android library or class that does the job.

Thanks in advance.

1

There are 1 best solutions below

4
On

Does your link contain two examples or do you want the algorithm to output two separate lines given the data in your first link?