TOne DReader .pattern Match Variance Method
Determines how closely a set of observed counts of runs of black/white values matches a given target pattern. This is reported as the ratio of the total variance from the expected pattern proportions across all pattern elements, to the length of the pattern.
class function patternMatchVariance(counters: TArray<Integer>; pattern: TArray<Integer>; maxIndividualVariance: Integer): Integer
Parameters
- counters
- Type: TArray<Integer>
observed counters
- pattern
- Type: TArray<Integer>
expected pattern
- maxIndividualVariance
- Type: System.Integer
The most any counter can differ before we give up
Return Value
Type: System.Integer
ratio of total variance between counters and pattern compared to total pattern size, where the ratio has been multiplied by 256. So, 0 means no variance (perfect match); 256 means the total variance between counters and patterns equals the pattern length, higher values mean even more variance