基本的に、これは 2D 多変量補間と呼ばれます。 一連の位置 (x,y) と対応するデータ (例: z=色の値) があります。 一部の (x,y) では、z 列のデータが欠落しています。 最も近い 2 つの既知の (x1,y1,z1) と (x2,y2,z2) を使用して、(x3,y3, z3=?) の値を補間したいと考えています。
理論的にはこれwiki/Bilinear_interpolationそれは私が手に入れたいものです。
JMP にはこれを行う方法がありますか?
また、最初に X、Y データを他の 2 つの列 A、B でグループ化する必要があります。例。 CO1 A,B はファイル名とフレーム番号を表します。 X、Y はフレーム内のピクセルの位置、Z はピクセルの色です。
各ファイルの各フレームで欠落しているピクセルの Z 値を補間したいと考えています。
サンプルデータセット
| ファイル | フレーム | バツ | Y | 色 |
| アントマン | 1 | 0 | 0 | 255 |
| アントマン | 1 | 5 | 5 | 195 |
| アントマン | 1 | 3 | 2 | ?? |
| アントマン | 2 | 0 | 0 | 255 |
| バットマン | 3 | 0 | 0 | 255 |
| バットマン | 3 | 3 | 2 | ?? |
| バットマン | 3 | 5 | 5 | 100 |
私の理解が正しければ、共一次補間には 2 つではなく 4 つの点が必要になります。 グループ化列は簡単に処理されるため、1 つのグループに対して次のようなことができます。
Names Default To Here( 1 );
// Example table: Four complete observations, and one missing 'Colour' to be
// obtained by bilinear interpolation
dt = New Table( "Antman_1",
Add Rows( 5 ),
New Column( "X",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 5, 3, 5, 0] )
),
New Column( "Y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 5, 2, 0, 5] ),
Set Display Width( 92 )
),
New Column( "Colour",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [255, 195, ., 100, 150] )
)
);
// Using the notation at: https://en.wikipedia.org/wiki/Bilinear_interpolation
x1 = dt[1, "X"];
x2 = dt[2, "X"];
y1 = dt[1, "Y"];
y2 = dt[2, "Y"];
q11 = dt[1, "Colour"];
q21 = dt[4, "Colour"];
q12 = dt[5, "Colour"];
q22 = dt[2, "Colour"];
x = dt[3, "X"];
y = dt[3, "Y"];
// Interpolate in the X direction
r1 = Interpolate(x, x1, q11, x2, q21);
r2 = Interpolate(x, x1, q12, x2, q22);
// Interpolate in the Y direction
p = Interpolate(y, y1, r1, y2, r2);
Wait(3);
dt[3, "Colour"] = p;
これが「最善の」方法である可能性は低いですが、より適切に実行するには、サンプル データ (JMP テーブル内) が必要になります。 エッジケースにどのように対処するかを決定する必要もあります。