//----------------------------------------------------------------------------------------- private void Draw_Gesture_Features() { #region drawing PalmBoundingCircle try { // find bounding rec for PalmPointsCollection PalmBoundingCircle = PointCollection.MinEnclosingCircle(PalmPointsCollection); } catch { return; } // we treat center of the circle as the center of the palm imgMain.Draw(PalmBoundingCircle, new Bgr(Color.Violet), 2); imgMain.Draw(new CircleF(new PointF(PalmBoundingCircle.Center.X, PalmBoundingCircle.Center.Y), 2), new Bgr(Color.Violet), 5); #endregion #region drawing FingerBoundingBox // find bounding rec for FingerPointsCollection MCvBox2D box = PointCollection.MinAreaRect(FingerPointsCollection); FingerBoundingBox = box.MinAreaRect(); // we treat center of the circle as the center of the palm imgMain.Draw(FingerBoundingBox, new Bgr(Color.Cyan), 2); imgMain.Draw(new CircleF(new PointF(box.center.X, box.center.Y), 2), new Bgr(Color.Cyan), 5); #endregion #region drawing all finger points for (int i = 0; i < FingerPointsCollection.Count(); i++) { imgMain.Draw(new CircleF(FingerPointsCollection[i], 2), new Bgr(Color.Yellow), 5); } #endregion #region drawing all palm points for (int i = 0; i < PalmPointsCollection.Count(); i++) { imgMain.Draw(new CircleF(PalmPointsCollection[i], 2), new Bgr(Color.Red), 5); } #endregion //#region drawing lines from fingers to center //for (int i = 0; i < FingerPointsCollection.Count(); i++) //{ // imgMain.Draw(new LineSegment2DF(FingerPointsCollection[i], PalmBoundingCircle.Center), new Bgr(Color.Yellow), 1); //} //#endregion //#region drawing lines from palm to center //for (int i = 0; i < PalmPointsCollection.Count(); i++) //{ // imgMain.Draw(new LineSegment2DF(PalmPointsCollection[i], PalmBoundingCircle.Center), new Bgr(Color.Red), 1); //} //#endregion //#region Filtered drawing lines from fingers to center //for (int i = 0; i < FingerPointsCollection.Count(); i++) //{ // if (FingerPointsCollection[i].Y < PalmBoundingCircle.Center.Y) // { // imgMain.Draw(new LineSegment2DF(FingerPointsCollection[i], PalmBoundingCircle.Center), new Bgr(Color.Yellow), 1); // } //} //#endregion //#region Filtered drawing lines from palm to center //for (int i = 0; i < PalmPointsCollection.Count(); i++) //{ // if (PalmPointsCollection[i].Y < PalmBoundingCircle.Center.Y) // { // imgMain.Draw(new LineSegment2DF(PalmPointsCollection[i], PalmBoundingCircle.Center), new Bgr(Color.Red), 1); // } //} //#endregion }