edu.berkeley.guir.papier_mache.vision
Class VisionPhobProducer

java.lang.Object
  extended by edu.berkeley.guir.papier_mache.PhobProducer
      extended by edu.berkeley.guir.papier_mache.vision.VisionPhobProducer
All Implemented Interfaces:
java.util.EventListener, InputDataListener

public class VisionPhobProducer
extends PhobProducer
implements InputDataListener

This class takes a camera as input, and uses computer vision to find objects in the camera image. It then creates a VisionPhob for each of these objects. This class also displays the raw camera input and the computer vision output in the main Papier-Mache frame.

This software is distributed under the Berkeley Software License.

Author:
Scott Klemmer ( srk(AT)cs.berkeley.edu )

Constructor Summary
VisionPhobProducer(ImageInputDevice imgSource)
           
VisionPhobProducer(ImageInputDevice imgSource, int minSize)
           
 
Method Summary
 void addCurrentPhobsListener(CurrentPhobsListener listener)
           
 void captureFirstCalibImage(CalibrationListener listener)
           
 void captureSecondCalibImage()
           
 void dataReceived(InputDataEvent e)
           
 void generateWOzPhob()
          Creates a new VisionPhob and fires a PhobAddedEvent
 javax.swing.Icon getIcon()
           
 ImageInputDevice getImageSource()
           
 java.lang.Class getPhobType()
           
static java.util.Collection groupPhobs(java.util.List phobs, int maxDist)
          Given a collection of phobs, groups phobs that are close to each other based on the input var 'maxDist'
 java.lang.String toString()
           
 
Methods inherited from class edu.berkeley.guir.papier_mache.PhobProducer
addPhobListener, firePhobAddedEvent, firePhobRemovedEvent, firePhobUpdatedEvent, removePhobListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VisionPhobProducer

public VisionPhobProducer(ImageInputDevice imgSource)

VisionPhobProducer

public VisionPhobProducer(ImageInputDevice imgSource,
                          int minSize)
Method Detail

getIcon

public javax.swing.Icon getIcon()
Overrides:
getIcon in class PhobProducer

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addCurrentPhobsListener

public void addCurrentPhobsListener(CurrentPhobsListener listener)

captureFirstCalibImage

public void captureFirstCalibImage(CalibrationListener listener)
Parameters:
listener - the listener to send a completion acknowledgement to

captureSecondCalibImage

public void captureSecondCalibImage()

dataReceived

public void dataReceived(InputDataEvent e)
Specified by:
dataReceived in interface InputDataListener

getImageSource

public ImageInputDevice getImageSource()

getPhobType

public java.lang.Class getPhobType()
Specified by:
getPhobType in class PhobProducer

groupPhobs

public static java.util.Collection groupPhobs(java.util.List phobs,
                                              int maxDist)
Given a collection of phobs, groups phobs that are close to each other based on the input var 'maxDist'

Returns:
Collection of Collections of phobs

generateWOzPhob

public void generateWOzPhob()
Creates a new VisionPhob and fires a PhobAddedEvent