MCPcopy Create free account
hub / github.com/creatale/node-dv / DegreesOfFreedom

Function DegreesOfFreedom

deps/tesseract/classify/cluster.cpp:2211–2221  ·  view source on GitHub ↗

* This routine computes the degrees of freedom that should * be used in a chi-squared test with the specified number of * histogram buckets. The result is always rounded up to * the next even number so that the value of chi-squared can be * computed more easily. This will cause the value of * chi-squared to be higher than the optimum value, resulting * in the chi-square test being more len

Source from the content-addressed store, hash-verified

2209 * @note History: Thu Aug 3 14:04:18 1989, DSJ, Created.
2210 */
2211uinT16 DegreesOfFreedom(DISTRIBUTION Distribution, uinT16 HistogramBuckets) {
2212 static uinT8 DegreeOffsets[] = { 3, 3, 1 };
2213
2214 uinT16 AdjustedNumBuckets;
2215
2216 AdjustedNumBuckets = HistogramBuckets - DegreeOffsets[(int) Distribution];
2217 if (Odd (AdjustedNumBuckets))
2218 AdjustedNumBuckets++;
2219 return (AdjustedNumBuckets);
2220
2221} // DegreesOfFreedom
2222
2223/**
2224 * This routine is used to search a list of histogram data

Callers 2

GetBucketsFunction · 0.85
MakeBucketsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected