AForge.NET

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

Gray image from camera

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Gray image from camera

Postby piter » Sun Feb 22, 2009 8:17 pm

Hi all / Andrew,

I have a problem with getting frame from new frame event.

Without any combinations i do:

Code: Select all
private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            // get new frame
            //Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();

            // set it in pictureBox
            pictureBox1.Image = bitmap
        }


And i dont know why image is grayscaled...?
I tired with some casts and changing formats but nothing works.

What should I do to have colorful image?

Regards
piter
 
Posts: 3
Joined: Sun Feb 22, 2009 8:05 pm

Re: Gray image from camera

Postby andrew.kirillov » Sun Feb 22, 2009 8:26 pm

Hello,

Well, it really depends on camera and its settings. Which camera do you have?

For example, some time ago I was working with some Axis cameras and video servers. It was possible to configure video server/camera to provide grayscale image always - the camera was making conversion on its side and giving to client already grayscale image.

Try to check setting of your camera.
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: Gray image from camera

Postby piter » Sun Feb 22, 2009 8:35 pm

Thank for fast reply :)

I have a simple built-in lcd camera. With your motion-detection sample it works fine.

But thanks for remark with camera settings - now i see there is a problem.
Evidently something switched there.

Best regards!
piter
 
Posts: 3
Joined: Sun Feb 22, 2009 8:05 pm




Return to AForge.NET Framework