Package edu.tufts.hrilab.interfaces
Interface VisionInterface
- All Known Subinterfaces:
MockVisionInterface
,VisionInterface
- All Known Implementing Classes:
MockVisionComponent
,VisionComponent
public interface VisionInterface
Core interface for vision servers.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
confirmToken
(MemoryObject token) Confirms that the object is still in STM.This instantiates a new MemoryObjecType (search manager) which can be incrementally configured viaaddDescriptor
.void
endDescriptorChanges
(long typeId) Signal the end of constraint addition.getDescriptors
(Long typeId) Get the descriptors for a particular SearchManager.getToken
(long tokenId, double conf) Get the MemoryObject with the specified id.getTokenIds
(double conf) Get MemoryObject IDs in STM with a confidence level over the specified threshold.getTokenIds
(long typeId, double conf) Get MemoryObject IDs that have specified SearchManager ID with a confidence level above the specified threshold.getTokenIds
(List<? extends Symbol> descriptors, double conf) Get MemoryObject IDs for all tokens *exactly* matching descriptors in STM with confidence greater than threshold.getTokens
(double conf) Get MemoryObjects in STM with a confidence over the specified threshold.getTokens
(long typeId, double conf) Get MemoryObjects of the specified SearchManager ID with confidence above specified threshold.Get MemoryObjects *exactly* matching descriptors in STM with confidence greater than threshold.Get the SearchManager ID (search ID) based on a Predicate description of the object.Get the SearchManager ID (search ID) based on a Predicate description of the object.getTypeIds
(double conf) 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
Find all SearchManagers containing at least one token in STM. One each, regardless of how many tokens of a particular type are in STM.- Parameters:
conf
- minimum confidence of tokens to be included- Returns:
- SearchManager IDs
-
getTypeId
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
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
Get the descriptors for a particular SearchManager.- Parameters:
typeId
-- Returns:
-
nameDescriptors
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
Get MemoryObject IDs in STM with a confidence level over the specified threshold. Only considers results from SearchManager searches that are currently running.- Parameters:
conf
- minimum confidence of tokens to include- Returns:
- List of STM MemoryObject IDs
-
getTokenIds
Get MemoryObject IDs that have specified SearchManager ID with a confidence level above the specified threshold. If the specified SearchManager exists but is not running, it will be started before returning results.- Parameters:
typeId
- SearchManager ID of tracked objectsconf
- minimum confidence of tokens to include- Returns:
- List of STM MemoryObject IDs
-
getTokenIds
Get MemoryObject IDs for all tokens *exactly* matching descriptors in STM with confidence greater than threshold. 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 andgetTypeId
should be used whenever possible.- Parameters:
descriptors
- list of Symbol descriptorsconf
- the minimum confidence level- Returns:
- List of STM MemoryObject IDs
-
getTokens
Get MemoryObjects in STM with a confidence over the specified threshold. Only considers results from SearchManager searches that are currently running.- Parameters:
conf
- minimum confidence of tokens to include- Returns:
- List of MemoryObjects
-
getTokens
Get MemoryObjects of the specified SearchManager ID with confidence above specified threshold. If the specified SearchManager exists but is not running, it will be started before returning results.- Parameters:
typeId
- SearchManager ID of tracked objectsconf
- minimum confidence of tokens to include- Returns:
- List of MemoryObjects
-
getTokens
Get MemoryObjects *exactly* matching descriptors in STM with confidence greater than threshold. 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 andgetTypeId
should be used whenever possible.- Parameters:
descriptors
- list of Symbol descriptorsconf
- the minimum confidence level- Returns:
- List of STM MemoryObjects
-
getToken
Get the MemoryObject with the specified id.- Parameters:
tokenId
- MemoryObject ID in STMconf
- minimum confidence of tokens to include- 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
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 viaaddDescriptor
.- Returns:
- SearchManager ID (search id)
-
addDescriptor
Add new search constraint (i.e., ImageProcessor) to an existing SearchManager (specified by searchID).- Parameters:
typeId
- - unique ID returned bycreateNewType
descriptor
- - predicate describing visual search attribute (e.g., "red", "round")
-
removeDescriptor
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
-
-