This commit is contained in:
nuknal
2024-06-06 16:54:09 +08:00
parent b5e566fb0e
commit f7c4237c77
6 changed files with 12 additions and 14 deletions

View File

@@ -39,10 +39,6 @@ func (r *Registrator) ScenePosition(scene *Scene) (topLeft, bottomRight orb.Poin
lat, lng := calculator.CalculateDestination(lat0, lng0,
float64(scene.Width)*scene.Meta.Gsd, float64(-scene.Y)*scene.Meta.Gsd)
// lat0, lng0, h0 := calculator.WGS84XYZtoLatLngH(ap1.WGS84PosX, ap1.WGS84PosY, ap1.WGS84PosZ)
// fmt.Println("Scene Position End:", lat0, lng0, h0)
lat1, lng1 := calculator.CalculateDestination(lat, lng,
float64(scene.Width)*scene.Meta.Gsd, float64(-scene.Height)*scene.Meta.Gsd)
@@ -71,9 +67,9 @@ func (r *Registrator) ScenePosition(scene *Scene) (topLeft, bottomRight orb.Poin
scene.Meta.SatPosX = ap.WGS84PosX
scene.Meta.SatPosY = ap.WGS84PosY
scene.Meta.SatPosZ = ap.WGS84PosZ
scene.Meta.Yaw = ap.Eular1 * 180 / math.Pi
scene.Meta.Yaw = ap.Eular3 * 180 / math.Pi
scene.Meta.Pitch = ap.Eular2 * 180 / math.Pi
scene.Meta.Roll = ap.Eular3 * 180 / math.Pi
scene.Meta.Roll = ap.Eular1 * 180 / math.Pi
// feature := geojson.NewFeature(poly)
// fcs.Features = append(fcs.Features, feature)

View File

@@ -26,6 +26,8 @@ const (
OverlappedBlockLines = 3000 // 重叠块的行数
DownSampled ResampleMethod = "down_sample_pan"
UpSampled ResampleMethod = "up_sample_mss"
PanResolution = 1.3 // mm/pixel
MssResolution = 5.2
)
type ResampleMethod string

View File

@@ -73,10 +73,10 @@ func (r *Registrator) makeProductMeta(scene *Scene) *ProductMeta {
switch scene.Type {
case "PAN":
meta.Gsd = 1.25
meta.Gsd = 1.3
meta.Bands = 1
case "MSS":
meta.Gsd = 5
meta.Gsd = 5.2
meta.Bands = 4
}

View File

@@ -34,7 +34,7 @@ func savePanToGDALGTiff(pan gocv.Mat, topLeftX, topLeftY float64, tiffFile strin
}
defer ds.Close()
setGeoTransform(ds, topLeftX, topLeftY, 1.25)
setGeoTransform(ds, topLeftX, topLeftY, PanResolution)
ds.SetMetadata("NBITS", "16")
// 将通道的数据转换为uint16数组
@@ -68,7 +68,7 @@ func (r *Registrator) SaveRegisteredMssToGDALGTiff(tiffFile string) error {
gocv.Merge(r.registeredMssImages[:], &r.rgbirImage)
err := SaveBGRToGDALGTiff(r.rgbirImage,
4, 0, 0, 5,
4, 0, 0, MssResolution,
[]godal.ColorInterp{godal.CIBlue, godal.CIGreen, godal.CIRed, godal.CIUndefined},
tiffFile)
if err != nil {

View File

@@ -144,7 +144,7 @@ func (r *Registrator) SaveScenesToTiff(panScenes []*Scene, mssScenes []*Scene) e
4,
scene.Meta.Corners.UpperLeft.Longitude,
scene.Meta.Corners.UpperLeft.Latitude,
5,
MssResolution,
[]godal.ColorInterp{godal.CIBlue, godal.CIGreen, godal.CIRed, godal.CIUndefined},
scene.Tiff)
if err != nil {