Class AvailableImageProcessors

java.lang.Object
javax.swing.AbstractListModel
edu.tufts.hrilab.vision.imgproc.AvailableImageProcessors
All Implemented Interfaces:
Serializable, ListModel

public class AvailableImageProcessors extends AbstractListModel
ImageProcessor Factory. This contains the ImageProcessor types available to the system, instantiates and dispenses ImageProcessors to the system, and manages the instantiated ImageProcessors. ImageProcessors are made available to the system through a getInstance call, and all ImageProcessor clients must notify the factory when a ImageProcessor is no longer needed by calling release. Basically, every getInstance call should be paired with a release call.
See Also:
  • Constructor Details

    • AvailableImageProcessors

      public AvailableImageProcessors(int imgWidth, int imgHeight, boolean isStereo, String configFile)
  • Method Details

    • addImageProcessorOption

      public void addImageProcessorOption(Symbol descriptor, ImageProcessorType type)
      Add an image processor option. This is currently only used for runtime instance learning.
      Parameters:
      descriptor - new description to add
      type - image processor type
    • getAll

      public NonEDTListModel<ImageProcessor> getAll()
      Should only be used by the GUI!
      Returns:
      container of all instantiated ImageProcessors
    • getOptions

      public List<Term> getOptions()
      Get set of available predicates advertised to the rest of the system. Should only be used by CameraConstrol GUI.
      Returns:
    • getTypeOptions

      public Set<ImageProcessorType> getTypeOptions()
      Get set of available ImageProcessorTypes available to the system. Not all of them may be advertised as Predicates (eg, SIFT).
      Returns:
    • hasCapableProcessorType

      public boolean hasCapableProcessorType(Term term)
      Is there an ImageProcessor that matches the specified predicate.
      Parameters:
      term - - Predicate description
      Returns:
      - if one exists.
    • hasCapableProcessorType

      public boolean hasCapableProcessorType(ImageProcessorType type)
      Is there an ImageProcessor that matches the specified ImageProcessorType.
      Parameters:
      type -
      Returns:
      - if type exists.
    • getCapableProcessorType

      public ImageProcessorType getCapableProcessorType(Term term)
      Get ImageProcessorType that matches the specified term.
      Parameters:
      term - - Predicate description
      Returns:
      - ImageProcessorType that "matches" term. Null if no match.
    • getInstance

      public ImageProcessor getInstance(Object client, Term term)
      Get ImageProcessor instance based on specified term. Returns null if a match cannot be found.
      Parameters:
      client -
      term -
      Returns:
    • getInstance

      public ImageProcessor getInstance(Object client, ImageProcessorType processorType)
      Get ImageProcessor instance based on requested ImageProcessorType
      Parameters:
      client -
      processorType -
      Returns:
    • release

      public void release(Object client, ImageProcessor processor)
      Client needs to let managing factory know when it's done using an ImageProcessor instance, so that ImageProcessors can be properly managed and garbage collected.
    • getElementAt

      public Object getElementAt(int arg0)
      For AbstractListModel. To expose imageProcesstYpes to UI.
      Parameters:
      arg0 -
      Returns:
    • getSize

      public int getSize()
      For AbstractListModel. To expose imageProcesstYpes to UI.
      Returns: