public void CalculateCameraIntrinsics() { if (processedImageCount > 0) { Debug.Log("Starting Camera Intrinsics calculation."); intrinsics = CalibrationAPI.Instance.CalculateChessboardIntrinsics(chessSquareSize); Debug.Log($"Chessboard intrinsics reprojection error: {intrinsics.ToString()}"); intrinsicsFileName = CalibrationDataHelper.SaveCameraIntrinsics(intrinsics); Debug.Log($"Camera Intrinsics saved to file: {intrinsicsFileName}"); // Undistort obtained images to understand quality of calculated camera intrinsics. var chessboardImageFileNames = CalibrationDataHelper.GetChessboardImageFileNames(); foreach (var fileName in chessboardImageFileNames) { var texture = CalibrationDataHelper.LoadChessboardImage(fileName); if (texture == null || !UndistortChessboardImage(texture, intrinsics)) { Debug.LogWarning($"Failed to locate/undistort chessboard image: {fileName}"); } else { CalibrationDataHelper.SaveChessboardUndistortedImage(texture, fileName); } } } else { Debug.LogWarning("No images have been processed, unable to calculate camera intrinsics."); } }