Brovey method and IHS method with weight

This commit is contained in:
nuknal
2024-09-14 11:57:07 +08:00
parent c311c3dc3d
commit d3cf743b71
3 changed files with 71 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ var (
outputDir string
fusReport string
fusMethod int
weight float32
)
var fusCmd = &cobra.Command{
@@ -41,7 +42,8 @@ var fusCmd = &cobra.Command{
err := fusion.Pansharpen(panImage, mssImage,
filepath.Join(outputDir, fusedTiff),
fusion.PansharpenMethod(fusMethod))
fusion.PansharpenMethod(fusMethod),
weight)
if err != nil {
logrus.Fatal(err)
}
@@ -66,7 +68,8 @@ func init() {
fusCmd.Flags().StringVarP(&mssImage, "mss", "m", "", "path to the MSS image")
fusCmd.Flags().StringVarP(&outputDir, "output", "o", "", "path to the output directory")
fusCmd.Flags().StringVarP(&paramsXML, "params", "x", "", "path to the XML file containing parameters for GDAL_Pansharpen")
fusCmd.Flags().IntVarP(&fusMethod, "method", "t", int(fusion.ESRI), "method to use for fusion (5: IHS, 3: ESRI)")
fusCmd.Flags().IntVarP(&fusMethod, "method", "t", int(fusion.ESRI), "method to use for fusion (5: IHS, 3: ESRI 1: brovey)")
fusCmd.Flags().Float32VarP(&weight, "weight", "w", 0.1, "weight of the MSS image in the fusion (0-1)")
}
func initFUSParams() {