Definition at line 111 of file cjkpitch.cpp.
◆ LocalCorrelation()
tesseract::LocalCorrelation::LocalCorrelation |
( |
| ) |
|
|
inline |
◆ ~LocalCorrelation()
tesseract::LocalCorrelation::~LocalCorrelation |
( |
| ) |
|
|
default |
◆ Add()
void tesseract::LocalCorrelation::Add |
( |
float |
x, |
|
|
float |
y, |
|
|
int |
v |
|
) |
| |
|
inline |
Definition at line 130 of file cjkpitch.cpp.
131 struct float_pair value;
135 values_.push_back(value);
◆ Clear()
void tesseract::LocalCorrelation::Clear |
( |
| ) |
|
|
inline |
◆ EstimateYFor()
float tesseract::LocalCorrelation::EstimateYFor |
( |
float |
x, |
|
|
float |
r |
|
) |
| |
|
inline |
Definition at line 139 of file cjkpitch.cpp.
141 unsigned start = 0, end = values_.size();
144 while (start < values_.size() && values_[start].x < x * (1 - r)) {
147 while (end > 0 && values_[end - 1].x > x * (1 + r)) {
155 end = values_.size();
161 for (
auto i = start; i < end; i++) {
162 rc += values_[i].vote * x * values_[i].y / values_[i].x;
163 vote += values_[i].vote;
166 return vote == 0 ? 0.0f : rc / vote;
◆ Finish()
void tesseract::LocalCorrelation::Finish |
( |
| ) |
|
|
inline |
Definition at line 121 of file cjkpitch.cpp.
122 std::sort(values_.begin(), values_.end(), float_pair_compare);
The documentation for this class was generated from the following file: