tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
52 TPOINT(int16_t vx, int16_t vy) :
x(vx),
y(vy) {}
64 return x == other.
x &&
y == other.
y;
79 return x * other.
y -
y * other.
x;
84 return x * other.
x +
y * other.
y;
124 return x_dist * x_dist * x_factor + y_dist * y_dist;
139 }
while (pt != end && pt !=
this);
151 }
while (pt != end && pt !=
this);
161 if (pt == end)
return true;
164 }
while (pt !=
this &&
count <= min_points);
176 return flags[0] != 0;
182 return flags[2] != 0;
203 TESSLINE() : is_hole(false), loop(nullptr), next(nullptr) {}
223 void Rotate(
const FCOORD rotation);
225 void Move(
const ICOORD vec);
227 void Scale(
float factor);
231 void ComputeBoundingBox();
237 void MinMaxCrossProduct(
const TPOINT vec,
int* min_xp,
int* max_xp)
const;
239 TBOX bounding_box()
const;
241 bool SameBox(
const TESSLINE& other)
const {
245 bool SegmentCrosses(
const TPOINT& pt1,
const TPOINT& pt2)
const {
246 if (Contains(pt1) && Contains(pt2)) {
251 }
while (pt != loop);
256 bool Contains(
const TPOINT& pt)
const {
257 return topleft.x <= pt.
x && pt.
x <= botright.x &&
258 botright.y <= pt.
y && pt.
y <= topleft.y;
261 #ifndef GRAPHICS_DISABLED
264 #endif // GRAPHICS_DISABLED
268 EDGEPT* FindBestStartPt()
const;
272 return (botright.x - topleft.x) * (topleft.y - botright.y);
318 const DENORM* predecessor,
319 float x_origin,
float y_origin,
320 float x_scale,
float y_scale,
321 float final_xshift,
float final_yshift,
322 bool inverse, Pix* pix);
328 void Scale(
float factor);
340 outline = outline->
next) {
341 if (outline->SegmentCrosses(pt1, pt2))
return true;
348 outline = outline->
next) {
349 if (outline->Contains(pt))
return true;
366 #ifndef GRAPHICS_DISABLED
369 #endif // GRAPHICS_DISABLED
374 total_area += outline->BBArea();
407 void CollectEdges(
const TBOX& box,
435 float x_height,
float baseline_shift,
bool numeric_mode,
437 const TBOX* norm_box,
int SegmentArea(const EDGEPT *end) const
TBLOB * ClassifyNormalizeIfNeeded() const
void MergeBlobs(int start, int end)
void ComputeBoundingBoxes()
void Normalize(float *Values)
TWERD & operator=(const TWERD &src)
static TBLOB * ShallowCopy(const TBLOB &src)
bool EqualPos(const EDGEPT &other) const
EDGEPT & operator=(const EDGEPT &src)
TPOINT(int16_t vx, int16_t vy)
TESSLINE(const TESSLINE &src)
const DENORM & denorm() const
void plot(ScrollView *window, ScrollView::Color color, ScrollView::Color child_color)
int ComputeMoments(FCOORD *center, FCOORD *second_moments) const
TBLOB & operator=(const TBLOB &src)
void ComputeBoundingBoxes()
bool Contains(const TPOINT &pt) const
bool divisible_blob(TBLOB *blob, bool italic_blob, TPOINT *location)
void CopyFrom(const TWERD &src)
int dot(const TPOINT &other) const
CLISTIZEH(STRING) CLISTIZE(STRING) namespace tesseract
GenericVector< TBLOB * > blobs
TBOX SegmentBox(const EDGEPT *end) const
void diff(const TPOINT &p1, const TPOINT &p2)
static TWERD * PolygonalCopy(bool allow_detailed_fx, WERD *src)
static TBLOB * PolygonalCopy(bool allow_detailed_fx, C_BLOB *src)
void Normalize(const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift, bool inverse, Pix *pix)
void GetPreciseBoundingBox(TBOX *precise_box) const
void BLNormalize(const BLOCK *block, const ROW *row, Pix *pix, bool inverse, float x_height, float baseline_shift, bool numeric_mode, tesseract::OcrEngineMode hint, const TBOX *norm_box, DENORM *word_denorm)
static bool IsCrossed(const TPOINT &a0, const TPOINT &a1, const TPOINT &b0, const TPOINT &b1)
bool ShortNonCircularSegment(int min_points, const EDGEPT *end) const
TBOX bounding_box() const
void EliminateDuplicateOutlines()
int WeightedDistance(const EDGEPT &other, int x_factor) const
int cross(const TPOINT &other) const
bool operator==(const TPOINT &other) const
void operator+=(const TPOINT &other)
void CorrectBlobOrder(TBLOB *next)
void Rotate(const FCOORD rotation)
void divide_blobs(TBLOB *blob, TBLOB *other_blob, bool italic_blob, const TPOINT &location)
void operator/=(int divisor)
void GetEdgeCoords(const TBOX &box, GenericVector< GenericVector< int > > *x_coords, GenericVector< GenericVector< int > > *y_coords) const
void CopyFrom(const TBLOB &src)
void plot(ScrollView *window)
TBOX bounding_box() const
void Move(const ICOORD vec)
void CopyFrom(const EDGEPT &src)
bool SegmentCrossesOutline(const TPOINT &pt1, const TPOINT &pt2) const