All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

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

Definition at line 269 of file seam.cpp.

269  {
270  seam_array->truncate(0);
271  TPOINT location;
272 
273  for (int b = 1; b < word->NumBlobs(); ++b) {
274  TBOX bbox = word->blobs[b - 1]->bounding_box();
275  TBOX nbox = word->blobs[b]->bounding_box();
276  location.x = (bbox.right() + nbox.left()) / 2;
277  location.y = (bbox.bottom() + bbox.top() + nbox.bottom() + nbox.top()) / 4;
278  seam_array->push_back(new SEAM(0.0f, location));
279  }
280 }
void truncate(int size)
int push_back(T object)
inT16 y
Definition: blobs.h:72
inT16 right() const
Definition: rect.h:75
int NumBlobs() const
Definition: blobs.h:425
inT16 left() const
Definition: rect.h:68
Definition: blobs.h:50
inT16 x
Definition: blobs.h:71
inT16 bottom() const
Definition: rect.h:61
GenericVector< TBLOB * > blobs
Definition: blobs.h:436
Definition: rect.h:30
Definition: seam.h:44
inT16 top() const
Definition: rect.h:54