Capturing image from webcam in java?

Here is a similar question with some - yet unaccepted - answers. One of them mentions FMJ as a java alternative to JMF.

I have used JMF on a videoconference application and it worked well on two laptops: one with integrated webcam and another with an old USB webcam. It requires JMF being installed and configured before-hand, but once you're done you can access the hardware via Java code fairly easily.

JMyron is very simple for use. webcamxtra.sourceforge.net/ myron = new JMyron(); myron. Start(imgw, imgh); myron.update(); int img = myron.image().

You can try Marvin Framework. It provides an interface to work with cameras. Moreover, it also provides a set of real-time video processing features, like object tracking and filtering.

Take a look! Marvin Framework: marvinproject.org Real-time Video Processing Demo: youtube.com/watch?v=D5mBt0kRYvk.

I believe the web-cam application software which comes along with the web-cam, or you native windows webcam software can be run in a batch script(windows/dos script) after turning the web cam on(i.e. If it needs an external power supply). In the bacth script , you can add appropriate delay to capture after certain time period.

And keep executing the capture command in loop. I guess this should be possible -AD.

Java usually doesn't like accessing hardware, so you will need a driver program of some sort, as goldenmean said. I've done this on my laptop by finding a command line program that snaps a picture. Then it's the same as goldenmean explained; you run the command line program from your java program in the takepicture() routine, and the rest of your code runs the same.

Except for the part about reading pixel values into an array, you might be better served by saving the file to BMP, which is nearly that format already, then using the standard java image libraries on it. Using a command line program adds a dependency to your program and makes it less portable, but so was the webcam, right?

There's a pretty nice interface for this in processing, which is kind of a pidgin java designed for graphics. It gets used in some image recognition work, such as that link. Depending on what you need out of it, you might be able to load the video library that's used there in java, or if you're just playing around with it you might be able to get by using processing itself.

FMJ can do this, as can the supporting library it uses, LTI-CIVIL. Both are on sourceforge.

Recommand using FMJ for multimedia relatived java app.

grack.com/downloads/school/enel619.10/re... Using the Player with Swing The Player can be easily used in a Swing application as well. The following code creates a Swing-based TV capture program with the video output displayed in the entire window: import javax.media. *; import javax.swing.

*; import java.awt. *; import java.net. *; import java.awt.event.

*; import javax.swing.event. *; public class JMFTest extends JFrame { Player _player; JMFTest() { addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent e ) { _player.stop(); _player.deallocate(); _player.close(); System. Exit( 0 ); } }); setExtent( 0, 0, 320, 260 ); JPanel panel = (JPanel)getContentPane(); panel.

SetLayout( new BorderLayout() ); String mediaFile = "vfw://1"; try { MediaLocator mlr = new MediaLocator( mediaFile ); _player = Manager. CreateRealizedPlayer( mlr ); if (_player. GetVisualComponent()!

= null) panel. Add("Center", _player. GetVisualComponent()); if (_player.

GetControlPanelComponent()! = null) panel. Add("South", _player.

GetControlPanelComponent()); } catch (Exception e) { System.err. Println( "Got exception " + e ); } } public static void main(String args) { JMFTest jmfTest = new JMFTest(); jmfTest.show(); } }.

Please reformat your answer... use the code markup button. – Trevor Harrison Oct 5 '09 at 14:00.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions