atitude interp
This commit is contained in:
@@ -24,6 +24,7 @@ rpc:
|
|||||||
altitude_layer: 5
|
altitude_layer: 5
|
||||||
altitude_range: 1000
|
altitude_range: 1000
|
||||||
method: 2 # 1-最小二乘法 2-NelderMead
|
method: 2 # 1-最小二乘法 2-NelderMead
|
||||||
|
debug: true
|
||||||
|
|
||||||
dem:
|
dem:
|
||||||
dem_1km: "dem/gdlebm.tif"
|
dem_1km: "dem/gdlebm.tif"
|
||||||
@@ -112,7 +112,7 @@ func ExtractAttitude(aps []*AuxPlatform) *Attitudes {
|
|||||||
sec, microsec = ap.UTCTimeSec, ap.Microsecond
|
sec, microsec = ap.UTCTimeSec, ap.Microsecond
|
||||||
att := Attitude{
|
att := Attitude{
|
||||||
UTCTimestampSec: float64(sec) + float64(ReferenceTime2000) +
|
UTCTimestampSec: float64(sec) + float64(ReferenceTime2000) +
|
||||||
float64(transfromGPSandAttMicrosec(microsec))/1e6,
|
float64((microsec))/1e6,
|
||||||
Q0: ap.QuatAttstarQ0,
|
Q0: ap.QuatAttstarQ0,
|
||||||
Q1: ap.QuatAttstarQ1,
|
Q1: ap.QuatAttstarQ1,
|
||||||
Q2: ap.QuatAttstarQ2,
|
Q2: ap.QuatAttstarQ2,
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ const (
|
|||||||
MSSPixels = float64(payload.MSS_PIXEL_WIDTH)
|
MSSPixels = float64(payload.MSS_PIXEL_WIDTH)
|
||||||
MSSCellSize = 12.8 // µm
|
MSSCellSize = 12.8 // µm
|
||||||
CameraRoll = -0.010 // 相机与卫星本体X轴的安装角度, degree FIXME: 安装矩阵应该由卫星方提供
|
CameraRoll = -0.010 // 相机与卫星本体X轴的安装角度, degree FIXME: 安装矩阵应该由卫星方提供
|
||||||
CameraPitch = 0.213 // 相机与卫星本体Y轴的安装角度, degree
|
CameraPitch = 0.150 // 相机与卫星本体Y轴的安装角度, degree
|
||||||
CameraYaw = 0.012 // 相机与卫星本体Z轴的安装角度, degree
|
CameraYaw = 0.010 // 相机与卫星本体Z轴的安装角度, degree
|
||||||
)
|
)
|
||||||
|
|
||||||
// 计算过程使用PAN分辨率
|
// 计算过程使用PAN分辨率
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ type RPCConfig struct {
|
|||||||
AltitudeRange int `yaml:"altitude_range" mapstructure:"altitude_range"`
|
AltitudeRange int `yaml:"altitude_range" mapstructure:"altitude_range"`
|
||||||
AltitudeLayer int `yaml:"altitude_layer" mapstructure:"altitude_layer"`
|
AltitudeLayer int `yaml:"altitude_layer" mapstructure:"altitude_layer"`
|
||||||
Method int `yaml:"method" mapstructure:"method"`
|
Method int `yaml:"method" mapstructure:"method"`
|
||||||
|
Debug bool `yaml:"debug" mapstructure:"debug"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var GCONFIG Config
|
var GCONFIG Config
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ func (r *Registrator) SetSceneBoundary(scene *Scene) (topLeft, bottomRight orb.P
|
|||||||
}
|
}
|
||||||
log.Debug("resolution x: ", xResolution)
|
log.Debug("resolution x: ", xResolution)
|
||||||
log.Debug("resolution y: ", yResolution)
|
log.Debug("resolution y: ", yResolution)
|
||||||
|
scene.Meta.Gsd = math.Max(xResolution, yResolution)
|
||||||
|
|
||||||
// 求外接矩形
|
// 求外接矩形
|
||||||
latMin := mathutil.Min(line0Start.Lat, line0End.Lat, lineNStart.Lat, lineNEnd.Lat)
|
latMin := mathutil.Min(line0Start.Lat, line0End.Lat, lineNStart.Lat, lineNEnd.Lat)
|
||||||
@@ -133,15 +134,14 @@ func (r *Registrator) SetSceneBoundary(scene *Scene) (topLeft, bottomRight orb.P
|
|||||||
scene.Meta.Corners.LowerRight.Latitude = lineNEnd.Lat
|
scene.Meta.Corners.LowerRight.Latitude = lineNEnd.Lat
|
||||||
scene.Meta.Corners.LowerRight.Longitude = lineNEnd.Lon
|
scene.Meta.Corners.LowerRight.Longitude = lineNEnd.Lon
|
||||||
|
|
||||||
// scene.Meta.SatPosX = startPos84[0]
|
aux0 := r.AuxPlatforms[r.sceneOffsetInAuxIndex(scene, 0)]
|
||||||
// scene.Meta.SatPosY = startPos84[1]
|
scene.Meta.SatPosX, scene.Meta.SatPosY, scene.Meta.SatPosZ = calculator.ECEFGeocentricToGeodetic(aux0.W84PosX, aux0.W84PosY, aux0.W84PosZ)
|
||||||
// scene.Meta.SatPosZ = startPos84[2]
|
scene.Meta.Yaw = aux0.Eular3 * 180 / math.Pi
|
||||||
// scene.Meta.Yaw = ae.Eular3 * 180 / math.Pi
|
scene.Meta.Pitch = aux0.Eular2 * 180 / math.Pi
|
||||||
// scene.Meta.Pitch = ae.Eular2 * 180 / math.Pi
|
scene.Meta.Roll = aux0.Eular1 * 180 / math.Pi
|
||||||
// scene.Meta.Roll = ae.Eular1 * 180 / math.Pi
|
|
||||||
|
|
||||||
// 计算RPC
|
// 计算RPC
|
||||||
rpc := NewRPC(r, scene, strings.Replace(scene.Tiff, ".tiff", ".rpb", 1))
|
rpc := NewRPC(r, scene)
|
||||||
if err := rpc.RPC(); err != nil {
|
if err := rpc.RPC(); err != nil {
|
||||||
log.Error("calculate RPC failed: ", err)
|
log.Error("calculate RPC failed: ", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ type RPC struct {
|
|||||||
|
|
||||||
scene *Scene
|
scene *Scene
|
||||||
registrator *Registrator
|
registrator *Registrator
|
||||||
|
|
||||||
rpb string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroundPoint 表示地面点的三维坐标
|
// GroundPoint 表示地面点的三维坐标
|
||||||
@@ -55,13 +53,12 @@ type RPCModel struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// rational polynomial coeffients
|
// rational polynomial coeffients
|
||||||
func NewRPC(r *Registrator, scene *Scene, rpb string) *RPC {
|
func NewRPC(r *Registrator, scene *Scene) *RPC {
|
||||||
rpc := RPC{
|
rpc := RPC{
|
||||||
elevationLayer: config.GCONFIG.RPC.AltitudeLayer,
|
elevationLayer: config.GCONFIG.RPC.AltitudeLayer,
|
||||||
gridsize: config.GCONFIG.RPC.GridSize,
|
gridsize: config.GCONFIG.RPC.GridSize,
|
||||||
registrator: r,
|
registrator: r,
|
||||||
scene: scene,
|
scene: scene,
|
||||||
rpb: rpb,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("start RPC initialization for scene: ", scene.Tiff)
|
log.Info("start RPC initialization for scene: ", scene.Tiff)
|
||||||
@@ -98,8 +95,6 @@ func (rpc *RPC) generateVirtualGCP() {
|
|||||||
rpc.scene.Height, rpc.scene.Width,
|
rpc.scene.Height, rpc.scene.Width,
|
||||||
rpc.elevationLayer, int(rpc.minH), int(rpc.maxH))
|
rpc.elevationLayer, int(rpc.minH), int(rpc.maxH))
|
||||||
|
|
||||||
ft, _ := os.Create("log/scene/" + rpc.scene.SceneId + ".time.txt")
|
|
||||||
defer ft.Close()
|
|
||||||
for _, p := range points {
|
for _, p := range points {
|
||||||
p84 := rpc.registrator.calculateLatLonH(rpc.scene, p.Row, p.Col, p.H)
|
p84 := rpc.registrator.calculateLatLonH(rpc.scene, p.Row, p.Col, p.H)
|
||||||
rpc.GCPs = append(rpc.GCPs, &GroundPoint{
|
rpc.GCPs = append(rpc.GCPs, &GroundPoint{
|
||||||
@@ -109,8 +104,6 @@ func (rpc *RPC) generateVirtualGCP() {
|
|||||||
Y: float64(p.Row),
|
Y: float64(p.Row),
|
||||||
X: float64(p.Col),
|
X: float64(p.Col),
|
||||||
})
|
})
|
||||||
t, dt := rpc.registrator.ImageTime.Interp(p.Row+rpc.scene.Y, 16)
|
|
||||||
ft.WriteString(fmt.Sprintf("%d\t%.9f\t%.9f\n", p.Row, t, dt))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
name := strings.Replace(rpc.scene.Tiff, ".tiff", ".gcp.geojson", -1)
|
name := strings.Replace(rpc.scene.Tiff, ".tiff", ".gcp.geojson", -1)
|
||||||
@@ -278,6 +271,9 @@ func (rpc *RPC) saveRPB(name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rpc *RPC) saveGCP(gcps []*GroundPoint, name string) error {
|
func (rpc *RPC) saveGCP(gcps []*GroundPoint, name string) error {
|
||||||
|
if !config.GCONFIG.RPC.Debug {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
log.Infof("save gcp to %s", name)
|
log.Infof("save gcp to %s", name)
|
||||||
f, err := os.Create(name)
|
f, err := os.Create(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -305,6 +301,9 @@ func (rpc *RPC) saveGCP(gcps []*GroundPoint, name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rpc *RPC) saveGCP2(gcps []*GroundPoint, name string) error {
|
func (rpc *RPC) saveGCP2(gcps []*GroundPoint, name string) error {
|
||||||
|
if !config.GCONFIG.RPC.Debug {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
log.Infof("save gcp to %s", name)
|
log.Infof("save gcp to %s", name)
|
||||||
f, err := os.Create(name)
|
f, err := os.Create(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -322,6 +321,9 @@ func (rpc *RPC) saveGCP2(gcps []*GroundPoint, name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rpc *RPC) saveVec(name string, rowVec, colVec, latVec, lonVec, heightVec *mat.VecDense) error {
|
func (rpc *RPC) saveVec(name string, rowVec, colVec, latVec, lonVec, heightVec *mat.VecDense) error {
|
||||||
|
if !config.GCONFIG.RPC.Debug {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
f, err := os.Create(name)
|
f, err := os.Create(name)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user