Removal of NEWDELETE + fix of problem with joined text

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@536 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
theraysmith 2010-11-30 01:03:21 +00:00
parent 23b29fbe9a
commit 12ddf5d18e
6 changed files with 23 additions and 4 deletions

View File

@ -253,6 +253,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@

View File

@ -213,7 +213,7 @@ ScrollView* AlignedBlob::DisplayTabs(const char* window_name,
}
}
tab_win->Update();
#endif
#endif
return tab_win;
}

View File

@ -336,4 +336,3 @@ Boxa* LineFinder::GetHLineBoxes(int resolution, Pix* src_pix, Pix** line_pix) {
} // namespace tesseract.

View File

@ -121,4 +121,3 @@ class LineFinder {
#endif // TESSERACT_TEXTORD_LINEFIND_H__

View File

@ -68,7 +68,7 @@ class FPSEGPT:public ELIST_LINK
}
//faked split point
NEWDELETE2 (FPSEGPT) BOOL8 faked;
BOOL8 faked;
BOOL8 terminal; //successful end
inT16 fake_count; //total fakes to here

View File

@ -1049,6 +1049,26 @@ static void CountNeighbourTypes(BLOBNBOX_CLIST* neighbours,
// is clear-cut based on a distance margin. Good for isolating vertical
// text from neighbouring horizontal text.
void StrokeWidth::SimplifyObviousNeighbours(BLOBNBOX* blob) {
// Case 1: We have text that is likely several characters, blurry and joined
// together.
if ((blob->bounding_box().width() > 3 * blob->area_stroke_width() &&
blob->bounding_box().height() > 3 * blob->area_stroke_width())) {
// The blob is complex (not stick-like).
if (blob->bounding_box().width() > 4 * blob->bounding_box().height()) {
// Horizontal conjoined text.
blob->set_neighbour(BND_ABOVE, NULL, false);
blob->set_neighbour(BND_BELOW, NULL, false);
return;
}
if (blob->bounding_box().height() > 4 * blob->bounding_box().width()) {
// Vertical conjoined text.
blob->set_neighbour(BND_LEFT, NULL, false);
blob->set_neighbour(BND_RIGHT, NULL, false);
return;
}
}
// Case 2: This blob is likely a single character.
int margin = gridsize() / 2;
int h_min, h_max, v_min, v_max;
blob->MinMaxGapsClipped(&h_min, &h_max, &v_min, &v_max);