tesseract  4.1.1
seam.cpp File Reference
#include "seam.h"
#include "blobs.h"
#include "tprintf.h"

Go to the source code of this file.

Functions

start_seam_list

Initialize a list of seams that match the original number of blobs present in the starting segmentation. Each of the seams created by this routine have location information only.

void start_seam_list (TWERD *word, GenericVector< SEAM * > *seam_array)
 

Function Documentation

◆ start_seam_list()

void start_seam_list ( TWERD word,
GenericVector< SEAM * > *  seam_array 
)

Definition at line 263 of file seam.cpp.

263  {
264  seam_array->truncate(0);
265  TPOINT location;
266 
267  for (int b = 1; b < word->NumBlobs(); ++b) {
268  TBOX bbox = word->blobs[b - 1]->bounding_box();
269  TBOX nbox = word->blobs[b]->bounding_box();
270  location.x = (bbox.right() + nbox.left()) / 2;
271  location.y = (bbox.bottom() + bbox.top() + nbox.bottom() + nbox.top()) / 4;
272  seam_array->push_back(new SEAM(0.0f, location));
273  }
274 }
TBOX
Definition: rect.h:34
TWERD::NumBlobs
int NumBlobs() const
Definition: blobs.h:448
GenericVector::truncate
void truncate(int size)
Definition: genericvector.h:137
TPOINT::y
int16_t y
Definition: blobs.h:94
TBOX::right
int16_t right() const
Definition: rect.h:79
TWERD::blobs
GenericVector< TBLOB * > blobs
Definition: blobs.h:459
TPOINT
Definition: blobs.h:51
TBOX::left
int16_t left() const
Definition: rect.h:72
TBOX::top
int16_t top() const
Definition: rect.h:58
TPOINT::x
int16_t x
Definition: blobs.h:93
TBOX::bottom
int16_t bottom() const
Definition: rect.h:65
SEAM
Definition: seam.h:38
GenericVector::push_back
int push_back(T object)
Definition: genericvector.h:837