多云时无法配准
This commit is contained in:
@@ -19,7 +19,7 @@ func GTiffToJPG(ftiff, fjpg string, reversed bool) error {
|
||||
defer ds.Close()
|
||||
|
||||
bands := ds.Bands()
|
||||
log.Infof("TIFF file %s has %d bands", ftiff, len(bands))
|
||||
log.Infof("creating JPG for TIFF file %s.", ftiff)
|
||||
|
||||
// 获取图像大小
|
||||
width := bands[0].Structure().SizeX
|
||||
@@ -62,9 +62,9 @@ func GTiffToJPG(ftiff, fjpg string, reversed bool) error {
|
||||
img8 := gocv.NewMat()
|
||||
defer img8.Close()
|
||||
if bandsCnt == 1 {
|
||||
img.ConvertToWithParams(&img8, gocv.MatTypeCV8UC1, 1.0/256.0*2, 0)
|
||||
img.ConvertToWithParams(&img8, gocv.MatTypeCV8UC1, 1.0/256.0*1.5, 0)
|
||||
} else {
|
||||
img.ConvertToWithParams(&img8, gocv.MatTypeCV8UC3, 1.0/256.0*2, 0)
|
||||
img.ConvertToWithParams(&img8, gocv.MatTypeCV8UC3, 1.0/256.0*1.5, 0)
|
||||
if reversed {
|
||||
channels := gocv.Split(img8)
|
||||
gocv.Merge([]gocv.Mat{channels[2], channels[1], channels[0]}, &img8)
|
||||
|
||||
Reference in New Issue
Block a user