Ejemplo n.º 1
0
 //public static
 public Feature()
 {
     HeadPoint         = new FeaturePoint();
     ArmsJointPoint    = new FeaturePoint();
     LeftArmPoint      = new FeaturePoint();
     RightArmPoint     = new FeaturePoint();
     SilhoutteCentroid = new FeaturePoint();
     LeftFootPoint     = new FeaturePoint();
     RightFootPoint    = new FeaturePoint();
 }
Ejemplo n.º 2
0
        // Method to Extract the Feature Points and assign them in the list
        public static List <FeaturePoint> ExtractFeaturePoints(
            Line BigCommonLine,
            Line BottomLeftLine,
            Line BottomRightLine,
            Line TopLeftLine,
            Line TopRightLine)
        {
            // for head point top point with smaller y value will be the head point
            if (BigCommonLine != null)
            {
                FeaturePoint fp;
                if (BigCommonLine.p1.Y < BigCommonLine.p2.Y)
                {
                    fp = new FeaturePoint(BigCommonLine.p1, "headpoint");
                }
                else
                {
                    fp = new FeaturePoint(BigCommonLine.p2, "headpoint");
                }

                features.Add(fp);
            }

            // Intersection Point of Two Arms is ArmsJointPoint
            if (TopLeftLine != null && TopRightLine != null)
            {
                Point p = new Point();
                p = FindIntersectionPoint(TopLeftLine, TopRightLine);
                FeaturePoint fp = new FeaturePoint(p, "armsjointpoint");
                features.Add(fp);
            }

            // for left arm point TopLeftLine with large Y Value
            if (TopLeftLine != null)
            {
                FeaturePoint fp;
                if (TopLeftLine.p1.Y > TopLeftLine.p2.Y)
                {
                    fp = new FeaturePoint(TopLeftLine.p1, "leftarmpoint");
                }
                else
                {
                    fp = new FeaturePoint(TopLeftLine.p2, "leftarmpoint");
                }
                features.Add(fp);
            }

            // for right arm point TopRightLine with large Y Value
            if (TopRightLine != null)
            {
                FeaturePoint fp;
                if (TopRightLine.p1.Y > TopRightLine.p2.Y)
                {
                    fp = new FeaturePoint(TopRightLine.p1, "rightarmpoint");
                }
                else
                {
                    fp = new FeaturePoint(TopRightLine.p2, "rightarmpoint");
                }
                features.Add(fp);
            }

            // left foot point with large Y value of BottomLeftLine
            if (BottomLeftLine != null)
            {
                FeaturePoint fp;
                if (BottomLeftLine.p1.Y > BottomLeftLine.p2.Y)
                {
                    fp = new FeaturePoint(BottomLeftLine.p1, "leftfootpoint");
                }
                else
                {
                    fp = new FeaturePoint(BottomLeftLine.p2, "leftfootpoint");
                }
                features.Add(fp);
            }

            // for right foot point BottomRightLine with large Y Value
            if (BottomRightLine != null)
            {
                FeaturePoint fp;
                if (BottomRightLine.p1.Y > BottomRightLine.p2.Y)
                {
                    fp = new FeaturePoint(BottomRightLine.p1, "rightfootpoint");
                }
                else
                {
                    fp = new FeaturePoint(BottomRightLine.p2, "rightfootpoint");
                }
                features.Add(fp);
            }
            // centroid Point will be the intersection point of bottom left line and bottom right line
            if (BottomLeftLine != null && BottomRightLine != null)
            {
                Point p = new Point();
                p = FindIntersectionPoint(BottomLeftLine, BottomRightLine);
                FeaturePoint fp = new FeaturePoint(p, "centroidpoint");
                features.Add(fp);
            }

            return(features);
        }