#include <blobbox.h>
List of all members.
Public Member Functions |
| TO_ROW () |
| TO_ROW (BLOBNBOX *blob, float top, float bottom, float row_size) |
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 519 of file blobbox.h.
Constructor & Destructor Documentation
TO_ROW::TO_ROW |
( |
| ) |
[inline] |
TO_ROW::TO_ROW |
( |
BLOBNBOX * |
blob, |
|
|
float |
top, |
|
|
float |
bottom, |
|
|
float |
row_size |
|
) |
| |
Definition at line 626 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
void TO_ROW::add_blob |
( |
BLOBNBOX * |
blob, |
|
|
float |
top, |
|
|
float |
bottom, |
|
|
float |
row_size |
|
) |
| |
Definition at line 661 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;
}
}
}
float TO_ROW::believability |
( |
| ) |
const [inline] |
BLOBNBOX_LIST* TO_ROW::blob_list |
( |
| ) |
[inline] |
void TO_ROW::clear_rep_chars_marked |
( |
| ) |
[inline] |
Definition at line 609 of file blobbox.h.
{
num_repeated_sets_ = -1;
}
void TO_ROW::compute_vertical_projection |
( |
| ) |
|
float TO_ROW::initial_min_y |
( |
| ) |
const [inline] |
Definition at line 542 of file blobbox.h.
{
return initial_y_min;
}
void TO_ROW::insert_blob |
( |
BLOBNBOX * |
blob | ) |
|
Definition at line 697 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);
}
}
float TO_ROW::intercept |
( |
| ) |
const [inline] |
float TO_ROW::line_c |
( |
| ) |
const [inline] |
float TO_ROW::line_error |
( |
| ) |
const [inline] |
float TO_ROW::line_m |
( |
| ) |
const [inline] |
float TO_ROW::max_y |
( |
| ) |
const [inline] |
float TO_ROW::mean_y |
( |
| ) |
const [inline] |
Definition at line 539 of file blobbox.h.
{
return (y_min + y_max) / 2.0f;
}
float TO_ROW::min_y |
( |
| ) |
const [inline] |
int TO_ROW::num_repeated_sets |
( |
| ) |
const [inline] |
Definition at line 612 of file blobbox.h.
{
return num_repeated_sets_;
}
float TO_ROW::parallel_c |
( |
| ) |
const [inline] |
float TO_ROW::parallel_error |
( |
| ) |
const [inline] |
bool TO_ROW::rep_chars_marked |
( |
| ) |
const [inline] |
Definition at line 606 of file blobbox.h.
{
return num_repeated_sets_ != -1;
}
void TO_ROW::set_limits |
( |
float |
new_min, |
|
|
float |
new_max |
|
) |
| [inline] |
Definition at line 597 of file blobbox.h.
{
y_min = new_min;
y_max = new_max;
}
void TO_ROW::set_line |
( |
float |
new_m, |
|
|
float |
new_c, |
|
|
float |
new_error |
|
) |
| [inline] |
Definition at line 578 of file blobbox.h.
{
m = new_m;
c = new_c;
error = new_error;
}
void TO_ROW::set_num_repeated_sets |
( |
int |
num_sets | ) |
[inline] |
Definition at line 615 of file blobbox.h.
{
num_repeated_sets_ = num_sets;
}
void TO_ROW::set_parallel_line |
( |
float |
gradient, |
|
|
float |
new_c, |
|
|
float |
new_error |
|
) |
| [inline] |
Definition at line 586 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: