Exemple #1
0
        private static void GetParameters()
        {
            ViveSR_GetCameraParams(ref CameraParameters);
            DistortedCx_L = CameraParameters.Cx_L;
            DistortedCy_L = CameraParameters.Cy_L;
            DistortedCx_R = CameraParameters.Cx_R;
            DistortedCy_R = CameraParameters.Cy_R;
            FocalLength_L = CameraParameters.FocalLength_L;
            FocalLength_R = CameraParameters.FocalLength_R;

            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OUTPUT_DISTORTED_WIDTH, ref DistortedImageWidth);
            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OUTPUT_DISTORTED_HEIGHT, ref DistortedImageHeight);
            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OUTPUT_DISTORTED_CHANNEL, ref DistortedImageChannel);

            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OUTPUT_UNDISTORTED_WIDTH, ref UndistortedImageWidth);
            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OUTPUT_UNDISTORTED_HEIGHT, ref UndistortedImageHeight);
            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OUTPUT_UNDISTORTED_CHANNEL, ref UndistortedImageChannel);

            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_DEPTH, (int)DepthParam.OUTPUT_WIDTH, ref DepthImageWidth);
            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_DEPTH, (int)DepthParam.OUTPUT_HEIGHT, ref DepthImageHeight);
            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_DEPTH, (int)DepthParam.OUTPUT_CHAANEL_1, ref DepthImageChannel);
            ViveSR_Framework.GetParameterDouble(ViveSR_Framework.MODULE_ID_DEPTH, (int)DepthParam.BASELINE, ref Baseline);

            int undistortionMapSize = 0;

            ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.UNDISTORTION_MAP_SIZE, ref undistortionMapSize);
            UndistortionMap_L = new float[undistortionMapSize / sizeof(float)];
            UndistortionMap_R = new float[undistortionMapSize / sizeof(float)];
            ViveSR_Framework.GetParameterFloatArray(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.UNDISTORTION_MAP_L, ref UndistortionMap_L);
            ViveSR_Framework.GetParameterFloatArray(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.UNDISTORTION_MAP_R, ref UndistortionMap_R);

            float[] rawUndistortedCxCyArray = new float[8];
            ViveSR_Framework.GetParameterFloatArray(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.UNDISTORTION_CENTER, ref rawUndistortedCxCyArray);
            double[] undistortedCxCyArray = new double[4];
            Buffer.BlockCopy(rawUndistortedCxCyArray, 0, undistortedCxCyArray, 0, rawUndistortedCxCyArray.Length * sizeof(float));
            UndistortedCx_L = undistortedCxCyArray[0];
            UndistortedCy_L = undistortedCxCyArray[1];
            UndistortedCx_R = undistortedCxCyArray[2];
            UndistortedCy_R = undistortedCxCyArray[3];

            ViveSR_Framework.GetParameterFloatArray(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughParam.OFFSET_HEAD_TO_CAMERA, ref OffsetHeadToCamera);
        }