Search code examples
javaphotofmj

Is it possible to capture high res web cam images in java?


I am trying to take photos with my web cam, and I'm having some difficulty trying to find a solution in java.

I've successfully set up FMJ and have my streaming video, but I want to take a photo, not video frame-grab. My web cam says it's 1.3MP, and 640 x 480 is a whopping 0.3MP!

So to clarify - I want to:

  1. Stream video to my display from my web cam (so I can see what I'm doing)
  2. When I press enter
    1. Stop capturing video
    2. Take full resolution photo (an image; not part of a low-res stream)
    3. Return to step 1 (streaming video to display)

Solution

  • Picture Transfer Protocol is the way to go for high res. (I don't yet know what preview functionality is provided; perhaps JMF is used there...?)

    If your web cam driver is good/recent (mine isn't), then you'll be able to see it in Window's "Scanners and Cameras" view. These devices are available under WIA (Windows Image Acquisition) technology. (I'm intending to use Jacob to talk to the windows libs).

    For linuxes, there's a linking ptp page over at sourceforge. Note that it indicates that jphoto is obselete, but cameraptp over at google code extends it as recently as Feb 2011.