/// <summary>
        /// add result of color blob detection
        /// must run under lock()
        /// </summary>
        /// <param name="contour"></param>
        /// <param name="currentPanKinect"></param>
        /// <param name="currentTiltKinect"></param>
        /// <returns>can return null</returns>
        public VideoSurveillanceTarget Update(ContourContainer contour, double currentPanKinect, double currentTiltKinect)
        {
            VideoSurveillanceTarget target = null;

            if (tempTargetStorage.ContainsKey(contour.ID))
            {
                target           = tempTargetStorage[contour.ID];
                target.TimeStamp = DateTime.Now;
                target.Update(contour, currentPanKinect, currentTiltKinect);
            }
            else
            {
                target = new VideoSurveillanceTarget(this, contour.ID, contour, currentPanKinect, currentTiltKinect);
                if (target.Rank > 1.0d)
                {
                    tempTargetStorage.Add(contour.ID, target);
                }
                else
                {
                    target = null;
                }
            }

            return(target);
        }
Exemple #2
0
        public void Update(ContourContainer contour, double currentPanKinect, double currentTiltKinect)
        {
            ID = contour.ID;

            Contour <System.Drawing.Point> contours = contour.contour;

            BoundingRectangle = contours.BoundingRectangle;

            int centerX = BoundingRectangle.X + BoundingRectangle.Width / 2;
            int centerY = BoundingRectangle.Y + BoundingRectangle.Height / 2;

            this.Center = new System.Drawing.Point(centerX, centerY);

            this.Pan  = -FowW * (centerX - imgWidth / 2.0d) / imgWidth + currentPanKinect;
            this.Tilt = -FowH * (centerY - imgHeight / 2.0d) / imgHeight + currentTiltKinect;

            CalculateRank();

            //Console.WriteLine("**********************************************************************    Pan=" + Pan + "   Tilt=" + Tilt);
        }
Exemple #3
0
 public VideoSurveillanceTarget(VideoSurveillanceDecider decider, int id, ContourContainer contour, double currentPanKinect, double currentTiltKinect)
     : this(decider, id, VideoTargetType.ColorBlob)
 {
     Update(contour, currentPanKinect, currentTiltKinect);
 }