refactor
This commit is contained in:
@@ -21,7 +21,7 @@ import (
|
||||
"starwiz.cn/sjy01/image-proc/pkg/config"
|
||||
)
|
||||
|
||||
func (r *Registrator) LoadAuxData() error {
|
||||
func (r *ImgProc) LoadAuxData() error {
|
||||
var err error
|
||||
r.auxHeads, r.auxBoxes, r.AuxPlatforms, err = auxilary.ExtractAux(r.Params.AuxRawFile)
|
||||
|
||||
@@ -37,7 +37,7 @@ func (r *Registrator) LoadAuxData() error {
|
||||
}
|
||||
|
||||
// 数据校验和测试
|
||||
func (r *Registrator) AuxPrint() {
|
||||
func (r *ImgProc) AuxPrint() {
|
||||
var fcPos84 geojson.FeatureCollection
|
||||
var fcPos84Interp geojson.FeatureCollection
|
||||
for _, p := range r.AuxPlatforms {
|
||||
@@ -63,7 +63,7 @@ func (r *Registrator) AuxPrint() {
|
||||
f.Write(data)
|
||||
}
|
||||
|
||||
func (r *Registrator) SceneImageTime(scene *Scene) (start, center, end time.Time) {
|
||||
func (r *ImgProc) SceneImageTime(scene *Scene) (start, center, end time.Time) {
|
||||
startPosInAux, endPosInAux := r.SceneInAuxIndex(scene)
|
||||
centerPosInAux := (startPosInAux + endPosInAux) / 2
|
||||
|
||||
@@ -78,7 +78,7 @@ func (r *Registrator) SceneImageTime(scene *Scene) (start, center, end time.Time
|
||||
}
|
||||
|
||||
// FIXME: This function is not accurate enough. 四元数、成像时刻、GPS 等需要修改为插值获取
|
||||
func (r *Registrator) ComputeMetaAndRPC(scene *Scene) (topLeft, bottomRight orb.Point) {
|
||||
func (r *ImgProc) ComputeMetaAndRPC(scene *Scene) (topLeft, bottomRight orb.Point) {
|
||||
log.Info("using attitude quaternion to calculate image boundary...")
|
||||
line0Start := r.calculateLatLonH(scene, 0, 0, 0)
|
||||
line0End := r.calculateLatLonH(scene, 0, scene.Width, 0)
|
||||
@@ -169,13 +169,13 @@ func (r *Registrator) ComputeMetaAndRPC(scene *Scene) (topLeft, bottomRight orb.
|
||||
return
|
||||
}
|
||||
|
||||
func (r *Registrator) SceneInAuxIndex(scene *Scene) (int, int) {
|
||||
func (r *ImgProc) SceneInAuxIndex(scene *Scene) (int, int) {
|
||||
startPosInAux := r.sceneOffsetInAuxIndex(scene, 0)
|
||||
endPosInAux := r.sceneOffsetInAuxIndex(scene, scene.Height)
|
||||
return startPosInAux, endPosInAux
|
||||
}
|
||||
|
||||
func (r *Registrator) sceneOffsetInAuxIndex(scene *Scene, offset int) int {
|
||||
func (r *ImgProc) sceneOffsetInAuxIndex(scene *Scene, offset int) int {
|
||||
var auxForImageRow int
|
||||
switch scene.Type {
|
||||
case "MSS":
|
||||
@@ -194,7 +194,7 @@ func (r *Registrator) sceneOffsetInAuxIndex(scene *Scene, offset int) int {
|
||||
}
|
||||
|
||||
// row, col 相对于图像景左上角, H 为地面目标点高度
|
||||
func (r *Registrator) calculateLatLonH(scene *Scene, row, col, H int) calculator.IntersectionPoint {
|
||||
func (r *ImgProc) calculateLatLonH(scene *Scene, row, col, H int) calculator.IntersectionPoint {
|
||||
// 内插值获取图像行时刻
|
||||
ucam := col
|
||||
cross := 16
|
||||
|
||||
Reference in New Issue
Block a user