private static void InitDummyCameraCalibration(ref CameraCalibration cameraCalibration, int widthPixels, int heightPixels, float hFovDegrees, float vFovDegrees) { if (widthPixels <= 0 || heightPixels <= 0) { return; } cameraCalibration.ResolutionWidth = widthPixels; cameraCalibration.ResolutionHeight = heightPixels; cameraCalibration.MetricRadius = 1.7f; cameraCalibration.Intrinsics.Model = CalibrationModel.BrownConrady; cameraCalibration.Intrinsics.ParameterCount = 14; cameraCalibration.Intrinsics.Parameters.Cx = widthPixels / 2f; cameraCalibration.Intrinsics.Parameters.Cy = heightPixels / 2f; cameraCalibration.Intrinsics.Parameters.Fx = SizeAndFovToFocus(widthPixels, hFovDegrees); cameraCalibration.Intrinsics.Parameters.Fy = SizeAndFovToFocus(heightPixels, vFovDegrees); InitDummyExtrinsics(ref cameraCalibration.Extrinsics); }
// Ideal pin-hole camera. No distortions. private static void InitDummyCameraCalibration(ref CameraCalibration cameraCalibration, int widthPixels, int heightPixels, float hFovDegrees, float vFovDegrees) { if (widthPixels <= 0 || heightPixels <= 0) { return; } cameraCalibration.ResolutionWidth = widthPixels; cameraCalibration.ResolutionHeight = heightPixels; cameraCalibration.MetricRadius = 1.7f; cameraCalibration.Intrinsics.Model = CalibrationModel.BrownConrady; // This model is in use in Azure Kinect Sensor SDK cameraCalibration.Intrinsics.ParameterCount = 14; // Corresponds to BrownConrady model cameraCalibration.Intrinsics.Parameters.Cx = (widthPixels - 1f) / 2f; cameraCalibration.Intrinsics.Parameters.Cy = (heightPixels - 1f) / 2f; cameraCalibration.Intrinsics.Parameters.Fx = SizeAndFovToFocus(widthPixels, hFovDegrees); cameraCalibration.Intrinsics.Parameters.Fy = SizeAndFovToFocus(heightPixels, vFovDegrees); InitDummyExtrinsics(ref cameraCalibration.Extrinsics); }