#include <linlsq.h>
Definition at line 26 of file linlsq.h.
| void LLSQ::add |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
| void LLSQ::add |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
weight |
|
) |
| |
Definition at line 59 of file linlsq.cpp.
60 total_weight += weight;
63 sigxx += x * x * weight;
64 sigxy += x * y * weight;
65 sigyy += y * y * weight;
| void LLSQ::add |
( |
const LLSQ & |
other | ) |
|
Definition at line 68 of file linlsq.cpp.
69 total_weight += other.total_weight;
| double LLSQ::c |
( |
double |
m | ) |
const |
Definition at line 118 of file linlsq.cpp.
119 if (total_weight > 0.0)
120 return (sigy -
m * sigx) / total_weight;
| inT32 LLSQ::count |
( |
| ) |
const |
|
inline |
Definition at line 41 of file linlsq.h.
42 return static_cast<int>(total_weight + 0.5);
| double LLSQ::covariance |
( |
| ) |
const |
|
inline |
Definition at line 60 of file linlsq.h.
61 if (total_weight > 0.0)
62 return (sigxy - sigx * sigy / total_weight) / total_weight;
Definition at line 102 of file linlsq.cpp.
106 return covar / x_var;
double covariance() const
double x_variance() const
| FCOORD LLSQ::mean_point |
( |
| ) |
const |
Definition at line 168 of file linlsq.cpp.
169 if (total_weight > 0.0) {
170 return FCOORD(sigx / total_weight, sigy / total_weight);
| double LLSQ::pearson |
( |
| ) |
const |
Definition at line 155 of file linlsq.cpp.
161 if (var_product > 0.0)
162 r = covar / sqrt(var_product);
double y_variance() const
double covariance() const
double x_variance() const
| void LLSQ::remove |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Definition at line 84 of file linlsq.cpp.
85 if (total_weight <= 0.0)
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
| double LLSQ::rms |
( |
double |
m, |
|
|
double |
c |
|
) |
| const |
Definition at line 132 of file linlsq.cpp.
135 if (total_weight > 0) {
136 error = sigyy +
m * (
m * sigxx + 2 * (
c * sigx - sigxy)) +
c *
137 (total_weight *
c - 2 * sigy);
139 error = sqrt(error / total_weight);
| FCOORD LLSQ::vector_fit |
( |
| ) |
const |
Definition at line 182 of file linlsq.cpp.
187 if (x_var >= y_var) {
190 result.
set_x(x_var / sqrt(x_var * x_var + covar * covar));
191 result.
set_y(sqrt(1.0 - result.
x() * result.
x()));
193 result.
set_y(y_var / sqrt(y_var * y_var + covar * covar));
194 result.
set_x(sqrt(1.0 - result.
y() * result.
y()));
197 result.
set_y(-result.
y());
void set_x(float xin)
rewrite function
double y_variance() const
double covariance() const
double x_variance() const
void set_y(float yin)
rewrite function
| double LLSQ::x_variance |
( |
| ) |
const |
|
inline |
Definition at line 66 of file linlsq.h.
67 if (total_weight > 0.0)
68 return (sigxx - sigx * sigx / total_weight) / total_weight;
| double LLSQ::y_variance |
( |
| ) |
const |
|
inline |
Definition at line 72 of file linlsq.h.
73 if (total_weight > 0.0)
74 return (sigyy - sigy * sigy / total_weight) / total_weight;
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccstruct/linlsq.h
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccstruct/linlsq.cpp