ecc align testing

This commit is contained in:
nuknal
2024-10-30 17:56:17 +08:00
parent 0e920ce9f0
commit e51d07901d
4 changed files with 66 additions and 7 deletions

View File

@@ -1,8 +1,6 @@
package main
import (
"strconv"
"github.com/airbusgeo/godal"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
@@ -29,10 +27,20 @@ var testCmd = &cobra.Command{
}
mv := gocv.Split(*input0_mat)
for i := 0; i < len(mv); i++ {
out := producer.CV_Sobel(mv[i])
utils.SavePanToGDALGTiff(out, 0, 0, "data/temp/out_"+strconv.Itoa(i)+".tif", 1.3)
// for i := 0; i < len(mv); i++ {
// 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])
}
out := gocv.NewMat()
mv[0].ConvertTo(&mv[0], gocv.MatTypeCV16U)
gocv.Merge(mv, &out)
utils.SaveBGRToGDALGTiff(out, 4, 0, 0, 5.2,
[]godal.ColorInterp{godal.CIBlue, godal.CIGreen, godal.CIRed, godal.CIUndefined},
"data/temp/ecc.tif")
},
}