CameraCalibration.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Seengene.XDKUnityPluginCloud;
  5. /// <summary>
  6. /// 相机标注
  7. /// </summary>
  8. [System.Serializable]
  9. public class CameraCalibration {
  10. public CameraCalibration() { }
  11. public CameraCalibration(Vector2 focalLength, Vector2 principalPoint, Vector2Int resolution) {
  12. this.focal_length = focalLength;
  13. this.principal_point = principalPoint;
  14. this.size = resolution;
  15. }
  16. public CameraCalibration(Vector2 focalLength, Vector2 principalPoint, Vector2Int resolution, bool fishEye, float[] radialDistortion8, string model, float[] radialDistortion) {
  17. this.focal_length = focalLength;
  18. this.principal_point = principalPoint;
  19. this.size = resolution;
  20. this.fish_eye = fishEye;
  21. this.radial_distortion_8 = radialDistortion8;
  22. this.model = model;
  23. this.radial_distortion = radialDistortion;
  24. }
  25. public Vector2 focal_length;
  26. public Vector2 principal_point;
  27. public Vector2Int size;
  28. public bool fish_eye;
  29. public float[] radial_distortion_8;
  30. public string model;
  31. public float[] radial_distortion;
  32. public override string ToString() {
  33. return string.Format("focalLength:{0}, principalPoint:{1}, resolution:{2}, fishEye:{3}, radialDistortion8:{4}, model:{5}, radialDistortion:{6}",
  34. focal_length, principal_point, size, fish_eye, XDKTools.ArrayFloatToString(radial_distortion_8, "f6"), model, XDKTools.ArrayFloatToString(radial_distortion, "f6"));
  35. }
  36. }