2014-10-19 75 views
0

早上好。通過採集的數據向量估算矩形係數

我對線性估計有問題。 我必須確定收集到的數據矢量(即測量系統獲得的x和y點值)的矩形的兩個係數。

但是在我的數據集中,點屬於不同的行爲。很少一點屬於垂直矩形,我只對它們中大部分產生的矩形感興趣。 我試圖使用線性迴歸,但第二矩的幾點導致了估計中的大錯誤。 我能做什麼?這個問題還有其他的公式或估算器嗎?

回答

0

這可能是一個矯枉過正的問題,但從數據中找到模型的一個非常好的方法是RANSAC方法。 Rougly,它的工作原理是這樣的:

1. Let M* be the best model so far. // At the begining there is no such model.) 
2. Let D be the set of data points. // In your case it is a set of x-y pairs.) 
3. Until a stopping condition is not met: 
    Randomly pick a number of elements from D. // The number of elements is such number that allows a model be constructed from them In your case it will be (my idea) 2 elements. 
    Construct a model M from picked elements. // In your case the 2 picked elements will be the corners of the rectangle. 
    Count a cost of M c(M). // Cost is some value that represents how good (or bad) the model is. In your case it could be the number of points that are no further than some threshold from the lines of the rectangle. 
    If c(M) > c(M*) then M* := M // If the c() value represents how bad the model is, the relation would be opposite, i.e. c(M) < c(M*). 

這種方法是偉大的,當數據是嘈雜的可以在情況(其中一些),其中大部分數據點不屬於我們正在尋找的模型甚至工作對於。

停止條件是棘手的部分。它可以是任何事情,從固定次數的迭代到運行直到我們有時間。

Here是我的大學(但不是我)的簡短PDF演示文稿,它更詳細地介紹了一些liiiiitle,並給出了與RANSAC相關的一些公式。

+0

非常感謝@JanŽegklitz! – user3605837 2014-11-23 00:21:13