Beispiel #1
0
        private void Compare()
        {
            outputMessage.Text = "";

            //FileLoc overload
            //bool verdict = MovementDetection.CheckForMovement(@"C:\Users\Brian\Desktop\Movement Examples\0709_09_MOVEMENT_EXAMPLE.jpg");

            //Bitmap overload
            //bool verdict = MovementDetection.CheckForMovement(largeImage);

            //Aurigma overload
            Aurigma.GraphicsMill.Bitmap aurigmaBitmap = new Aurigma.GraphicsMill.Bitmap(analyzeBitmap);
            bool verdict = MovementDetection.CheckForMovement(aurigmaBitmap);

            AnnounceVerdict(verdict);
        }
Beispiel #2
0
        private void folderLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string message = "";

            FolderBrowserDialog folderDialog = new FolderBrowserDialog();
            DialogResult        result       = folderDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                List <string> badFiles = MovementDetection.CheckFolderForMovement(folderDialog.SelectedPath);

                message = "Movement found in\n";
                foreach (var badFile in badFiles)
                {
                    message += badFile + "\n";
                }

                MessageBox.Show(message);
            }
        }
Beispiel #3
0
        private void LinkLarge_Clicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            outputMessage.Text = "";

            //Get a file
            fileDialog.FileName = "";
            fileDialog.Title    = "Select main image";
            fileDialog.Filter   = "All images|*.jpg; *.bmp; *.png";
            fileDialog.ShowDialog();
            if (fileDialog.FileName.ToString() != "")
            {
                largeFileName       = fileDialog.FileName.ToString();
                largeLabel.Text     = largeFileName;
                largePicBox.Image   = System.Drawing.Image.FromFile(largeFileName);
                largePicBox.Visible = true;
            }

            //Get an area of interest
            Aurigma.GraphicsMill.Bitmap wholeBitmap = new Aurigma.GraphicsMill.Bitmap(largeFileName);
            testPicBox.Image = (System.Drawing.Image)wholeBitmap;
            Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(MovementDetection.FindAreaOfInterest(wholeBitmap));

            //Process area of interest bitmap into B&W we can analyze
            Aurigma.GraphicsMill.Bitmap processedBitmap = MovementDetection.GreyscaleAndThreshold(bitmap);

            //Have to turn it back into 24-bit or the pattern matching won't work
            processedBitmap.ColorManagement.Convert(Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);


            //Store it in global
            analyzeBitmap = new Aurigma.GraphicsMill.Bitmap(processedBitmap);

            //Update GUI image
            largePicBox.Image = (System.Drawing.Image)processedBitmap;

            Compare();
        }