示例#1
0
        private HandObject CheckWithCircles(bool[,] boolmap, int width, int height)
        {
            //The middle of the image
            int MiddleX = width/2;
            int MiddleY = height/2;

            int radius = 0;
            //The maximal radius: the diagonal-length / 2
            int maxRadius = (int)Math.Round(Math.Sqrt(width*width + height*height) / 2);

            for (radius = 0; radius <= maxRadius; radius ++)
            {
                //Now check every point on the current circle (around the middle point)
                //every point means to calculate the coords for every angle
                for (double angle = 0; angle < 2*Math.PI; angle = angle + SettingsManager.RecognitionSet.HandRecognitionDeltaAngle)
                {
                    int pointX = (int) Math.Round(Math.Sin(angle)*radius);
                    int pointY = (int) Math.Round(Math.Cos(angle)*radius);

                    //Check whether the coords are valid
                    if (!(pointX > width || pointX < 0 || pointY > height || pointY < 0))
                    {
                        //if true, return as a hand object
                        if (boolmap[pointX,pointY])
                        {
                            HandObject hand = new HandObject();
                            hand.PointsAt = new TPoint(pointX, pointY, TPoint.PointCreationType.depth);
                            return hand;
                        }
                    }
                }
            }

            return null; //in case no point is found
        }
示例#2
0
        public RecognitionDataPacket()
        {
            rawDepthImage = null;
            correctedDepthImage = null;
            TableObjects = new List<TableObject>();
            HandObj = null;
            objectmap = null;
            neighbourmap = null;

            bmpCorrectedDepth = null;
            bmpRawDepth = null;
            bmpVideoFrame = null;

            RecognitionDuration = 0;
        }
示例#3
0
 public new object Clone()
 {
     HandObject obj = new HandObject();
     if (Center != null)
         obj.Center = Center.Clone();
     obj.CenterDefined = CenterDefined;
     if (ExtractedBitmap != null)
         obj.ExtractedBitmap = (Bitmap)ExtractedBitmap.Clone();
     obj.Height = Height;
     obj.ObjectID = ObjectID;
     obj.Radius = Radius;
     obj.DirectionVector = DirectionVector;
     obj.RotationDefined = RotationDefined;
     obj.TrackingStatus = TrackingStatus;
     obj.TrackingFrameExistence = TrackingFrameExistence;
     if (this.PointsAt != null)
     {
         obj.PointsAt = PointsAt.Clone();
     }
     return obj;
 }