optimization
This commit is contained in:
43
cmd/test.go
Normal file
43
cmd/test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/airbusgeo/godal"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"gocv.io/x/gocv"
|
||||
"starwiz.cn/sjy01/image-proc/pkg/producer"
|
||||
"starwiz.cn/sjy01/image-proc/pkg/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
input0 string
|
||||
)
|
||||
|
||||
var testCmd = &cobra.Command{
|
||||
Use: "test",
|
||||
Short: "test command",
|
||||
Long: `test command`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
godal.RegisterAll()
|
||||
|
||||
input0_mat, err := utils.ReadTifftoMat(input0)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
mv := gocv.Split(*input0_mat)
|
||||
for i := 0; i < len(mv); i++ {
|
||||
out := producer.FindEdges(mv[i])
|
||||
utils.SavePanToGDALGTiff(out, 0, 0, "data/temp/out_"+strconv.Itoa(i)+".tif", 1.3)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(testCmd)
|
||||
|
||||
testCmd.Flags().StringVarP(&input0, "input0", "i", "/Users/lan/workspace/sjy01/image-proc/data/002438/L1A/ROI_7000_10500/MSS/SJY01_MSS_20241014_121246_002438_018_ROI_7000_10500_L1A.tiff", "input0")
|
||||
}
|
||||
Reference in New Issue
Block a user