// Use this for initialization void Start() { /* Create SenseManager Instance */ sm = SenseManager.CreateInstance(); sm.CaptureManager.Realtime = false; // Selecting a higher resolution profile StreamProfileSet profiles = new StreamProfileSet(); profiles.color.imageInfo.width = 1280; profiles.color.imageInfo.height = 720; RangeF32 f_rate = new RangeF32(30, 30); profiles.color.frameRate = f_rate; profiles.depth.imageInfo.width = 640; profiles.depth.imageInfo.height = 480; RangeF32 f_drate = new RangeF32(30, 30); profiles.depth.frameRate = f_drate; // Setting the resolution profile sm.CaptureManager.FilterByStreamProfiles(profiles); sampleReader = SampleReader.Activate(sm); sampleReader2 = SampleReader.Activate(sm); sampleReader2.EnableStream(StreamType.STREAM_TYPE_DEPTH, depthWidth, depthHeight, colorFPS); // Enable and Get a segmentation instance here for configuration seg = Seg3D.Activate(sm); // Initialize seg.FrameProcessed += OnFrameProcessed; seg.OnAlert += Seg_OnAlert; sampleReader2.SampleArrived += SampleArrived; /* Initialize pipeline */ sm.Init(); // Flip the image horizontally sm.CaptureManager.Device.IVCAMAccuracy = IVCAMAccuracy.IVCAM_ACCURACY_FINEST; sm.CaptureManager.Device.MirrorMode = MirrorMode.MIRROR_MODE_HORIZONTAL; /* Create NativeTexturePlugin to render Texture2D natively */ texPlugin = NativeTexturePlugin.Activate(); // Configuring the material and its texture RGBMaterial.mainTexture = new Texture2D(colorWidth, colorHeight, TextureFormat.BGRA32, false); // Update material's Texture2D with enabled image size. RGBMaterial.mainTextureScale = new Vector2(-1, -1); // Flip the image colorTex2DPtr = RGBMaterial.mainTexture.GetNativeTexturePtr(); // Retrieve native Texture2D Pointer /* Start Streaming */ sm.StreamFrames(false); }
// Use this for initialization void Start() { /* Create SenseManager Instance */ sm = SenseManager.CreateInstance(); /* Selecting a higher resolution profile*/ StreamProfileSet profiles = new StreamProfileSet(); profiles.color.imageInfo.width = 1280; profiles.color.imageInfo.height = 720; RangeF32 f_rate = new RangeF32(30, 30); profiles.color.frameRate = f_rate; profiles.depth.imageInfo.width = 640; profiles.depth.imageInfo.height = 480; RangeF32 f_drate = new RangeF32(30, 30); profiles.depth.frameRate = f_drate; /* Setting the resolution profile */ sm.CaptureManager.FilterByStreamProfiles(profiles); /* Enable and Get a segmentation instance here for configuration */ seg = Seg3D.Activate(sm); /* Subscribe to seg arrived event */ seg.FrameProcessed += OnFrameProcessed; /* Initialize pipeline */ sm.Init(); /* Create NativeTexturePlugin to render Texture2D natively */ texPlugin = NativeTexturePlugin.Activate(); SegMaterial.mainTexture = new Texture2D(segWidth, segHeight, TextureFormat.BGRA32, false); // Update material's Texture2D with enabled image size. SegMaterial.mainTextureScale = new Vector2(-1, -1); // Flip the image segTex2DPtr = SegMaterial.mainTexture.GetNativeTexturePtr(); // Retrieve native Texture2D Pointer /* Start Streaming */ sm.StreamFrames(false); }
/** @brief Set the active profile for the all video streams. The application must configure all streams before streaming. @param[in] profiles The stream profile set. @return PXCM_STATUS_NO_ERROR successful execution. */ public pxcmStatus SetStreamProfileSet(StreamProfileSet profiles) { return PXCMCapture_Device_SetStreamProfileSet(instance, profiles); }
/** @brief Return the active stream configuration parameters (during streaming). @param[out] profiles The stream profile set, to be returned. @return PXCM_STATUS_NO_ERROR successful execution. */ public pxcmStatus QueryStreamProfileSet(out StreamProfileSet profiles) { return QueryStreamProfileSet(StreamType.STREAM_TYPE_ANY, WORKING_PROFILE, out profiles); }
/** @brief Return the unique configuration parameters for the selected video streams (types). @param[in] scope The bit-OR'ed value of stream types of interest. @param[in] index Zero-based index to retrieve all valid profiles. @param[out] profiles The stream profile set. @return PXCM_STATUS_NO_ERROR successful execution. @return PXCM_STATUS_ITEM_UNAVAILABLE index out of range. */ public pxcmStatus QueryStreamProfileSet(StreamType scope, Int32 index, out StreamProfileSet profiles) { return QueryStreamProfileSetINT(instance, scope, index, out profiles); }
/** @brief Check if profile set is valid. @param[in] profiles The stream profile set to check @return true stream profile is valid. @return false stream profile is invalid. */ public Boolean IsStreamProfileSetValid(StreamProfileSet profiles) { return PXCMCapture_Device_IsStreamProfileSetValid(instance, profiles); }
internal static extern pxcmStatus PXCMCapture_Device_SetStreamProfileSet(IntPtr device, StreamProfileSet profiles);
internal static extern Boolean PXCMCapture_Device_IsStreamProfileSetValid(IntPtr device, StreamProfileSet profiles);
internal static pxcmStatus QueryStreamProfileSetINT(IntPtr device, StreamType scope, Int32 index, out StreamProfileSet profiles) { profiles = new StreamProfileSet(); return PXCMCapture_Device_QueryStreamProfileSet(device, scope, index, profiles); }
internal static pxcmStatus QueryStreamProfileSetINT(IntPtr device, StreamType scope, Int32 index, out StreamProfileSet profiles) { profiles = new StreamProfileSet(); return(PXCMCapture_Device_QueryStreamProfileSet(device, scope, index, profiles)); }
private static extern pxcmStatus PXCMCapture_Device_QueryStreamProfileSet(IntPtr device, StreamType scope, Int32 index, [Out] StreamProfileSet profiles);