分景后配准
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/airbusgeo/godal"
|
||||
"github.com/duke-git/lancet/v2/mathutil"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"starwiz.cn/sjy01/image-proc/pkg/calculator"
|
||||
@@ -78,7 +79,7 @@ var procCmd = &cobra.Command{
|
||||
processor.DoMomentMatching()
|
||||
}
|
||||
|
||||
if err := processor.DoPhaseCorrelation(); err != nil {
|
||||
if err := processor.DoPhaseCorrelation(true); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -96,6 +97,11 @@ var procCmd = &cobra.Command{
|
||||
logrus.Error(err)
|
||||
}
|
||||
|
||||
scenesCnt := mathutil.Min(len(panScenes), len(mssScenes))
|
||||
for i := 0; i < scenesCnt; i++ {
|
||||
processor.RegisterScenes(panScenes[i], mssScenes[i])
|
||||
}
|
||||
|
||||
processor.OutputL1A(panScenes, mssScenes)
|
||||
producer.CleanScenes(panScenes)
|
||||
producer.CleanScenes(mssScenes)
|
||||
|
||||
@@ -31,12 +31,13 @@ var testCmd = &cobra.Command{
|
||||
// out := producer.CV_Sobel(mv[i])
|
||||
// utils.SavePanToGDALGTiff(out, 0, 0, "data/temp/out_"+strconv.Itoa(i)+".tif", 1.3)
|
||||
// }
|
||||
for i := 1; i < len(mv); i++ {
|
||||
mv[i] = producer.CV_ECCAlign(mv[0], mv[i])
|
||||
index := len(mv) - 1
|
||||
for i := index - 1; i >= 0; i-- {
|
||||
mv[i] = producer.CV_ECCAlign(mv[index], mv[i])
|
||||
}
|
||||
|
||||
out := gocv.NewMat()
|
||||
mv[0].ConvertTo(&mv[0], gocv.MatTypeCV16U)
|
||||
mv[index].ConvertTo(&mv[index], gocv.MatTypeCV16U)
|
||||
gocv.Merge(mv, &out)
|
||||
utils.SaveBGRToGDALGTiff(out, 4, 0, 0, 5.2,
|
||||
[]godal.ColorInterp{godal.CIBlue, godal.CIGreen, godal.CIRed, godal.CIUndefined},
|
||||
|
||||
Reference in New Issue
Block a user