tesseract 4.1.1
Loading...
Searching...
No Matches
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}
int push_back(T object)
void truncate(int size)
Definition: blobs.h:51
int16_t x
Definition: blobs.h:93
int16_t y
Definition: blobs.h:94
int NumBlobs() const
Definition: blobs.h:448
GenericVector< TBLOB * > blobs
Definition: blobs.h:459
Definition: rect.h:34
int16_t top() const
Definition: rect.h:58
int16_t left() const
Definition: rect.h:72
int16_t bottom() const
Definition: rect.h:65
int16_t right() const
Definition: rect.h:79
Definition: seam.h:38