atitude interp

This commit is contained in:
nuknal
2024-09-10 16:02:10 +08:00
parent e44bd318ae
commit 7bd0896f05
6 changed files with 26 additions and 22 deletions

View File

@@ -33,8 +33,6 @@ type RPC struct {
scene *Scene
registrator *Registrator
rpb string
}
// GroundPoint 表示地面点的三维坐标
@@ -55,13 +53,12 @@ type RPCModel struct {
}
// rational polynomial coeffients
func NewRPC(r *Registrator, scene *Scene, rpb string) *RPC {
func NewRPC(r *Registrator, scene *Scene) *RPC {
rpc := RPC{
elevationLayer: config.GCONFIG.RPC.AltitudeLayer,
gridsize: config.GCONFIG.RPC.GridSize,
registrator: r,
scene: scene,
rpb: rpb,
}
log.Info("start RPC initialization for scene: ", scene.Tiff)
@@ -98,8 +95,6 @@ func (rpc *RPC) generateVirtualGCP() {
rpc.scene.Height, rpc.scene.Width,
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 {
p84 := rpc.registrator.calculateLatLonH(rpc.scene, p.Row, p.Col, p.H)
rpc.GCPs = append(rpc.GCPs, &GroundPoint{
@@ -109,8 +104,6 @@ func (rpc *RPC) generateVirtualGCP() {
Y: float64(p.Row),
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)
@@ -278,6 +271,9 @@ func (rpc *RPC) saveRPB(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)
f, err := os.Create(name)
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 {
if !config.GCONFIG.RPC.Debug {
return nil
}
log.Infof("save gcp to %s", name)
f, err := os.Create(name)
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 {
if !config.GCONFIG.RPC.Debug {
return nil
}
f, err := os.Create(name)
if err != nil {