AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Video source white screen

The forum is to discuss topics related to different areas of image processing and computer vision.

Video source white screen

Postby snbc2017 » Tue Sep 19, 2017 10:10 am

Hi,

I'm using aforge.net in simple application, with my laptop webcam acting as video source.
However, I have noticed that my pictureBox object which serves as target for my video source gets white or with two diagonal crossed lines after some time working.

Did anyone encounter such a problem?
snbc2017
 
Posts: 11
Joined: Tue Sep 19, 2017 10:05 am

Re: Video source white screen

Postby andrew.kirillov » Tue Sep 19, 2017 10:21 am

Hello,

White picture box with red diagonals means exception. Try debugging to see where it is thrown from and what it says.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Video source white screen

Postby snbc2017 » Tue Sep 19, 2017 10:31 am

I have put exception in the method accepting new frame

try
{
Bitmap video = (Bitmap)eventArgs.Frame.Clone();
pictureBox1.Image = video;
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}
catch (Exception s)
{
MessageBox.Show(s.ToString());
}

my catch is not activated, yet screen becomes white.
I have noticed that this happens after approx 10 mins, could this be linked with licence?
snbc2017
 
Posts: 11
Joined: Tue Sep 19, 2017 10:05 am

Re: Video source white screen

Postby andrew.kirillov » Tue Sep 19, 2017 11:35 am

snbc2017 wrote: could this be linked with licence?

No, there are no licensing limitations, which would cause an exception.

If you say it happens after about 10 minutes, it can be caused by a memory leak. Yes, GC should collect garbage. But if the code creates it quicker than GC takes care of it, then it may cause issues.

Having a look a the code you've provided, I can see there is a memory leak. You clone images, set them to picture box, but you never dispose old images.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to Image Processing and Computer Vision

cron