webcamproducer.jar

Description
provides a Producer service that polls images captured from a WebCam (by using JMF).
For simplicity, a simple service to grab a image from the webcam without dealing with the Wire Admin complexity
For more details on how to use this bundle, refer to the /doc/readme.html file embedded in the bundle jarfile.

Contributors
Didier Donsez (Didier.Donsez@ieee.org)

License
Library GNU Public License

Services
org.osgi.service.wireadmin.Producer
fr.imag.adele.bundle.webcamproducer.ImageGrabber (this service is suceptible to disappear in the future versions !)

Properties

  • wireadmin.producer.flavors=Class[] { java.awt.Image.class })
  • service.pid=fr.imag.adele.osgi.util.webcam
  • service.description=grabs a java.awt.Image from a WebCam
  • Requirements

  • org.osgi.service.wireadmin; specification-version="1.0"
  • Embeds the JMF


    Download

    Build

    1. You should put also the jmf.jar (version 2.1.1 and up) in the ./embeddedlibs
    2. configure the build properties in project.properties and in common.properties
    3. configure the camera properties in ./res/config.properties or directly /config.properties (in the bundle jarfile)
    4. then build with ant

    config.properties setting
    You must set the device-name property with the right name (and a supported resolution)
    example: vfw:Logitech USB Video Camera:0, vfw:Microsoft WDM Image Capture (Win32):0)
    The right device name for your WebCam can be found by installing JMF (http://java.sun.com/products/java-media/jmf/) for your operation system and launching JMStudio (File>Preferences>tab Capture Devices>button Detect Capture Device)

    Run the demo
    To run the demo of this bundle, enter the following commands in the OSCAR shell

    obr -s Http Service
    obr -s Service Binder
    start http://www-adele.imag.fr/~donsez/dev/osgi/osgi3spec/osgi3spec.jar
    start http://www-adele.imag.fr/~donsez/dev/osgi/wireadmin/wireadmin.jar
    start http://www-adele.imag.fr/~donsez/dev/osgi/wireadmincmd/wireadmincmd.jar
    start http://www-adele.imag.fr/~donsez/dev/osgi/consumerservlet/consumerservlet.jar
    start http://www-adele.imag.fr/~donsez/dev/osgi/webcamproducer/webcamproducer.jar
    start http://www-adele.imag.fr/~donsez/dev/osgi/dateproducer/dateproducer.jar
    
    Wait for this trace "Capture thread starting..."
    And check the existing producers and consumers with the following commands
    wa
    wa -lp
    wa -lc	
    
    Enter the following commands to create
    a wire between the webcamproducer and the consumerservlet
    and a wire between the dateproducer and the consumerservlet
    wa -c fr.imag.adele.osgi.util.webcam fr.imag.adele.osgi.util.consumerservlet
    wa -c fr.imag.adele.osgi.util.clock fr.imag.adele.osgi.util.consumerservlet
    wa -w
    
    Then browse this URL http://localhost/wa/poll and click on "Image"
    Finally stop the dateproducer (normally bundle number 12) (and its traces ;-) )
    stop 12
    
    Then browse again (refresh) this URL http://localhost/wa/poll

    Typical Usages

  • (Embedded) Embedded Sightseening WebCam
  • (Embedded) Surveillance camera (Nursery, Bank, ...)
  • ...
  • Tested gateways

    Tested WebCam

    TODO (contributions are welcome)

    Links

    Notice
    I get the source from these JMF articles

    and changes The articles licence terms are http://developers.sun.com/techtopics/mobility/berkeley_license.html
    
    Mobility BSD License
    
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 
    
    Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    
    
    Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
    Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
    
    This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
    
    You acknowledge that this software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility.