Compute the 'elbow' for a curve automatically and mathematically

前端 未结 4 1019
失恋的感觉
失恋的感觉 2020-12-23 12:10

One example for curve is shown as below. The elbow point might be x=3 or 4. How to compute the elbow for a curve automatically and mathematically?

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 12:59

    You might want to look for the point with the maximum absolute second derivative which, for a set of discrete points x[i] as you have there, can be approximated with a central difference:

    secondDerivative[i] = x[i+1] + x[i-1] - 2 * x[i]

    As noted above, what you really want is the point with maximum curvature, but the second derivative will do, and this central difference is a good proxy for the second derivative.

提交回复
热议问题