#include <cstdint>
#include <cstring>
#include "clst.h"
#include <tesseract/genericvector.h>
#include "normalis.h"
#include "points.h"
#include <tesseract/publictypes.h>
#include "rect.h"
#include "scrollview.h"
Go to the source code of this file.
◆ EDGEPTFLAGS
#define EDGEPTFLAGS 4 /*concavity,length etc. */ |
◆ VECTOR
◆ divide_blobs()
void divide_blobs |
( |
TBLOB * |
blob, |
|
|
TBLOB * |
other_blob, |
|
|
bool |
italic_blob, |
|
|
const TPOINT & |
location |
|
) |
| |
Definition at line 958 of file blobs.cpp.
970 int location_prod = location.
cross(vertical);
972 while (outline !=
nullptr) {
976 int mid_prod = mid_pt.cross(vertical);
977 if (mid_prod < location_prod) {
980 outline1->
next = outline;
987 outline2->
next = outline;
992 outline = outline->
next;
◆ divisible_blob()
bool divisible_blob |
( |
TBLOB * |
blob, |
|
|
bool |
italic_blob, |
|
|
TPOINT * |
location |
|
) |
| |
Definition at line 910 of file blobs.cpp.
919 outline1 = outline1->
next) {
920 if (outline1->is_hole)
continue;
922 static_cast<int16_t>((outline1->topleft.x + outline1->botright.x) / 2),
923 static_cast<int16_t>((outline1->topleft.y + outline1->botright.y) / 2));
924 int mid_prod1 = mid_pt1.cross(vertical);
925 int min_prod1, max_prod1;
926 outline1->MinMaxCrossProduct(vertical, &min_prod1, &max_prod1);
927 for (
TESSLINE* outline2 = outline1->
next; outline2 !=
nullptr;
928 outline2 = outline2->
next) {
929 if (outline2->is_hole)
continue;
930 TPOINT mid_pt2(static_cast<int16_t>(
931 (outline2->topleft.x + outline2->botright.x) / 2),
932 static_cast<int16_t>(
933 (outline2->topleft.y + outline2->botright.y) / 2));
934 int mid_prod2 = mid_pt2.cross(vertical);
935 int min_prod2, max_prod2;
936 outline2->MinMaxCrossProduct(vertical, &min_prod2, &max_prod2);
937 int mid_gap = abs(mid_prod2 - mid_prod1);
939 std::min(max_prod1, max_prod2) - std::max(min_prod1, min_prod2);
940 if (mid_gap - overlap / 4 > max_gap) {
941 max_gap = mid_gap - overlap / 4;
943 *location += mid_pt2;