CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #3
    Join Date
    Feb 2009
    Posts
    112

    Re: Increase picture quality

    Quote Originally Posted by elrabin View Post
    Likely:

    1. The native resolution of the camera is higher.
    Consumers recognize things like "1080p," so it isn't uncommon for manufacturers to use only part of the image to make the video output a format customers expect. The benefit here is you can stream this to a TV. The downside is you are losing part of the frame.

    CCD sensors aren't even made in a 1080p format. The closest size I can find is 2012x1324 (~2.7mp)

    2. The software is using superresolution from multiple frames
    2012x1324 *4 = ~10mp.

    You can find algorithms (and maybe even code) to perform this step on the internet. The main thing here is it requires multiple frames and may take a second or two to compute, so that's why it is useful for still shots and not video.
    That is some interesting stuff. I actually found a different project that works a little better, and I think that may help me out. The project I found is called dxSnap, and it is a sample from the DirectShow.NET Library (http://sourceforge.net/projects/directshownet/files/) that works with my webcam, and it allows me to take 2592x1944 images. so that might be enough to make this project work. We'll see, if not I'll probably be looking for some help with superresolution. Anyway I'm now running into the issue where I take the picture and it creates the bitmap no problem, but when I go to save it as a file, it throws a generic GDI+ error. I have no idea what is causing this. I've saved bitmaps many-a-time and never did this. Here is the code I use:

    Code:
                Cursor.Current = Cursors.WaitCursor;
    
                // Release any previous buffer
                if (m_ip != IntPtr.Zero)
                {
                    Marshal.FreeCoTaskMem(m_ip);
                    m_ip = IntPtr.Zero;
                }
    
                // capture image
                m_ip = cam.Click();
                Bitmap b = new Bitmap(cam.Width, cam.Height, cam.Stride, PixelFormat.Format24bppRgb, m_ip);
                b.Save("c:\\test.png", ImageFormat.Png); //<--This is where is bombs out
                
                // If the image is upsidedown
                b.RotateFlip(RotateFlipType.RotateNoneFlipY);
                pictureBox1.Image = b;
    
                Cursor.Current = Cursors.Default;
    **UPDATE**
    Nevermind I figured out what was wrong, I guess saving it to the root of the C drive was making the application unhappy. Once I changed the location to the Desktop it worked wonderfully.
    Last edited by vandel212; August 25th, 2011 at 08:33 PM.
    - It's a long way to the top if you want to rock n' roll - AC/DC

    Check out my band and support the music:
    www.blueruinmusic.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured