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

Function MakeDegenerateProto

deps/tesseract/classify/cluster.cpp:1069–1096  ·  view source on GitHub ↗

* This routine checks for clusters which are degenerate and * therefore cannot be analyzed in a statistically valid way. * A cluster is defined as degenerate if it does not have at * least MINSAMPLESNEEDED samples in it. If the cluster is * found to be degenerate, a prototype of the specified style * is generated and marked as insignificant. A cluster is * also degenerate if it does not ha

Source from the content-addressed store, hash-verified

1067 * 8/8/89, DSJ, Removed check for 0 stddev (handled elsewhere).
1068 */
1069PROTOTYPE *MakeDegenerateProto( //this was MinSample
1070 uinT16 N,
1071 CLUSTER *Cluster,
1072 STATISTICS *Statistics,
1073 PROTOSTYLE Style,
1074 inT32 MinSamples) {
1075 PROTOTYPE *Proto = NULL;
1076
1077 if (MinSamples < MINSAMPLESNEEDED)
1078 MinSamples = MINSAMPLESNEEDED;
1079
1080 if (Cluster->SampleCount < MinSamples) {
1081 switch (Style) {
1082 case spherical:
1083 Proto = NewSphericalProto (N, Cluster, Statistics);
1084 break;
1085 case elliptical:
1086 case automatic:
1087 Proto = NewEllipticalProto (N, Cluster, Statistics);
1088 break;
1089 case mixed:
1090 Proto = NewMixedProto (N, Cluster, Statistics);
1091 break;
1092 }
1093 Proto->Significant = FALSE;
1094 }
1095 return (Proto);
1096} // MakeDegenerateProto
1097
1098/**
1099 * This routine tests the specified cluster to see if **

Callers 1

MakePrototypeFunction · 0.85

Calls 3

NewSphericalProtoFunction · 0.85
NewEllipticalProtoFunction · 0.85
NewMixedProtoFunction · 0.85

Tested by

no test coverage detected