ImageMap below = spaces[level - 1];
ImageMap current = spaces[level];
ImageMap above = spaces[level + 1];
SimpleMatrix H = new SimpleMatrix(3, 3);
/*
* 下面是该幅图像尺度空间的三元偏导数,记住是尺度空间上 的二阶自变量为3的偏导数2006.3.1
*/
H.values[0][0] = below.valArr[y][x] - 2 * current.valArr[y][x] + above.valArr[y][x];
H.values[0][1] = H.values[1][0] = 0.25 * (above.valArr[y + 1][x] - above.valArr[y - 1][x] - (below.valArr[y + 1][x] - below.valArr[y - 1][x]));
H.values[0][2] = H.values[2][0] = 0.25 * (above.valArr[y][x + 1] - above.valArr[y][x - 1] - (below.valArr[y][x + 1] - below.valArr[y][x - 1]));
H.values[1][1] = current.valArr[y - 1][x] - 2 * current.valArr[y][x] + current.valArr[y + 1][x];
H.values[1][2] = H.values[2][1] = 0.25 * (current.valArr[y + 1][x + 1] - current.valArr[y + 1][x - 1] - (current.valArr[y - 1][x + 1] - current.valArr[y - 1][x - 1]));
H.values[2][2] = current.valArr[y][x - 1] - 2 * current.valArr[y][x] + current.valArr[y][x + 1];
SimpleMatrix d = new SimpleMatrix(3, 1);
/*
* 下面这个是自变量为3的一阶偏导数2006.3.1
*/
d.values[0][0] = 0.5 * (above.valArr[y][x] - below.valArr[y][x]);
d.values[1][0] = 0.5 * (current.valArr[y + 1][x] - current.valArr[y - 1][x]);
d.values[2][0] = 0.5 * (current.valArr[y][x + 1] - current.valArr[y][x - 1]);
SimpleMatrix b = (SimpleMatrix) d.clone();
b.negate();
// Solve: A x = b
H.solveLinear(b);
ref.val = b.dot(d);
return (b);
}