控制点过少时导致图像内畸变较大

This commit is contained in:
nuknal
2024-09-04 17:59:12 +08:00
parent abe5ecbdec
commit df6090df21
3 changed files with 17 additions and 27 deletions

View File

@@ -57,7 +57,7 @@ type RPCModel struct {
func NewRPC(r *Registrator, scene *Scene, rpb string) *RPC {
rpc := RPC{
elevationLayer: 3,
gridsize: 3,
gridsize: 19,
registrator: r,
scene: scene,
rpb: rpb,
@@ -150,14 +150,14 @@ func (rpc *RPC) RPC() error {
rpc.saveVec(strings.Replace(rpc.scene.Tiff, ".tiff", ".vec_norm.txt", -1),
rowVec, colVec, latVec, lonVec, heightVec)
// 设计矩阵 B = [ 20个分子系数 19个分母系数 ]
// x = (B^T * B)^-1 * B^T * l, 其中 x = [a1..a20 b2..b20]^T
// 设计矩阵 B = [ 20个分子系数 19个分母系数 ] W = 权矩阵 R = 观测结果
method := SolveMethodNelderMead
// x = (B^T * W^2 * B)^-1 * (B^T * W^2 * R), 其中 x = [a1..a20 b2..b20]^T
// 行参数
// B := setupSystemOfEquations(rowVec, latVec, lonVec, heightVec)
// J, err := SolveNormalEquation(B, rowVec)
log.Println("solving row coefficients")
J, err := solveCoefficients(rowVec, latVec, lonVec, heightVec, SolveMethodNelderMead)
J, err := solveCoefficients(rowVec, latVec, lonVec, heightVec, method)
if err != nil {
return err
}
@@ -166,7 +166,7 @@ func (rpc *RPC) RPC() error {
// D := setupSystemOfEquations(colVec, latVec, lonVec, heightVec)
// K, err := SolveNormalEquation(D, colVec)
log.Println("solving col coefficients")
K, err := solveCoefficients(colVec, latVec, lonVec, heightVec, SolveMethodNelderMead)
K, err := solveCoefficients(colVec, latVec, lonVec, heightVec, method)
if err != nil {
return err
}