tags:

views:

57

answers:

0

I am using the following method to try and detect motion using AForge. Soon as I click the button the program freezes :S

        private void button2_Click(object sender, EventArgs e)
    {
        if (motionDetectionOn == false) {
            motionDetectionOn = true;
            Console.WriteLine("ON");
        }
        else{
            motionDetectionOn = false;
            Console.WriteLine("OFF");
        }
        while (motionDetectionOn)
        {

            if (md.ProcessFrame(im) > 0.02)
            {
                Console.WriteLine("weeee");
            }
        }
    }