Z.TargetFinder
Inherits from Z.Base
Description
A TargetFinder searches for target images in the camera feed. It's constructed with a file containing a description of the target image(s) to look for. This file, known as a target file, is produced by the "Train image" feature of ZapWorks Studio.
A TargetFinder creates a Target for each distinct image it finds. Some target files can describe multiple target images, or multiple variations of the same basic image. TargetFinders create new Targets for each separately identifiable target image it discovers in the camera feed.
In the case that the target file only contains a single image then only one Target will be created.
Once a Target has been detected by a TargetFinder, a TargetInstance is created. This relates to a specific occurrence of a Target appearing within the camera feed. If there are multiple occurrences of the same (thus identical in appearance) target within the camera feed, then multiple TargetInstances are created.
While this API supports multiple Targets and TargetInstances, at present ZapWorks Studio only supports one Target and one TargetInstance.
Provided by Z.TargetFinder
Constructor
Z.TargetFinder(...) | Constructs a new Z.TargetFinder object. |
Events
newinstance | Emitted when the TargetFinder has found a new instance of a Target. |
newtarget | Emitted when the TargetFinder creates a new Target. |
notseen | Emitted when the given TargetInstance is no longer detected in the camera feed by the TargetFinder. |
seen | Emitted when the given TargetInstance is detected in the camera feed by the TargetFinder. |
Functions
defaultScale( ) | Gets the default scale of the TargetFinder. |
defaultScale(...) | Sets the default scale of the TargetFinder. |
source( ) | Gets the name of the source target file. |
source(...) | Sets the filename of the target file to load. |
Inherited from Z.Base
Functions
emit(...) | Calls the handler functions attached to an event. |
hasTag(...) | Returns true if this object has the specified tag. |
off(...) | Removes a handler function from an event. |
on(...) | Attaches a handler function to an event. |
one(...) | Attaches a single-use handler function to an event. |
pushTag(...) | Adds a tag to this object. |
removeTag(...) | Removes a tag from this object. |
tags( ) | Gets an array of the tags that this object belongs to. |
tags(...) | Sets the array of the tags that this object belongs to. |