TOneDReader.patternMatchVariance Method

Definition

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.

Delphi
class function patternMatchVariance(counters: TArray<Integer>; pattern: TOneDPattern; maxIndividualVariance: Integer): Integer

Parameters

counters
TArray<Integer>

observed counters

pattern
TOneDPattern

expected pattern

maxIndividualVariance
Integer

The most any counter can differ before we give up

Returns

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