Beispiel #1
0
        //public static void InitRigidReconstructionParam()
        //{
        //    this function is not called in current version, keep this API on, we can allow user to adjust some default setting
        //    ViveSR_Framework.SetParameterInt(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.CONFIG_DATA_SOURCE, (int)ViveSR_RigidReconstructionConfig.ReconstructionDataSource);
        //    ViveSR_Framework.SetParameterInt(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.CONFIG_DATASET_FRAME_NUM, (int)ViveSR_RigidReconstructionConfig.NumDatasetFrame);
        //    ViveSR_Framework.SetParameterString(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.CONFIG_DATASET_PATH, ViveSR_RigidReconstructionConfig.DatasetPath);
        //    ViveSR_Framework.SetParameterBool(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.CONFIG_EXPORT_COLLIDER, ViveSR_RigidReconstructionConfig.ExportCollider);
        //    ViveSR_Framework.SetParameterBool(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.CONFIG_EXPORT_TEXTURE, true);
        //    ViveSR_Framework.SetParameterInt(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.CONFIG_QUALITY, (int)ViveSR_RigidReconstructionConfig.Quality);
        //}

        public static int GetRigidReconstructionIntParameter(int type)
        {
            int ret = -1;

            if (ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, type, ref ret) != (int)Error.WORK)
            {
                Debug.Log("[ViveSR] [RigidReconstruction] GetRigidReconstructionIntParameter Failed");
            }

            return(ret);
        }
        public static bool GetQualityScale(out int value)
        {
            int result = ViveSR_Framework.GetParameterInt(ViveSR_Framework.MODULE_ID_DEPTH, (int)DepthParam.COLLIDER_QUALITY, ref QualityScale);

            if (result == (int)Error.WORK)
            {
                value = QualityScale;
                return(true);
            }
            else
            {
                value = -1;
                return(false);
            }
        }
Beispiel #3
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);
        }