Interface VisionInterface

All Known Subinterfaces:
MockVisionInterface, VisionInterface
All Known Implementing Classes:
MockVisionComponent

public interface VisionInterface
Core interface for vision servers.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addDescriptor(long typeId, Symbol descriptor)
    Add new search constraint (i.e., ImageProcessor) to an existing SearchManager (specified by searchID).
    boolean
    confirmToken(long tokenId)
    Confirms that the object is still in STM.
    boolean
    Confirms that the object is still in STM.
    This instantiates a new MemoryObjecType (search manager) which can be incrementally configured via addDescriptor.
    void
    endDescriptorChanges(long typeId)
    Signal the end of constraint addition.
    Get the descriptors for a particular SearchManager.
    getToken(long tokenId)
    Get the MemoryObject with the specified id.
    Get MemoryObject IDs in STM.
    getTokenIds(long typeId)
    Get MemoryObject IDs that have specified SearchManager ID.
    getTokenIds(List<? extends Symbol> descriptors)
    Get MemoryObject IDs for all tokens *exactly* matching descriptors in STM.
    Get MemoryObjects in STM.
    getTokens(long typeId)
    Get MemoryObjects of the specified SearchManager ID.
    getTokens(List<? extends Symbol> descriptors)
    Get MemoryObjects *exactly* matching descriptors in STM.
    getTypeId(Symbol descriptor)
    Get the SearchManager ID (search ID) based on a Predicate description of the object.
    getTypeId(List<? extends Symbol> descriptors)
    Get the SearchManager ID (search ID) based on a Predicate description of the object.
    Find all SearchManagers containing at least one token in STM.
    boolean
    nameDescriptors(Long typeId, Symbol typeName)
    Name the collection of Predicate descriptors referred to by the SearchManager ID (search ID).
    boolean
    removeDescriptor(long typeId, Symbol descriptor)
    Remove search constraint (i.e., processing descriptor and/or ImageProcessor) to an existing SearchManager (specified by searchID).
    void
    stopAndRemoveType(long typeId)
    Turns off search for typeId, and removes SearchManager.
  • Method Details

    • getTypeIds

      List<Long> getTypeIds()
      Find all SearchManagers containing at least one token in STM. One each, regardless of how many tokens of a particular type are in STM.
      Returns:
      SearchManager IDs
    • getTypeId

      Long getTypeId(List<? extends Symbol> descriptors)
      Get the SearchManager ID (search ID) based on a Predicate description of the object. The Predicate description must match the SearchManager description exactly. If an existing SearchManager does not match the description, a new SearchManager will be attempted to be built. This assumes that all descriptors refer to the same object. Also starts the SearchManager if not running. NOTE: currently just ignores descriptors that vision doesn't know how to handle.
      Parameters:
      descriptors - Predicate description of object
      Returns:
      SearchManager Id (-1 if there is no match)
    • getTypeId

      Long getTypeId(Symbol descriptor)
      Get the SearchManager ID (search ID) based on a Predicate description of the object. The Predicate description must match the SearchManager description exactly. If a current SearchManager does not match the description a new SearchManager will be attempted to be built. Also starts the SearchManager if not running. NOTE: This is only a convenience method so a List doesn't need to be passed when only a single Predicate is used.
      Parameters:
      descriptor - Predicate description of object
      Returns:
      SearchManager Id (-1 if there is no match)
    • getDescriptors

      List<Term> getDescriptors(Long typeId)
      Get the descriptors for a particular SearchManager.
      Parameters:
      typeId -
      Returns:
    • nameDescriptors

      boolean nameDescriptors(Long typeId, Symbol typeName)
      Name the collection of Predicate descriptors referred to by the SearchManager ID (search ID).
      Parameters:
      typeId - SearchManager ID (search ID)
      typeName - Predicate name of object (name will be bound to typeId in VisionComponent)
      Returns:
      true if typeId exists, false otherwise
    • getTokenIds

      List<Long> getTokenIds()
      Get MemoryObject IDs in STM. Only considers results from SearchManager searches that are currently running.
      Returns:
      List of STM MemoryObject IDs
    • getTokenIds

      List<Long> getTokenIds(long typeId)
      Get MemoryObject IDs that have specified SearchManager ID. If the specified SearchManager exists but is not running, it will be started before returning results.
      Parameters:
      typeId - SearchManager ID of tracked objects
      Returns:
      List of STM MemoryObject IDs
    • getTokenIds

      List<Long> getTokenIds(List<? extends Symbol> descriptors)
      Get MemoryObject IDs for all tokens *exactly* matching descriptors in STM. If a matching type is found, it will be started (if not already running). If no match exists, a SearchManager will attempt to be built and started before returning. This is largely a convenience method and getTypeId should be used whenever possible.
      Parameters:
      descriptors - list of Symbol descriptors
      Returns:
      List of STM MemoryObject IDs
    • getTokens

      List<MemoryObject> getTokens()
      Get MemoryObjects in STM. Only considers results from SearchManager searches that are currently running.
      Returns:
      List of MemoryObjects
    • getTokens

      List<MemoryObject> getTokens(long typeId)
      Get MemoryObjects of the specified SearchManager ID. If the specified SearchManager exists but is not running, it will be started before returning results.
      Parameters:
      typeId - SearchManager ID of tracked objects
      Returns:
      List of MemoryObjects
    • getTokens

      List<MemoryObject> getTokens(List<? extends Symbol> descriptors)
      Get MemoryObjects *exactly* matching descriptors in STM. If a matching type is found, it will be started (if not already running). If no match exists, a SearchManager will attempt to be built and started before returning. This is largely a convenience method and getTypeId should be used whenever possible.
      Parameters:
      descriptors - list of Symbol descriptors
      Returns:
      List of STM MemoryObjects
    • getToken

      MemoryObject getToken(long tokenId)
      Get the MemoryObject with the specified id.
      Parameters:
      tokenId - MemoryObject ID in STM
      Returns:
      MemoryObject token (Null if doesn't exist)
    • confirmToken

      boolean confirmToken(long tokenId)
      Confirms that the object is still in STM.
      Parameters:
      tokenId - MemoryObject ID of the object to be confirmed
      Returns:
      true if the MemoryObject is present in STM
    • confirmToken

      boolean confirmToken(MemoryObject token)
      Confirms that the object is still in STM.
      Parameters:
      token - MemoryObject to be confirmed
      Returns:
      true if the object is present in STM
    • createNewType

      Long createNewType()
      This instantiates a new MemoryObjecType (search manager) which can be incrementally configured via addDescriptor.
      Returns:
      SearchManager ID (search id)
    • addDescriptor

      boolean addDescriptor(long typeId, Symbol descriptor)
      Add new search constraint (i.e., ImageProcessor) to an existing SearchManager (specified by searchID).
      Parameters:
      typeId - - unique ID returned by createNewType
      descriptor - - predicate describing visual search attribute (e.g., "red", "round")
    • removeDescriptor

      boolean removeDescriptor(long typeId, Symbol descriptor)
      Remove search constraint (i.e., processing descriptor and/or ImageProcessor) to an existing SearchManager (specified by searchID).
      Parameters:
      typeId -
      descriptor - - to remove
      Returns:
      - if removal was successful
    • endDescriptorChanges

      void endDescriptorChanges(long typeId)
      Signal the end of constraint addition. Descriptors/constraints can no longer be added to the SearchManager after this has been called. This also starts the Detector and Tracker and will choose the "object" Detector if one hasn't already been selected.
      Parameters:
      typeId -
    • stopAndRemoveType

      void stopAndRemoveType(long typeId)
      Turns off search for typeId, and removes SearchManager.
      Parameters:
      typeId -