Packagecom.transmote.flar.utils.threshold
Classpublic class DrunkHistogramThresholdAdapter
InheritanceDrunkHistogramThresholdAdapter Inheritance Object
Implements IThresholdAdapter
Subclasses DefaultThresholdAdapter

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

See the following URLs for more information:

Thanks for Matt Reynolds for the suggestion to combine histogram analysis with the drunk walk.



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

Returns false; DrunkHistogramThresholdAdapter 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
DrunkHistogramThresholdAdapter()Constructor
public function DrunkHistogramThresholdAdapter(speed:Number = 0.3)



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

Calculate a new threshold.

Parameters

source:BitmapData — Used to calculate bias adjustment based on source histogram.
 
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