3

現在、バイリニア補間を使用してグリッド内の欠落したポイントを見つけるデータ ポイントのグリッドがあります。私は最高の線形不偏推定量として知られるクリギングの方向性を指摘されましたが、適切なソース コードや代数的説明を見つけることができませんでした。私が使用できる他の補間方法を知っている人はいますか?

--更新 @Sam Greenhalgh 私はバイキュービック補間を検討しましたが、見つけたコード例を使用して受け取った結果は間違っているように見えました。

Bicubic のコード例を次に示します。

私は C# でコーディングしていますが、他の言語からの例も歓迎します。

    //array 4
    double cubicInterpolate(double[] p, double x)
    {
        return p[1] + 0.5 * x * (p[2] - p[0] + x * (2.0 * p[0] - 5.0 * p[1] + 4.0 * p[2] - p[3] + x * (3.0 * (p[1] - p[2]) + p[3] - p[0])));
    }
    //array 4 4
   public double bicubicInterpolate(double[][] p, double x, double y)
    {
        double[] arr = new double[4];
        arr[0] = cubicInterpolate(p[0], y);
        arr[1] = cubicInterpolate(p[1], y);
        arr[2] = cubicInterpolate(p[2], y);
        arr[3] = cubicInterpolate(p[3], y);
        return cubicInterpolate(arr, x);
    }

double[][] p = {
                new double[4]{2.728562594,2.30599759,1.907579158,1.739559264},
                new double[4]{3.254756633,2.760758022,2.210417411,1.979012766},
                new double[4]{4.075740069,3.366434527,2.816093916,2.481060234},
                new double[4]{5.430966401,4.896723504,4.219613391,4.004306461}
               };

Console.WriteLine(CI.bicubicInterpolate(p, 2, 2));
4

2 に答える 2