#include <quadlsq.h>
List of all members.
Detailed Description
Definition at line 25 of file quadlsq.h.
Constructor & Destructor Documentation
Member Function Documentation
Definition at line 56 of file quadlsq.cpp.
{
n++;
sigx += x;
sigy += y;
sigxx += x * x;
sigxy += x * y;
sigyy += y * y;
sigxxx += static_cast<long double>(x) * x * x;
sigxxy += static_cast<long double>(x) * x * y;
sigxxxx += static_cast<long double>(x) * x * x * x;
}
Definition at line 34 of file quadlsq.cpp.
{
a = 0.0;
b = 0.0;
c = 0.0;
n = 0;
sigx = 0.0;
sigy = 0.0;
sigxx = 0.0;
sigxy = 0.0;
sigyy = 0.0;
sigxxx = 0.0;
sigxxy = 0.0;
sigxxxx = 0.0;
}
Definition at line 100 of file quadlsq.cpp.
{
long double x_variance = static_cast<long double>(sigxx) * n -
static_cast<long double>(sigx) * sigx;
if (x_variance < kMinVariance * n * n || degree < 1 || n < 2) {
a = b = 0.0;
if (n >= 1 && degree >= 0) {
c = sigy / n;
} else {
c = 0.0;
}
return;
}
long double top96 = 0.0;
long double bottom96 = 0.0;
long double cubevar = sigxxx * n - static_cast<long double>(sigxx) * sigx;
long double covariance = static_cast<long double>(sigxy) * n -
static_cast<long double>(sigx) * sigy;
if (n >= 4 && degree >= 2) {
top96 = cubevar * covariance;
top96 += x_variance * (static_cast<long double>(sigxx) * sigy - sigxxy * n);
bottom96 = cubevar * cubevar;
bottom96 -= x_variance *
(sigxxxx * n - static_cast<long double>(sigxx) * sigxx);
}
if (bottom96 >= kMinVariance * n * n * n * n) {
a = top96 / bottom96;
top96 = covariance - cubevar * a;
b = top96 / x_variance;
} else {
a = 0.0;
b = covariance / x_variance;
}
c = (sigy - a * sigxx - b * sigx) / n;
}
Definition at line 75 of file quadlsq.cpp.
{
if (n <= 0) {
tprintf("Can't remove an element from an empty QLSQ accumulator!\n");
return;
}
n--;
sigx -= x;
sigy -= y;
sigxx -= x * x;
sigxy -= x * y;
sigyy -= y * y;
sigxxx -= static_cast<long double>(x) * x * x;
sigxxy -= static_cast<long double>(x) * x * y;
sigxxxx -= static_cast<long double>(x) * x * x * x;
}
The documentation for this class was generated from the following files:
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/quadlsq.h
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/quadlsq.cpp