예제 #1
0
        // ugh this function is blocking right now
        void detectCallback(imgDataArray detections)
        {
            foreach (imgData box in detections.rockData)
            {
                System.Windows.Point tl = new System.Windows.Point(box.x, box.y);
                DateTime             dt = DateTime.Now;
                // if it's on this helper's camera, add it to the list of boxes on screen, and draw the box on the correct window

                /* if (box.cameraID == cameraNumber) // && cameraNumber is selected as Primary
                 * {*/
                primary.Dispatcher.Invoke(new Action(() =>
                {
                    if (!boxesOnScreen.ContainsKey(dt))
                    {
                        boxesOnScreen.Add(dt, primary.DrawABox(tl, box.width, box.height, 864, 480, box.color));
                    }
                }));
                secondary.Dispatcher.Invoke(new Action(() =>
                {
                    if (!boxesOnScreen.ContainsKey(dt))
                    {
                        boxesOnScreen.Add(dt, secondary.DrawABox(tl, box.width, box.height, 864, 480, box.color));
                    }
                }));

                /*}
                 * else
                 * {
                 *  Console.WriteLine("OFFSCREEN DETECTION ON CAMERA " + cameraNumber);
                 * }*/
            }
        }
예제 #2
0
 // ugh this function is blocking right now
 void detectCallback(imgDataArray detections)
 {
     foreach (imgData box in detections.rockData)
     {
         System.Windows.Point tl = new System.Windows.Point(box.x, box.y);
         DateTime dt = DateTime.Now;
         // if it's on this helper's camera, add it to the list of boxes on screen, and draw the box on the correct window
         /* if (box.cameraID == cameraNumber) // && cameraNumber is selected as Primary
          {*/
         primary.Dispatcher.Invoke(new Action(() =>
         {
             if (!boxesOnScreen.ContainsKey(dt))
                 boxesOnScreen.Add(dt, primary.DrawABox(tl, box.width, box.height, 864, 480, box.color));
         }));
         secondary.Dispatcher.Invoke(new Action(() =>
         {
             if (!boxesOnScreen.ContainsKey(dt))
                 boxesOnScreen.Add(dt, secondary.DrawABox(tl, box.width, box.height, 864, 480, box.color));
         }));
         /*}
         else
         {
             Console.WriteLine("OFFSCREEN DETECTION ON CAMERA " + cameraNumber);
         }*/
     }
 }