Esempio n. 1
0
 public override void Show(object value)
 {
     centroidData = (CentroidData)value;
     if (centroidData != null)
     {
         if (imageViewer.SelectedImageViewer == nameof(centroidData.BackgroundSubtractedImage) && centroidData.BackgroundSubtractedImage != null)
         {
             imageViewer.Update(centroidData.BackgroundSubtractedImage);
         }
         else if (imageViewer.SelectedImageViewer == nameof(centroidData.ThresholdImage) && centroidData.ThresholdImage != null)
         {
             imageViewer.Update(centroidData.ThresholdImage);
         }
         else if (imageViewer.SelectedImageViewer == nameof(centroidData.LargestContour) && centroidData.ThresholdImage != null)
         {
             IplImage contourImage = new IplImage(centroidData.ThresholdImage.Size, centroidData.ThresholdImage.Depth, 3);
             contourImage.SetZero();
             if (centroidData.LargestContour != null)
             {
                 CV.DrawContours(contourImage, centroidData.LargestContour.Contour, Scalar.All(255), Scalar.All(0), 0, -1);
                 CV.DrawContours(contourImage, centroidData.LargestContour.Contour, new Scalar(0, 0, 255), Scalar.All(0), 0, 1 * VisualizerCanvas.Height / 640);
             }
             imageViewer.Update(contourImage);
         }
         else
         {
             if (imageViewer.SelectedImageIndex != 0)
             {
                 imageViewer.SelectImageIndex(0);
             }
             imageViewer.Update(centroidData.Image);
         }
     }
 }
 public override void Show(object value)
 {
     multiAnimalTrackingData = (MultiAnimalTrackingData)value;
     if (imageViewer.SelectedImageViewer == nameof(multiAnimalTrackingData.BackgroundSubtractedImage) && multiAnimalTrackingData.BackgroundSubtractedImage != null)
     {
         imageViewer.Update(multiAnimalTrackingData.BackgroundSubtractedImage);
     }
     else if (imageViewer.SelectedImageViewer == nameof(multiAnimalTrackingData.ThresholdImage) && multiAnimalTrackingData.ThresholdImage != null)
     {
         imageViewer.Update(multiAnimalTrackingData.ThresholdImage);
     }
     else
     {
         if (multiAnimalTrackingData.Image != null)
         {
             imageViewer.Update(multiAnimalTrackingData.Image);
         }
     }
 }
Esempio n. 3
0
 public override void Show(object value)
 {
     backgroundSubtractionData = (BackgroundSubtractionData)value;
     if (backgroundSubtractionData != null)
     {
         if (imageViewer.SelectedImageViewer == nameof(backgroundSubtractionData.BackgroundSubtractedImage) && backgroundSubtractionData.BackgroundSubtractedImage != null)
         {
             imageViewer.Update(backgroundSubtractionData.BackgroundSubtractedImage);
         }
         else if (imageViewer.SelectedImageViewer == nameof(backgroundSubtractionData.Background) && backgroundSubtractionData.Background != null)
         {
             imageViewer.Update(backgroundSubtractionData.Background);
         }
         else
         {
             if (backgroundSubtractionData.Image != null)
             {
                 imageViewer.Update(backgroundSubtractionData.Image);
             }
         }
     }
 }