#include <seam.h>
|
| SEAM (float priority, const TPOINT &location) |
|
| SEAM (float priority, const TPOINT &location, const SPLIT &split) |
|
float | priority () const |
|
void | set_priority (float priority) |
|
bool | HasAnySplits () const |
|
TBOX | bounding_box () const |
|
bool | CombineableWith (const SEAM &other, int max_x_dist, float max_total_priority) const |
|
void | CombineWith (const SEAM &other) |
|
bool | ContainedByBlob (const TBLOB &blob) const |
|
bool | UsesPoint (const EDGEPT *point) const |
|
bool | SharesPosition (const SEAM &other) const |
|
bool | OverlappingSplits (const SEAM &other) const |
|
void | Finalize () |
|
bool | IsHealthy (const TBLOB &blob, int min_points, int min_area) const |
|
bool | PrepareToInsertSeam (const GenericVector< SEAM *> &seams, const GenericVector< TBLOB *> &blobs, int insert_index, bool modify) |
|
bool | FindBlobWidth (const GenericVector< TBLOB *> &blobs, int index, bool modify) |
|
void | ApplySeam (bool italic_blob, TBLOB *blob, TBLOB *other_blob) const |
|
void | UndoSeam (TBLOB *blob, TBLOB *other_blob) const |
|
void | Print (const char *label) const |
|
void | Mark (ScrollView *window) const |
|
void | Hide () const |
|
void | Reveal () const |
|
float | FullPriority (int xmin, int xmax, double overlap_knob, int centered_maxwidth, double center_knob, double width_change_knob) const |
|
Definition at line 44 of file seam.h.
◆ SEAM() [1/2]
SEAM::SEAM |
( |
float |
priority, |
|
|
const TPOINT & |
location |
|
) |
| |
|
inline |
◆ SEAM() [2/2]
SEAM::SEAM |
( |
float |
priority, |
|
|
const TPOINT & |
location, |
|
|
const SPLIT & |
split |
|
) |
| |
|
inline |
◆ ApplySeam()
void SEAM::ApplySeam |
( |
bool |
italic_blob, |
|
|
TBLOB * |
blob, |
|
|
TBLOB * |
other_blob |
|
) |
| const |
Definition at line 124 of file seam.cpp.
125 for (
int s = 0; s < num_splits_; ++s) {
void EliminateDuplicateOutlines()
void ComputeBoundingBoxes()
void SplitOutlineList(TESSLINE *outlines) const
void CorrectBlobOrder(TBLOB *next)
void divide_blobs(TBLOB *blob, TBLOB *other_blob, bool italic_blob, const TPOINT &location)
◆ bounding_box()
TBOX SEAM::bounding_box |
( |
| ) |
const |
Definition at line 37 of file seam.cpp.
38 TBOX box(location_.
x, location_.
y, location_.
x, location_.
y);
39 for (
int s = 0; s < num_splits_; ++s) {
TBOX bounding_box() const
◆ BreakPieces()
Definition at line 194 of file seam.cpp.
197 for (
int x = first; x <
last; ++x) seams[x]->
Reveal();
199 TESSLINE* outline = blobs[first]->outlines;
200 int next_blob = first + 1;
202 while (outline !=
nullptr && next_blob <=
last) {
203 if (outline->
next == blobs[next_blob]->outlines) {
204 outline->
next =
nullptr;
205 outline = blobs[next_blob]->outlines;
208 outline = outline->
next;
◆ CombineableWith()
bool SEAM::CombineableWith |
( |
const SEAM & |
other, |
|
|
int |
max_x_dist, |
|
|
float |
max_total_priority |
|
) |
| const |
Definition at line 46 of file seam.cpp.
48 int dist = location_.
x - other.location_.
x;
49 if (-max_x_dist < dist && dist < max_x_dist &&
50 num_splits_ + other.num_splits_ <= kMaxNumSplits &&
51 priority_ + other.priority_ < max_total_priority &&
bool SharesPosition(const SEAM &other) const
bool OverlappingSplits(const SEAM &other) const
◆ CombineWith()
void SEAM::CombineWith |
( |
const SEAM & |
other | ) |
|
Definition at line 60 of file seam.cpp.
61 priority_ += other.priority_;
62 location_ += other.location_;
65 for (uint8_t s = 0; s < other.num_splits_ && num_splits_ < kMaxNumSplits; ++s)
66 splits_[num_splits_++] = other.splits_[s];
◆ ContainedByBlob()
bool SEAM::ContainedByBlob |
( |
const TBLOB & |
blob | ) |
const |
|
inline |
Definition at line 79 of file seam.h.
80 for (
int s = 0; s < num_splits_; ++s) {
bool ContainedByBlob(const TBLOB &blob) const
◆ Finalize()
Definition at line 116 of file seam.h.
117 for (
int s = 0; s < num_splits_; ++s) {
◆ FindBlobWidth()
bool SEAM::FindBlobWidth |
( |
const GenericVector< TBLOB *> & |
blobs, |
|
|
int |
index, |
|
|
bool |
modify |
|
) |
| |
Definition at line 97 of file seam.cpp.
104 for (
int s = 0; s < num_splits_; ++s) {
105 const SPLIT& split = splits_[s];
108 for (
int b = index + 1; !found_split && b < blobs.
size(); ++b) {
110 if (found_split && b - index > widthp_ && modify) widthp_ = b - index;
113 for (
int b = index - 1; !found_split && b >= 0; --b) {
115 if (found_split && index - b > widthn_ && modify) widthn_ = index - b;
117 if (found_split) ++num_found;
119 return num_found == num_splits_;
bool ContainedByBlob(const TBLOB &blob) const
◆ FullPriority()
float SEAM::FullPriority |
( |
int |
xmin, |
|
|
int |
xmax, |
|
|
double |
overlap_knob, |
|
|
int |
centered_maxwidth, |
|
|
double |
center_knob, |
|
|
double |
width_change_knob |
|
) |
| const |
Definition at line 245 of file seam.cpp.
248 if (num_splits_ == 0)
return 0.0f;
249 for (
int s = 1; s < num_splits_; ++s) {
252 float full_priority =
254 splits_[0].
FullPriority(xmin, xmax, overlap_knob, centered_maxwidth,
255 center_knob, width_change_knob);
256 for (
int s = num_splits_ - 1; s >= 1; --s) {
259 return full_priority;
void UnsplitOutlines() const
void SplitOutline() const
float FullPriority(int xmin, int xmax, double overlap_knob, int centered_maxwidth, double center_knob, double width_change_knob) const
◆ HasAnySplits()
bool SEAM::HasAnySplits |
( |
| ) |
const |
|
inline |
Definition at line 67 of file seam.h.
67 {
return num_splits_ > 0; }
◆ Hide()
void SEAM::Hide |
( |
| ) |
const |
Definition at line 231 of file seam.cpp.
232 for (
int s = 0; s < num_splits_; ++s) {
◆ IsHealthy()
bool SEAM::IsHealthy |
( |
const TBLOB & |
blob, |
|
|
int |
min_points, |
|
|
int |
min_area |
|
) |
| const |
Definition at line 72 of file seam.cpp.
75 return num_splits_ == 0 || splits_[0].
IsHealthy(blob, min_points, min_area);
bool IsHealthy(const TBLOB &blob, int min_points, int min_area) const
◆ JoinPieces()
Definition at line 216 of file seam.cpp.
218 TESSLINE* outline = blobs[first]->outlines;
222 for (
int x = first; x <
last; ++x) {
223 SEAM *seam = seams[x];
224 if (x - seam->widthn_ >= first && x + seam->widthp_ <
last) seam->
Hide();
225 while (outline->
next) outline = outline->
next;
226 outline->
next = blobs[x + 1]->outlines;
◆ Mark()
Definition at line 186 of file seam.cpp.
187 for (
int s = 0; s < num_splits_; ++s) splits_[s].
Mark(window);
void Mark(ScrollView *window) const
◆ OverlappingSplits()
bool SEAM::OverlappingSplits |
( |
const SEAM & |
other | ) |
const |
|
inline |
Definition at line 103 of file seam.h.
104 for (
int s = 0; s < num_splits_; ++s) {
106 for (
int t = 0; t < other.num_splits_; ++t) {
108 if (split1_box.
y_overlap(split2_box))
return true;
TBOX bounding_box() const
bool y_overlap(const TBOX &box) const
◆ PrepareToInsertSeam()
Definition at line 82 of file seam.cpp.
85 for (
int s = 0; s < insert_index; ++s) {
88 if (!
FindBlobWidth(blobs, insert_index, modify))
return false;
89 for (
int s = insert_index; s < seams.
size(); ++s) {
90 if (!seams[s]->
FindBlobWidth(blobs, s + 1, modify))
return false;
bool FindBlobWidth(const GenericVector< TBLOB *> &blobs, int index, bool modify)
◆ Print()
void SEAM::Print |
( |
const char * |
label | ) |
const |
Definition at line 160 of file seam.cpp.
162 tprintf(
" %6.2f @ (%d,%d), p=%d, n=%d ", priority_, location_.
x, location_.
y,
164 for (
int s = 0; s < num_splits_; ++s) {
166 if (s + 1 < num_splits_)
tprintf(
", ");
DLLSYM void tprintf(const char *format,...)
◆ PrintSeams()
Definition at line 173 of file seam.cpp.
174 if (!seams.
empty()) {
176 for (
int x = 0; x < seams.
size(); ++x) {
DLLSYM void tprintf(const char *format,...)
◆ priority()
float SEAM::priority |
( |
| ) |
const |
|
inline |
◆ Reveal()
void SEAM::Reveal |
( |
| ) |
const |
Definition at line 238 of file seam.cpp.
239 for (
int s = 0; s < num_splits_; ++s) {
◆ set_priority()
void SEAM::set_priority |
( |
float |
priority | ) |
|
|
inline |
◆ SharesPosition()
bool SEAM::SharesPosition |
( |
const SEAM & |
other | ) |
const |
|
inline |
Definition at line 95 of file seam.h.
96 for (
int s = 0; s < num_splits_; ++s) {
97 for (
int t = 0; t < other.num_splits_; ++t)
bool SharesPosition(const SEAM &other) const
◆ UndoSeam()
void SEAM::UndoSeam |
( |
TBLOB * |
blob, |
|
|
TBLOB * |
other_blob |
|
) |
| const |
Definition at line 140 of file seam.cpp.
147 while (outline->
next) outline = outline->
next;
152 for (
int s = 0; s < num_splits_; ++s) {
void UnsplitOutlineList(TBLOB *blob) const
void EliminateDuplicateOutlines()
void ComputeBoundingBoxes()
◆ UsesPoint()
bool SEAM::UsesPoint |
( |
const EDGEPT * |
point | ) |
const |
|
inline |
Definition at line 88 of file seam.h.
89 for (
int s = 0; s < num_splits_; ++s) {
90 if (splits_[s].
UsesPoint(point))
return true;
bool UsesPoint(const EDGEPT *point) const
The documentation for this class was generated from the following files:
- /usr/src/tesseract-ocr.master/src/ccstruct/seam.h
- /usr/src/tesseract-ocr.master/src/ccstruct/seam.cpp