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

@@ -30,9 +30,9 @@ type AuxPlatform struct {
QuatOrbJQ1 float64 // [37-40]轨道相对惯性系四元数矢部 的 Q1 值,量纲 1/0x40000000 QuatOrbJQ1 float64 // [37-40]轨道相对惯性系四元数矢部 的 Q1 值,量纲 1/0x40000000
QuatOrbJQ2 float64 // [41-44]Q2 值 QuatOrbJQ2 float64 // [41-44]Q2 值
QuatOrbJQ3 float64 // [45-48]Q3 值 QuatOrbJQ3 float64 // [45-48]Q3 值
Eular1 float64 // [49-52]本体相对轨道姿态角,[Z]Yaw 测摆角量纲1/1000000 单位rad Eular1 float64 // [49-52]本体相对轨道姿态角,[X]Roll 测摆角量纲1/1000000 单位rad
Eular2 float64 // [53-56] Pitch [Y] Eular2 float64 // [53-56] Pitch [Y] Pitch
Eular3 float64 // [57-60] Roll [X] Eular3 float64 // [57-60] Roll [Z] YAW
DotEular1 float64 // [61-62]本体相对轨道角速度量纲1/100000 单位rad DotEular1 float64 // [61-62]本体相对轨道角速度量纲1/100000 单位rad
DotEular2 float64 // [63-64] DotEular2 float64 // [63-64]
DotEular3 float64 // [65-66] DotEular3 float64 // [65-66]

View File

@@ -39,10 +39,6 @@ func (r *Registrator) ScenePosition(scene *Scene) (topLeft, bottomRight orb.Poin
lat, lng := calculator.CalculateDestination(lat0, lng0, lat, lng := calculator.CalculateDestination(lat0, lng0,
float64(scene.Width)*scene.Meta.Gsd, float64(-scene.Y)*scene.Meta.Gsd) 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, lat1, lng1 := calculator.CalculateDestination(lat, lng,
float64(scene.Width)*scene.Meta.Gsd, float64(-scene.Height)*scene.Meta.Gsd) 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.SatPosX = ap.WGS84PosX
scene.Meta.SatPosY = ap.WGS84PosY scene.Meta.SatPosY = ap.WGS84PosY
scene.Meta.SatPosZ = ap.WGS84PosZ 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.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) // feature := geojson.NewFeature(poly)
// fcs.Features = append(fcs.Features, feature) // fcs.Features = append(fcs.Features, feature)

View File

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

View File

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

View File

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

View File

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