#include <blobbox.h>
List of all members.
Public Member Functions |
| TO_ROW () |
| TO_ROW (BLOBNBOX *blob, float top, float bottom, float row_size) |
void | print () const |
float | max_y () const |
float | min_y () const |
float | mean_y () const |
float | initial_min_y () const |
float | line_m () const |
float | line_c () const |
float | line_error () const |
float | parallel_c () const |
float | parallel_error () const |
float | believability () const |
float | intercept () const |
void | add_blob (BLOBNBOX *blob, float top, float bottom, float row_size) |
void | insert_blob (BLOBNBOX *blob) |
BLOBNBOX_LIST * | blob_list () |
void | set_line (float new_m, float new_c, float new_error) |
void | set_parallel_line (float gradient, float new_c, float new_error) |
void | set_limits (float new_min, float new_max) |
void | compute_vertical_projection () |
bool | rep_chars_marked () const |
void | clear_rep_chars_marked () |
int | num_repeated_sets () const |
void | set_num_repeated_sets (int num_sets) |
Public Attributes |
BOOL8 | merged |
BOOL8 | all_caps |
BOOL8 | used_dm_model |
inT16 | projection_left |
inT16 | projection_right |
PITCH_TYPE | pitch_decision |
float | fixed_pitch |
float | fp_space |
float | fp_nonsp |
float | pr_space |
float | pr_nonsp |
float | spacing |
float | xheight |
int | xheight_evidence |
float | ascrise |
float | descdrop |
float | body_size |
inT32 | min_space |
inT32 | max_nonspace |
inT32 | space_threshold |
float | kern_size |
float | space_size |
WERD_LIST | rep_words |
ICOORDELT_LIST | char_cells |
QSPLINE | baseline |
STATS | projection |
Static Public Attributes |
static const int | kErrorWeight = 3 |
Detailed Description
Definition at line 530 of file blobbox.h.
Constructor & Destructor Documentation
Definition at line 682 of file blobbox.cpp.
{
clear();
y_min = bottom;
y_max = top;
initial_y_min = bottom;
float diff;
BLOBNBOX_IT it = &blobs;
it.add_to_end (blob);
diff = top - bottom - row_size;
if (diff > 0) {
y_max -= diff / 2;
y_min += diff / 2;
}
else if ((top - bottom) * 3 < row_size) {
diff = row_size / 3 + bottom - top;
y_max += diff / 2;
y_min -= diff / 2;
}
}
Member Function Documentation
Definition at line 726 of file blobbox.cpp.
{
float allowed;
float available;
BLOBNBOX_IT it = &blobs;
it.add_to_end (blob);
allowed = row_size + y_min - y_max;
if (allowed > 0) {
available = top > y_max ? top - y_max : 0;
if (bottom < y_min)
available += y_min - bottom;
if (available > 0) {
available += available;
if (available < allowed)
available = allowed;
if (bottom < y_min)
y_min -= (y_min - bottom) * allowed / available;
if (top > y_max)
y_max += (top - y_max) * allowed / available;
}
}
}
Definition at line 621 of file blobbox.h.
{
num_repeated_sets_ = -1;
}
Definition at line 554 of file blobbox.h.
{
return initial_y_min;
}
Definition at line 762 of file blobbox.cpp.
{
BLOBNBOX_IT it = &blobs;
if (it.empty ())
it.add_before_then_move (blob);
else {
it.mark_cycle_pt ();
while (!it.cycled_list ()
&& it.data ()->bounding_box ().left () <=
blob->bounding_box ().left ())
it.forward ();
if (it.cycled_list ())
it.add_to_end (blob);
else
it.add_before_stay_put (blob);
}
}
Definition at line 551 of file blobbox.h.
{
return (y_min + y_max) / 2.0f;
}
Definition at line 624 of file blobbox.h.
{
return num_repeated_sets_;
}
Definition at line 710 of file blobbox.cpp.
{
tprintf("pitch=%d, fp=%g, fps=%g, fpns=%g, prs=%g, prns=%g,"
" spacing=%g xh=%g y_origin=%g xev=%d, asc=%g, desc=%g,"
" body=%g, minsp=%d maxnsp=%d, thr=%d kern=%g sp=%g\n",
pitch_decision, fixed_pitch, fp_space, fp_nonsp, pr_space, pr_nonsp,
spacing, xheight, y_origin, xheight_evidence, ascrise, descdrop,
body_size, min_space, max_nonspace, space_threshold, kern_size,
space_size);
}
Definition at line 618 of file blobbox.h.
{
return num_repeated_sets_ != -1;
}
Definition at line 609 of file blobbox.h.
{
y_min = new_min;
y_max = new_max;
}
Definition at line 590 of file blobbox.h.
{
m = new_m;
c = new_c;
error = new_error;
}
Definition at line 627 of file blobbox.h.
{
num_repeated_sets_ = num_sets;
}
Definition at line 598 of file blobbox.h.
{
para_c = new_c;
para_error = new_error;
credibility =
(float) (blobs.length () - kErrorWeight * new_error);
y_origin = (float) (new_c / sqrt (1 + gradient * gradient));
}
Member Data Documentation
The documentation for this class was generated from the following files:
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/blobbox.h
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/ccstruct/blobbox.cpp