Code covered by the BSD License  

Highlights from
Simple Video Camera Frame Grabber Toolkit

4.0

4.0 | 1 rating Rate this file 52 Downloads (last 30 days) File Size: 81.4 KB File ID: #35554
image thumbnail

Simple Video Camera Frame Grabber Toolkit

by

 

A toolkit for capturing still frames from Firewire or USB video cameras

| Watch this File

File Information
Description

(Version 0.8)

The FrameGrabM toolkit provides a quick way to grab still frames from a live video source, such as a FireWire video camera or a USB webcam. Individual video frames are returned to MATLAB as a matrix of RGB values. The toolkit uses LTI-CIVIL, a Java-based library instigated by Ken Larson for capturing images (see http://lti-civil.org/). Please refer to the README file for instructions on how to download and install LTI-CIVIL.

Key features of FrameGrabM:
- Targeted for Windows, Mac OS X, and Linux x86 and x64
- No need for MATLAB Image Acquisition Toolbox
- Simultaneous capture from multiple video devices

It's easy! Here is an example MATLAB script for capturing a video frame from the default capture device:

    fgrabm_start % Initialize the framework and start capture
    pause(2) % Wait for the capture device to warm up
    pixels = fgrabm_grab(); % Grab the most recent frame and return data
    image(pixels) % Display the pixels
    fgrabm_shutdown % Uninitialize the capture framework

Please look at the README file for details on installation, as MATLAB's Java library path in its librarypath.txt and classpath.txt files must be configured to refer to included LTI-Civil native library files. Depending upon how MATLAB was installed, you may need administrative/root privileges to successfully perform these changes. README also contains special information pertaining to the Mac OS X platform.

Note that this is a preliminary release and I welcome feedback that can help lead to a final version. See README for more details.

Required Products MATLAB
MATLAB release MATLAB 7 (R14)
Other requirements See the README file for additional information.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
12 May 2014 imran

Hello,

I am working on a project which consist to controlling two FireWire camera simultaneously, I tried to install your frame grabber kit but when I installed I have got an error message :

Unrecognized token, etc..

How do I install this kit for Matlab 64bit version ?

Kind regards

28 Mar 2014 Kenneth Perrine

Thomas, supposedly the underlying LTI-Civil library can capture from two cameras simultaneously. And I had seen it work! But, I have had experiences, too, where the computer freezes up when I capture two simultaneous images. The problem seems to worsen when the images being captured are higher resolution or the frame rate is higher. I suggest trying the following: 1. A faster computer; 2. Separate USB buses (e.g. install a separate USB controller and put one camera on that); 3. FireWire cameras instead of USB cameras; 4. Decreasing the resolution and/or the frame rate. I would like to know if any of these options work for you. Longer-term, I have had better experience with the OpenCV library and am considering updating the software to use that instead of LTI-Civil. Maybe that will help with the 64-bit Mac problems too?

28 Mar 2014 Kenneth Perrine

Zizhou and Brian, I have had troubles getting LTI-Civil to work with QuickTime video capture in 64-bit Mac/OS. I don't know if it is possible for the current system to actually work. Sorry I can't be of further help.

13 Mar 2014 Thomas

Hello. I am currently working on a project with stereovision on my university.
I have successfully downloaded and installed this toolkit you have made.
My question is, how is it possible for me to get a stereoscopic picture with this toolkit?
When "fgrabm_test" is called, I recive a picture from my integrated webcam(camera1), I can also change the default to USB webcam1(camera2) or USB webcam2(camera3) and get pictures from them,but only one bye one.
When I run the "sample_twocams" it starts running and Matlab is "busy" but Matlab runs forever and nothing will work and eventually Matlab is not responding to anything so I have to manually shut down Matlab.

For my project I need one picture from camera2 and camera3 taken
simultaneously, so I then can load the pictures to another Matlab script I have and do some tests.

Really hope you guys can be able to help me with this, much appreciated.

Best regards
Thomas

04 Dec 2013 Zizhou

I got the following error when I run fgarbm_start

environment: maxos 64, matlab 2013b

>> fgrabm_start
java.lang.NoClassDefFoundError: Could not initialize class quicktime.QTSession
at quicktime.QTRuntimeException.toString(QTRuntimeException.java:110)
at java.lang.String.valueOf(String.java:2854)
at java.lang.StringBuilder.append(StringBuilder.java:128)
at java.lang.Throwable.printEnclosedStackTrace(Throwable.java:694)
at java.lang.Throwable.printStackTrace(Throwable.java:666)
at java.lang.Throwable.printStackTrace(Throwable.java:720)
at com.mathworks.jmi.OpaqueJavaInterface.getExceptionMessage(OpaqueJavaInterface.java:1314)
Error using com.academiken.framegrabm.util.GrabCore/init
Failed to retrieve Exception Message

Error in fgrabm_init (line 35)
FGRABM.class.init()

Error in fgrabm_start (line 14)
fgrabm_init

03 Jun 2013 Brian

I also tried changing to 32bits as you mention in the readme but then I am unable to startup matlab.

03 Jun 2013 Brian

First thank you for writing the code.
I just want to say I tried using it on Mac Osx (10.8.3) w/matlab 2013a and this is the error I get. It seems to have a problem with the native library however I am sure I followed the installation procedures correctly.

java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1122)
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1099)
at quicktime.QTSession.<clinit>(QTSession.java:94)
at com.lti.civil.impl.qtjava.QTCaptureSystem.init(QTCaptureSystem.java:35)
at com.academiken.framegrabm.util.GrabCore.init(GrabCore.java:140)
Caused by: java.lang.UnsatisfiedLinkError: /System/Library/Java/Extensions/libQTJNative.jnilib: no suitable image found. Did find: /System/Library/Java/Extensions/libQTJNative.jnilib: mach-o, but wrong architecture
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1716)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at quicktime.QTSession$1.run(QTSession.java:96)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:669)
at java.awt.EventQueue$2.run(EventQueue.java:667)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:678)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Error using fgrabm_init (line 35)
Java exception occurred:
java.lang.UnsatisfiedLinkError: quicktime.QTSession.Gestalt(I[I)S
at quicktime.QTSession.Gestalt(Native Method)
at quicktime.QTSession.gestalt(QTSession.java:935)
at quicktime.QTSession.open(QTSession.java:641)
at quicktime.QTSession.open(QTSession.java:608)
at
com.lti.civil.impl.qtjava.QTCaptureSystem.init(QTCaptureSystem.java:35)
at
com.academiken.framegrabm.util.GrabCore.init(GrabCore.java:140)

Error in fgrabm_test (line 12)
fgrabm_init

Contact us