简体   繁体   English

如何在线性插值中找到坏点?

[英]how to find bad points in a linear interpolation?

I have a set of points and I know that: 我有几点要点,我知道:

  1. All of them are from 0-255 都是从0-255
  2. They are in increasing format (so Point[0] <= Point[1]) 它们采用递增格式(因此Point [0] <= Point [1])
  3. They are repressing a line (with some noise). 他们正在压线(有一些噪音)。

But there are some points that behave badly. 但是有些地方表现不好。 I need to detect that points. 我需要检测出这些要点。 What is the fastest way to do this? 最快的方法是什么?

In general I can get the first one and last one and find the line formula and then calculate error for each point and if the error is too high, I mark that point as bad point. 通常,我可以得到第一个和最后一个,并找到直线公式,然后为每个点计算误差,如果误差太大,则将该点标记为不良点。

Is there any better way (faster and more accurate)? 有没有更好的方法(更快,更准确)?

Is there any library that can help (I am using OpenCV and Boost). 是否有任何可以提供帮助的库(我正在使用OpenCV和Boost)。

Instead of taking first and last points, you should calculate linear regression and measure the distance of points from that trend line instead. 您应该计算线性回归并测量与该趋势线的距离,而不是获取第一个和最后一个点。 It could be that your first/last point behaves badly. 您的第一个/最后一个点可能表现不佳。

run a loop through them, if p[i] < p[i-1], then it's behaving badly. 在它们之间运行一个循环,如果p [i] <p [i-1],则表现不佳。

i dont know why you mention lerp, it sounds unrelated. 我不知道您为什么提到lerp,听起来无关。 lerp functions can't return wrong results. lerp函数不会返回错误的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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