Page 1 of 1

The motion and stream image at the same time

PostPosted: Sat Dec 22, 2018 4:01 am
by phiphophe
how to execute "image stream" and motion at the same time. I received this error "Bitmap region is already locked". Image has been locked to excute motion so nothing provided for picturebox at that time. Please somebody can talk for me that what should i do?. any ideas are welcome.
Code: Select all
private void video_NewFrame(object sender,NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
            pictureBox1.Image = bitmap;
            motion.ProcessFrame(bitmap);
        }

Re: The motion and stream image at the same time

PostPosted: Sat Dec 22, 2018 7:55 am
by andrew.kirillov
First do motion processing. Then give it to picture box. Not the other way around. When image is given to picture box, it will be already locked.

Or, if you want to do it your way, then you will need to make another clone.

Re: The motion and stream image at the same time

PostPosted: Mon Dec 24, 2018 4:55 am
by phiphophe
andrew.kirillov wrote:First do motion processing. Then give it to picture box. Not the other way around. When image is given to picture box, it will be already locked.

Or, if you want to do it your way, then you will need to make another clone.

thank you very much, sir.