mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-13 06:08:52 +08:00
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:
parent
23b29fbe9a
commit
12ddf5d18e
@ -253,6 +253,7 @@ libdir = @libdir@
|
|||||||
libexecdir = @libexecdir@
|
libexecdir = @libexecdir@
|
||||||
localedir = @localedir@
|
localedir = @localedir@
|
||||||
localstatedir = @localstatedir@
|
localstatedir = @localstatedir@
|
||||||
|
lt_ECHO = @lt_ECHO@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
mkdir_p = @mkdir_p@
|
mkdir_p = @mkdir_p@
|
||||||
oldincludedir = @oldincludedir@
|
oldincludedir = @oldincludedir@
|
||||||
|
@ -213,7 +213,7 @@ ScrollView* AlignedBlob::DisplayTabs(const char* window_name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tab_win->Update();
|
tab_win->Update();
|
||||||
#endif
|
#endif
|
||||||
return tab_win;
|
return tab_win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,4 +336,3 @@ Boxa* LineFinder::GetHLineBoxes(int resolution, Pix* src_pix, Pix** line_pix) {
|
|||||||
|
|
||||||
} // namespace tesseract.
|
} // namespace tesseract.
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,4 +121,3 @@ class LineFinder {
|
|||||||
|
|
||||||
#endif // TESSERACT_TEXTORD_LINEFIND_H__
|
#endif // TESSERACT_TEXTORD_LINEFIND_H__
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class FPSEGPT:public ELIST_LINK
|
|||||||
}
|
}
|
||||||
|
|
||||||
//faked split point
|
//faked split point
|
||||||
NEWDELETE2 (FPSEGPT) BOOL8 faked;
|
BOOL8 faked;
|
||||||
BOOL8 terminal; //successful end
|
BOOL8 terminal; //successful end
|
||||||
inT16 fake_count; //total fakes to here
|
inT16 fake_count; //total fakes to here
|
||||||
|
|
||||||
|
@ -1049,6 +1049,26 @@ static void CountNeighbourTypes(BLOBNBOX_CLIST* neighbours,
|
|||||||
// is clear-cut based on a distance margin. Good for isolating vertical
|
// is clear-cut based on a distance margin. Good for isolating vertical
|
||||||
// text from neighbouring horizontal text.
|
// text from neighbouring horizontal text.
|
||||||
void StrokeWidth::SimplifyObviousNeighbours(BLOBNBOX* blob) {
|
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 margin = gridsize() / 2;
|
||||||
int h_min, h_max, v_min, v_max;
|
int h_min, h_max, v_min, v_max;
|
||||||
blob->MinMaxGapsClipped(&h_min, &h_max, &v_min, &v_max);
|
blob->MinMaxGapsClipped(&h_min, &h_max, &v_min, &v_max);
|
||||||
|
Loading…
Reference in New Issue
Block a user