Packagecom.transmote.flar.utils.threshold
Classpublic class DrunkWalkThresholdAdapter
InheritanceDrunkWalkThresholdAdapter Inheritance Object
Implements IThresholdAdapter

DrunkWalkThresholdAdapter calculates a new threshold using weighted randomization. When marker detection is poor, DrunkWalkThresholdAdapter adjusts the threshold by moving a random amount away from the current threshold value based on this.speed and this.bias.

See the following URLs for more information:



Public Properties
 PropertyDefined By
  bias : Number
The direction toward which adaptive thresholding trends.
DrunkWalkThresholdAdapter
  runsEveryFrame : Boolean
[read-only] Returns false; DrunkWalkThresholdAdapter runs only when confidence is low (poor marker detection).
DrunkWalkThresholdAdapter
  speed : Number
The speed at which the threshold changes during adaptive thresholding.
DrunkWalkThresholdAdapter
Public Methods
 MethodDefined By
  
DrunkWalkThresholdAdapter(speed:Number = 0.3, bias:Number = -0.1)
Constructor.
DrunkWalkThresholdAdapter
  
calculateThreshold(source:BitmapData, currentThreshold:Number):Number
Calculate a new threshold.
DrunkWalkThresholdAdapter
  
dispose():void
Free this instance for garbage collection.
DrunkWalkThresholdAdapter
  
initFromXML(paramsObj:Object):void
Init from a name-value paired object that contains parameters parsed from XML.
DrunkWalkThresholdAdapter
  
resetCalculations(currentThreshold:Number):void
Reset calculations.
DrunkWalkThresholdAdapter
Property Detail
biasproperty
bias:Number

The direction toward which adaptive thresholding trends.

Lower thresholds favor environments with too little light; Higher thresholds favor environments with too much light.

A value of -1 will adapt only toward a lower threshold. A value of +1 will adapt only toward a higher threshold. A value of 0 will adapt randomly in both directions, with no bias. The default is -0.1, as darker environments tend to be more common for viewing web applications than are brightly lit environments.


Implementation
    public function get bias():Number
    public function set bias(value:Number):void
runsEveryFrameproperty 
runsEveryFrame:Boolean  [read-only]

Returns false; DrunkWalkThresholdAdapter runs only when confidence is low (poor marker detection).


Implementation
    public function get runsEveryFrame():Boolean
speedproperty 
speed:Number

The speed at which the threshold changes during adaptive thresholding. Larger values may increase the speed at which the markers in uneven illumination are detected, but may also result in instability in marker detection.

Value must be zero or greater. The default is 0.3. A value of zero will disable adaptive thresholding.


Implementation
    public function get speed():Number
    public function set speed(value:Number):void
Constructor Detail
DrunkWalkThresholdAdapter()Constructor
public function DrunkWalkThresholdAdapter(speed:Number = 0.3, bias:Number = -0.1)

Constructor.

Parameters
speed:Number (default = 0.3)
 
bias:Number (default = -0.1)
Method Detail
calculateThreshold()method
public function calculateThreshold(source:BitmapData, currentThreshold:Number):Number

Calculate a new threshold.

Parameters

source:BitmapData — Unused by DrunkWalkThresholdAdapter.
 
currentThreshold:Number — Current threshold value.

Returns
Number — New threshold value.
dispose()method 
public function dispose():void

Free this instance for garbage collection.

initFromXML()method 
public function initFromXML(paramsObj:Object):void

Init from a name-value paired object that contains parameters parsed from XML.

Parameters

paramsObj:Object

resetCalculations()method 
public function resetCalculations(currentThreshold:Number):void

Reset calculations.

Parameters

currentThreshold:Number