pansharpen by ESRI method

This commit is contained in:
nuknal
2024-09-12 17:25:40 +08:00
parent 7bd0896f05
commit 8a2d339d11
5 changed files with 182 additions and 7 deletions

View File

@@ -128,7 +128,6 @@ func solveCoefficients(f, latVec, lonVec, heightVec *mat.VecDense, method SolveM
errorV := predictedV - f.AtVec(i)
errorSquared += errorV * errorV
}
fmt.Printf("squared error: %.8f\n", errorSquared)
var coeffsSquared float64
for i := 0; i < 20; i++ {
coeffsSquared += lambda * (numerator1.AtVec(i)*numerator1.AtVec(i) + denominator1.AtVec(i)*denominator1.AtVec(i))
@@ -137,7 +136,6 @@ func solveCoefficients(f, latVec, lonVec, heightVec *mat.VecDense, method SolveM
x0 = x1
iterations++
fmt.Printf("squared error+lambda*coeffs: %.8f\n", coeffsSquared)
vx = append(vx, &VX{v: errorSquared, x: x1})
if errorSquared < 0.001 {
break