tesseract  5.0.0-alpha-619-ge9db
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 261 of file seam.cpp.

262  {
263  seam_array->truncate(0);
264  TPOINT location;
265 
266  for (int b = 1; b < word->NumBlobs(); ++b) {
267  TBOX bbox = word->blobs[b - 1]->bounding_box();
268  TBOX nbox = word->blobs[b]->bounding_box();
269  location.x = (bbox.right() + nbox.left()) / 2;
270  location.y = (bbox.bottom() + bbox.top() + nbox.bottom() + nbox.top()) / 4;
271  seam_array->push_back(new SEAM(0.0f, location));
272  }
TPOINT
Definition: blobs.h:49
TBOX::top
int16_t top() const
Definition: rect.h:57
SEAM
Definition: seam.h:36
GenericVector::push_back
int push_back(T object)
Definition: genericvector.h:799
TPOINT::x
int16_t x
Definition: blobs.h:91
TPOINT::y
int16_t y
Definition: blobs.h:92
TWERD::blobs
GenericVector< TBLOB * > blobs
Definition: blobs.h:457
TBOX::bottom
int16_t bottom() const
Definition: rect.h:64
GenericVector::truncate
void truncate(int size)
Definition: genericvector.h:132
TBOX::left
int16_t left() const
Definition: rect.h:71
TBOX::right
int16_t right() const
Definition: rect.h:78
TWERD::NumBlobs
int NumBlobs() const
Definition: blobs.h:446
TBOX
Definition: rect.h:33