Esempio n. 1
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();
            }
        }
Esempio n. 2
0
        public override bool IsCastable()
        {
            if (!UseCastableDetection())
            {
                return(false);
            }

            Vec3b currentColor = CasteableDetection.At <Vec3b>(0, 0);

            foreach (Vec3b testColor in CastableDetectionColors)
            {
                if (currentColor[0] == testColor[0] &&
                    currentColor[1] == testColor[1] &&
                    currentColor[2] == testColor[2])
                {
                    return(true);
                }
            }

            return(false);
        }