coordinate frames transformation

This commit is contained in:
nuknal
2024-08-15 14:01:05 +08:00
parent 7c1240f2db
commit c2480a828b
12 changed files with 19640 additions and 16 deletions

View File

@@ -38,13 +38,13 @@ func CameraDirectionVec(u, v float64) []float64 {
// fmt.Printf("Diagonal (calculated from FOV): %.6f mm\n", dCalcOfFOV)
directionVec := []float64{0, 0, 0}
directionVec[0] = 0 // x方向, mm线性CCD每次单行成像
directionVec[1] = (v - PANPixels/2) * PANCellSize / 1000.0 // y方向, mm
directionVec[2] = -FocalLength // z方向, mm
directionVec[0] = 0 // x方向, mm线性CCD每次单行成像
directionVec[1] = (v - PANPixels/2) * PANCellSize / 1000.0 / 1000.0 // y方向, mm
directionVec[2] = -FocalLength / 1000.0 // z方向, mm
// 归一化
// fmt.Printf("Direction Vector: (%.6f, %.6f, %.6f) \n", directionVec[0], directionVec[1], directionVec[2])
directionVec = normalizeVec(directionVec)
// directionVec = normalizeVec(directionVec)
// fmt.Printf("Direction Vector (normalized): (%.6f, %.6f, %.6f) \n", directionVec[0], directionVec[1], directionVec[2])
return directionVec