Esempio n. 1
0
        public QrRecognitionControl()
        {
            InitializeComponent();

            camDevices = new CameraDevices();

            decodingThread = new Thread(DecodeBarcode);

            // pictureBox1.Paint += pictureBox1_Paint;
            resultRectPen = new Pen(Color.Green, 10);


            motionDetector = GetDefaultMotionDetector();
        }
Esempio n. 2
0
        public static AForge.Vision.Motion.MotionDetector GetDefaultMotionDetector()
        {
            AForge.Vision.Motion.IMotionDetector   detector       = null;
            AForge.Vision.Motion.IMotionProcessing processor      = null;
            AForge.Vision.Motion.MotionDetector    motionDetector = null;

            //detector = new AForge.Vision.Motion.TwoFramesDifferenceDetector()
            //{

            //    DifferenceThreshold = 1,
            //    SuppressNoise = true
            //};

            //detector = new AForge.Vision.Motion.CustomFrameDifferenceDetector()
            //{
            //    DifferenceThreshold = 255,
            //    KeepObjectsEdges = true,
            //    SuppressNoise = true
            //};

            detector = new AForge.Vision.Motion.SimpleBackgroundModelingDetector()
            {
                DifferenceThreshold             = 5,
                FramesPerBackgroundUpdate       = 1,
                KeepObjectsEdges                = false,
                MillisecondsPerBackgroundUpdate = 1,
                SuppressNoise = false
            };

            //processor = new AForge.Vision.Motion.GridMotionAreaProcessing()
            //{
            //    HighlightColor = System.Drawing.Color.Red,
            //    HighlightMotionGrid = true,
            //    GridWidth = 1,
            //    GridHeight = 1,
            //    MotionAmountToHighlight = 10f
            //};

            processor = new AForge.Vision.Motion.BlobCountingObjectsProcessing()
            {
                HighlightColor         = System.Drawing.Color.Red,
                HighlightMotionRegions = true,
                MinObjectsHeight       = 3,
                MinObjectsWidth        = 3,
            };

            motionDetector = new AForge.Vision.Motion.MotionDetector(detector, processor);

            return(motionDetector);
        }
Esempio n. 3
0
        public QrRecognitionControl()
        {
            InitializeComponent();

            // test
            // throw new Exception("test exception");

            camDevices = new CameraDevices();

            decodingThread = new Thread(DecodeBarcode);
            // pictureBox1.Paint += pictureBox1_Paint;
            resultRectPen = new Pen(Color.Green, 10);

            motionDetector = GetDefaultMotionDetector();
        }
Esempio n. 4
0
        // Play around with this function to tweak results.
        public static AForge.Vision.Motion.MotionDetector GetDefaultMotionDetector()
        {
            AForge.Vision.Motion.IMotionDetector   detector       = null;
            AForge.Vision.Motion.IMotionProcessing processor      = null;
            AForge.Vision.Motion.MotionDetector    motionDetector = null;

            detector = new AForge.Vision.Motion.TwoFramesDifferenceDetector()
            {
                DifferenceThreshold = 15,
                SuppressNoise       = true
            };

            //detector = new AForge.Vision.Motion.CustomFrameDifferenceDetector()
            //{
            //  DifferenceThreshold = 15,
            //  KeepObjectsEdges = true,
            //  SuppressNoise = true
            //};

            //processor = new AForge.Vision.Motion.GridMotionAreaProcessing()
            //{
            //  HighlightColor = System.Drawing.Color.Red,
            //  HighlightMotionGrid = true,
            //  GridWidth = 100,
            //  GridHeight = 100,
            //  MotionAmountToHighlight = 100F
            //};

            /*
             * processor = new AForge.Vision.Motion.MotionAreaHighlighting()
             * {
             *  HighlightColor = System.Drawing.Color.Red,
             * };
             * */

            motionDetector = new AForge.Vision.Motion.MotionDetector(detector);

            return(motionDetector);
        }
Esempio n. 5
0
        // Play around with this function to tweak results.
        public static AForge.Vision.Motion.MotionDetector GetDefaultMotionDetector()
        {
            AForge.Vision.Motion.IMotionDetector detector = null;
            AForge.Vision.Motion.IMotionProcessing processor = null;
            AForge.Vision.Motion.MotionDetector motionDetector = null;

            //detector = new AForge.Vision.Motion.TwoFramesDifferenceDetector()
            //{
            //  DifferenceThreshold = 15,
            //  SuppressNoise = true
            //};

            //detector = new AForge.Vision.Motion.CustomFrameDifferenceDetector()
            //{
            //  DifferenceThreshold = 15,
            //  KeepObjectsEdges = true,
            //  SuppressNoise = true
            //};

            detector = new AForge.Vision.Motion.SimpleBackgroundModelingDetector()
            {
                DifferenceThreshold = 10,
                FramesPerBackgroundUpdate = 10,
                KeepObjectsEdges = true,
                MillisecondsPerBackgroundUpdate = 0,
                SuppressNoise = true
            };

            //processor = new AForge.Vision.Motion.GridMotionAreaProcessing()
            //{
            //  HighlightColor = System.Drawing.Color.Red,
            //  HighlightMotionGrid = true,
            //  GridWidth = 100,
            //  GridHeight = 100,
            //  MotionAmountToHighlight = 100F
            //};

            processor = new AForge.Vision.Motion.BlobCountingObjectsProcessing()
            {
                HighlightColor = System.Drawing.Color.Red,
                HighlightMotionRegions = true,
                MinObjectsHeight = 10,
                MinObjectsWidth = 10
            };

            motionDetector = new AForge.Vision.Motion.MotionDetector(detector, processor);

            return (motionDetector);
        }
Esempio n. 6
0
        // Play around with this function to tweak results.
        public static AForge.Vision.Motion.MotionDetector GetDefaultMotionDetector()
        {
            AForge.Vision.Motion.IMotionDetector detector = null;
            AForge.Vision.Motion.IMotionProcessing processor = null;
            AForge.Vision.Motion.MotionDetector motionDetector = null;

            detector = new AForge.Vision.Motion.TwoFramesDifferenceDetector()
            {
              DifferenceThreshold = 15,
              SuppressNoise = true
            };

            //detector = new AForge.Vision.Motion.CustomFrameDifferenceDetector()
            //{
            //  DifferenceThreshold = 15,
            //  KeepObjectsEdges = true,
            //  SuppressNoise = true
            //};

            //processor = new AForge.Vision.Motion.GridMotionAreaProcessing()
            //{
            //  HighlightColor = System.Drawing.Color.Red,
            //  HighlightMotionGrid = true,
            //  GridWidth = 100,
            //  GridHeight = 100,
            //  MotionAmountToHighlight = 100F
            //};

            /*
            processor = new AForge.Vision.Motion.MotionAreaHighlighting()
            {
                HighlightColor = System.Drawing.Color.Red,
            };
             * */

            motionDetector = new AForge.Vision.Motion.MotionDetector(detector);

            return (motionDetector);
        }