fusion product use near-infrared or not defined by user config
This commit is contained in:
@@ -68,11 +68,13 @@ func Pansharpen(panTif, mssTif, fusTif string, method PansharpenMethod) error {
|
|||||||
fus.ConvertTo(&fus, mt)
|
fus.ConvertTo(&fus, mt)
|
||||||
|
|
||||||
var colorInterps []godal.ColorInterp
|
var colorInterps []godal.ColorInterp
|
||||||
if config.GCONFIG.CoRegistration.FUSBandOrder == "RGB" {
|
if config.GCONFIG.CoRegistration.FUSBandOrder == "RGB" ||
|
||||||
|
config.GCONFIG.CoRegistration.FUSBandOrder == "RGBI" {
|
||||||
colorInterps = []godal.ColorInterp{godal.CIRed, godal.CIGreen, godal.CIBlue, godal.CIUndefined}
|
colorInterps = []godal.ColorInterp{godal.CIRed, godal.CIGreen, godal.CIBlue, godal.CIUndefined}
|
||||||
} else {
|
} else {
|
||||||
colorInterps = []godal.ColorInterp{godal.CIBlue, godal.CIGreen, godal.CIRed, godal.CIUndefined}
|
colorInterps = []godal.ColorInterp{godal.CIBlue, godal.CIGreen, godal.CIRed, godal.CIUndefined}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = utils.SaveBGRToGDALGTiff(fus, fus.Channels(), 0, 0, 1.3, colorInterps, fusTif)
|
err = utils.SaveBGRToGDALGTiff(fus, fus.Channels(), 0, 0, 1.3, colorInterps, fusTif)
|
||||||
|
|
||||||
for i := 0; i < len(BGRI); i++ {
|
for i := 0; i < len(BGRI); i++ {
|
||||||
@@ -113,10 +115,17 @@ func PansharpenESRI(pan, B, G, R, I gocv.Mat) gocv.Mat {
|
|||||||
gocv.Add(I, ADJ, &I)
|
gocv.Add(I, ADJ, &I)
|
||||||
|
|
||||||
mss := gocv.NewMat()
|
mss := gocv.NewMat()
|
||||||
if config.GCONFIG.CoRegistration.FUSBandOrder == "RGB" {
|
switch config.GCONFIG.CoRegistration.FUSBandOrder {
|
||||||
|
case "RGB":
|
||||||
gocv.Merge([]gocv.Mat{R, G, B}, &mss)
|
gocv.Merge([]gocv.Mat{R, G, B}, &mss)
|
||||||
} else {
|
case "BGR":
|
||||||
gocv.Merge([]gocv.Mat{B, G, R}, &mss)
|
gocv.Merge([]gocv.Mat{B, G, R}, &mss)
|
||||||
|
case "RGBI":
|
||||||
|
gocv.Merge([]gocv.Mat{R, G, B, I}, &mss)
|
||||||
|
case "BGRI":
|
||||||
|
gocv.Merge([]gocv.Mat{B, G, R, I}, &mss)
|
||||||
|
default:
|
||||||
|
gocv.Merge([]gocv.Mat{R, G, B}, &mss)
|
||||||
}
|
}
|
||||||
|
|
||||||
return mss
|
return mss
|
||||||
|
|||||||
Reference in New Issue
Block a user