Beispiel #1
0
        public int sampleLessThan(byte[] array)
        {
            RGBVal sample = ColorSampler.Sample3Channels(array, VideoCaptureManager.Instance.ImageWidth, VideoCaptureManager.Instance.ImageHeight);

            this.ColorAverage = sample;
            if (sample.R < ColorThresh.R && sample.G < ColorThresh.G && sample.B < ColorThresh.B)
            {
                return(1);
            }

            return(0);
        }
Beispiel #2
0
        public int sampleGreaterThan(byte[] array)
        {
            RGBVal sample = ColorSampler.Sample3Channels(array, VideoCaptureManager.Instance.ImageWidth, VideoCaptureManager.Instance.ImageHeight);

            this.ColorAverage = sample;
            if (sample.R > ColorThresh.R && sample.G > ColorThresh.G && sample.B > ColorThresh.B)
            {
                VideoCaptureManager.Instance.RemoveCallback(sampleGreaterThan);
                return(1);
            }

            return(0);
        }