Example #1
0
        private Vec3b getColorByTick(int offset)
        {
            Point curPoint = getCoordsByTick(offset);

            // TODO: if y , x is out of range...
            Vec3b color = FilteredMat.At <Vec3b>(curPoint.Y, curPoint.X);

            return(color);
        }
Example #2
0
        public override void DoFrameAction()
        {
            ActionBase = FilteredMat.Clone();
            Cv2.Rectangle(ActionBase, new Rect(CurrentColorCoord.X - 1, CurrentColorCoord.Y - 1, 3, 3), new Scalar(0, 255, 0), 1);

            if (UseCastableDetection())
            {
                Info1 = this.IsCastable() ? "IS CASTABLE" : "";
                Vec3b color = CasteableDetection.At <Vec3b>(0, 0);
                Info2 = color[0].ToString() + ", " + color[1].ToString() + ", " + color[2].ToString();
            }
        }
Example #3
0
 public void DoAfterFrameAction()
 {
     if (CaptureSource != null)
     {
         CaptureSourceBS = CaptureSource.ToBitmapSource();
         CaptureSourceBS.Freeze();
     }
     if (FilteredMat != null)
     {
         FilteredMatBS = FilteredMat.ToBitmapSource();
         FilteredMatBS.Freeze();
     }
     if (ActionBase != null)
     {
         ActionBaseBS = ActionBase.ToBitmapSource();
         ActionBaseBS.Freeze();
     }
     if (this.UseCastableDetection())
     {
         CasteableDetectionBS = CasteableDetection.ToBitmapSource();
         CasteableDetectionBS.Freeze();
     }
 }
Example #4
0
        public override List <LedResults.Color> getCurrentColors(List <string> LedIdNames)
        {
            List <LedResults.Color> colors = new List <LedResults.Color>();

            if (FilteredMat.Width >= LedIdNames.Count)
            {
                for (int i = 0; i < LedIdNames.Count; i++)
                {
                    int LedPercent = (int)((float)100 / (float)LedIdNames.Count * (float)i);

                    if (LedPercent < barPercent)
                    {
                        Vec3b Vec3bColor = FilteredMat.At <Vec3b>(0, i);
                        colors.Add(new LedResults.Color(Vec3bColor[2], Vec3bColor[1], Vec3bColor[0]));
                    }
                    else
                    {
                        colors.Add(new LedResults.Color(0, 0, 0));
                    }
                }
            }

            return(colors);
        }
Example #5
0
 public override void DoFrameAction()
 {
     ActionBase = FilteredMat.Clone();
     this.determinePercentage();
     Info1 = barPercent.ToString();
 }