private void UpdateFrameImage() { WorkingImage = Video.GetGrayFrameImage(); PointF[] headPoints; Point[] bodyPoints; Rbsk.GetHeadAndBody(WorkingImage.Convert <Bgr, byte>(), out headPoints, out bodyPoints); HeadPoints = headPoints; if (headPoints == null) { HeadPoint = PointF.Empty; } else { HeadPoint = headPoints[2]; } BodyContour = bodyPoints; DrawAndDisplayImage(); }
private void Preview() { using (Image <Gray, byte> gray = WorkingImage.Convert <Gray, byte>()) { Whiskers = Rbsk.ProcessWhiskersForSingleFrame(gray, HeadPoints, BodyContour); if (WhiskerSettings.RemoveDuds) { FinalWhiskers = ModelResolver.Resolve <IWhiskerCollection>(); PointF midPoint = HeadPoints[1].MidPoint(HeadPoints[3]); Vector orientation = new Vector(HeadPoint.X - midPoint.X, HeadPoint.Y - midPoint.Y); PostProcessWhiskers2(midPoint, orientation, Whiskers, FinalWhiskers); } else { FinalWhiskers = Whiskers; } } PreviewGenerated = true; DrawAndDisplayImage(); }