new ObjectTracker(opt_classifiers)
ObjectTracker utility.
Parameters:
Name | Type | Description |
---|---|---|
opt_classifiers |
string | Array.<(string|Array.<number>)> | Optional object classifiers to track. |
- Source:
Extends
Members
-
edgesDensity :number
-
Specifies the edges density of a block in order to decide whether to skip it or not.
Type:
- number
- Default Value:
- 0.2
- Source:
-
initialScale :number
-
Specifies the initial scale to start the feature block scaling.
Type:
- number
- Default Value:
- 1.0
- Source:
-
on
-
Adds a listener to the end of the listeners array for the specified event.
- Inherited From:
- Source:
-
scaleFactor :number
-
Specifies the scale factor to scale the feature block.
Type:
- number
- Default Value:
- 1.25
- Source:
-
stepSize :number
-
Specifies the block step size.
Type:
- number
- Default Value:
- 1.5
- Source:
Methods
-
addListener(event, listener) → {object}
-
Adds a listener to the end of the listeners array for the specified event.
Parameters:
Name Type Description event
string listener
function - Inherited From:
- Source:
Returns:
Returns emitter, so calls can be chained.- Type
- object
-
emit(event, opt_args) → {boolean}
-
Execute each of the listeners in order with the supplied arguments.
Parameters:
Name Type Description event
string opt_args
* [arg1], [arg2], [...] - Inherited From:
- Source:
Returns:
Returns true if event had listeners, false otherwise.- Type
- boolean
-
getClassifiers() → {TypedArray.<number>}
-
Gets the tracker HAAR classifiers.
- Source:
Returns:
- Type
- TypedArray.<number>
-
getEdgesDensity() → {number}
-
Gets the edges density value.
- Source:
Returns:
- Type
- number
-
getInitialScale() → {number}
-
Gets the initial scale to start the feature block scaling.
- Source:
Returns:
- Type
- number
-
getScaleFactor() → {number}
-
Gets the scale factor to scale the feature block.
- Source:
Returns:
- Type
- number
-
getStepSize() → {number}
-
Gets the block step size.
- Source:
Returns:
- Type
- number
-
listeners(event) → {array}
-
Returns an array of listeners for the specified event.
Parameters:
Name Type Description event
string - Inherited From:
- Source:
Returns:
Array of listeners.- Type
- array
-
once(event, listener) → {object}
-
Adds a one time listener for the event. This listener is invoked only the next time the event is fired, after which it is removed.
Parameters:
Name Type Description event
string listener
function - Inherited From:
- Source:
Returns:
Returns emitter, so calls can be chained.- Type
- object
-
removeAllListeners(event) → {object}
-
Removes all listeners, or those of the specified event. It's not a good idea to remove listeners that were added elsewhere in the code, especially when it's on an emitter that you didn't create.
Parameters:
Name Type Description event
string - Inherited From:
- Source:
Returns:
Returns emitter, so calls can be chained.- Type
- object
-
removeListener(event, listener) → {object}
-
Remove a listener from the listener array for the specified event. Caution: changes array indices in the listener array behind the listener.
Parameters:
Name Type Description event
string listener
function - Inherited From:
- Source:
Returns:
Returns emitter, so calls can be chained.- Type
- object
-
setClassifiers(classifiers)
-
Sets the tracker HAAR classifiers.
Parameters:
Name Type Description classifiers
TypedArray.<number> - Source:
-
setEdgesDensity(edgesDensity)
-
Sets the edges density.
Parameters:
Name Type Description edgesDensity
number - Source:
-
setInitialScale(initialScale)
-
Sets the initial scale to start the block scaling.
Parameters:
Name Type Description initialScale
number - Source:
-
setMaxListeners(n)
-
By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited.
Parameters:
Name Type Description n
number The maximum number of listeners. - Inherited From:
- Source:
-
setScaleFactor(scaleFactor)
-
Sets the scale factor to scale the feature block.
Parameters:
Name Type Description scaleFactor
number - Source:
-
setStepSize(stepSize)
-
Sets the block step size.
Parameters:
Name Type Description stepSize
number - Source:
-
track(pixels, width, height)
-
Tracks the `Video` frames. This method is called for each video frame in order to emit `track` event.
Parameters:
Name Type Description pixels
Uint8ClampedArray The pixels data to track. width
number The pixels canvas width. height
number The pixels canvas height. - Source: