private void InitVariables() { this.boundingBoxes = new List <RectI32>(); this.landmarks = new List <LandmarkPoint[]>(); this.allLandmarks = new List <LandmarkPoint[]>(); this.landmarkBoundingBoxes = new List <RectI32>(); this.colors = new List <System.Windows.Media.Color>(); this.depthFormats = new List <String>(); this.depthFormats.Add("Depth"); this.depthFormats.Add("Depth Raw"); this.depthFormats.Add("RGB32"); this.colorFormats = new List <String>(); this.colorFormats.Add("RGB32"); this.colorFormats.Add("RGB24"); this.landmarkGroup = LandmarksGroupType.LANDMARK_GROUP_MOUTH; this.extractLandmarkGroup = true; this.drawFaceBoundingBox = false; this.drawLandmarkPoints = false; this.drawLandmarkBoundingBox = true; this.captureImage = false; this.captureSeries = false; this.pauseSave = false; this.seriesCaptured = 0; this.seriesToCapture = 0; this.streamBox.SelectedIndex = 0; this.dirName = ""; this.colorPixelFormat = Intel.RealSense.PixelFormat.PIXEL_FORMAT_RGB32; this.depthPixelFormat = Intel.RealSense.PixelFormat.PIXEL_FORMAT_DEPTH_RAW; this.boxWidth = 140; this.boxHeight = 80; }
internal static Boolean QueryPointsByGroupINT(IntPtr instance, LandmarksGroupType group, out LandmarkPoint[] points) { int npoints = PXCMFaceData_LandmarksData_QueryNumPointsByGroup(instance, group); IntPtr outPoints2 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(LandmarkPoint)) * npoints); Boolean sts = PXCMFaceData_LandmarksData_QueryPointsByGroup(instance, group, outPoints2); if (sts) { points = new LandmarkPoint[npoints]; for (int i = 0, j = 0; i < npoints; i++, j += Marshal.SizeOf(typeof(LandmarkPoint))) { points[i] = new LandmarkPoint(); Marshal.PtrToStructure(new IntPtr(outPoints2.ToInt64() + j), points[i]); } } else { points = null; } Marshal.FreeHGlobal(outPoints2); return sts; }
private void LandmarkGroupBoxSelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBoxItem selectedLandmarkGroup = (ComboBoxItem)landmarkGroupBox.SelectedItem; switch (selectedLandmarkGroup.Content.ToString().ToLower()) { case "all": extractLandmarkGroup = false; break; case "yaw": extractLandmarkGroup = true; landmarkGroup = LandmarksGroupType.LANDMARK_GROUP_JAW; break; case "mouth": extractLandmarkGroup = true; landmarkGroup = LandmarksGroupType.LANDMARK_GROUP_MOUTH; break; } }
internal static Boolean QueryPointsByGroupINT(IntPtr instance, LandmarksGroupType group, out LandmarkPoint[] points) { int npoints = PXCMFaceData_LandmarksData_QueryNumPointsByGroup(instance, group); IntPtr outPoints2 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(LandmarkPoint)) * npoints); Boolean sts = PXCMFaceData_LandmarksData_QueryPointsByGroup(instance, group, outPoints2); if (sts) { points = new LandmarkPoint[npoints]; for (int i = 0, j = 0; i < npoints; i++, j += Marshal.SizeOf(typeof(LandmarkPoint))) { points[i] = new LandmarkPoint(); Marshal.PtrToStructure(new IntPtr(outPoints2.ToInt64() + j), points[i]); } } else { points = null; } Marshal.FreeHGlobal(outPoints2); return(sts); }
internal static extern Boolean PXCMFaceData_LandmarksData_QueryPointsByGroup(IntPtr instance, LandmarksGroupType groupFlags, IntPtr outPoints);
internal static extern Int32 PXCMFaceData_LandmarksData_QueryNumPointsByGroup(IntPtr instance, LandmarksGroupType group);
/* * Assigns points matched to groupFlags to outPoints. * User is expected to allocate outPoints to size bigger than the group size - point contains the original source (index + name). * Returns true if data and parameters exist, false otherwise. */ public Boolean QueryPointsByGroup(LandmarksGroupType groupFlags, out LandmarkPoint[] outPoints) { return QueryPointsByGroupINT(instance, groupFlags, out outPoints); }
/* * Returns the number of tracked landmarks in groupFlags. */ public Int32 QueryNumPointsByGroup(LandmarksGroupType groupFlags) { return PXCMFaceData_LandmarksData_QueryNumPointsByGroup(instance, groupFlags); }
/* * Assigns points matched to groupFlags to outPoints. * User is expected to allocate outPoints to size bigger than the group size - point contains the original source (index + name). * Returns true if data and parameters exist, false otherwise. */ public Boolean QueryPointsByGroup(LandmarksGroupType groupFlags, out LandmarkPoint[] outPoints) { return(QueryPointsByGroupINT(instance, groupFlags, out outPoints)); }
/* * Returns the number of tracked landmarks in groupFlags. */ public Int32 QueryNumPointsByGroup(LandmarksGroupType groupFlags) { return(PXCMFaceData_LandmarksData_QueryNumPointsByGroup(instance, groupFlags)); }