コード例 #1
0
ファイル: Calibration.cs プロジェクト: Itpyc/k4a.net
        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);
        }
コード例 #2
0
ファイル: Calibration.cs プロジェクト: metamagical/k4a.net
        // 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);
        }