MCPcopy Create free account
hub / github.com/creatale/node-dv / EliminateDuplicateOutlines

Method EliminateDuplicateOutlines

deps/tesseract/ccstruct/blobs.cpp:495–511  ·  view source on GitHub ↗

Finds and deletes any duplicate outlines in this blob, without deleting their EDGEPTs.

Source from the content-addressed store, hash-verified

493// Finds and deletes any duplicate outlines in this blob, without deleting
494// their EDGEPTs.
495void TBLOB::EliminateDuplicateOutlines() {
496 for (TESSLINE* outline = outlines; outline != NULL; outline = outline->next) {
497 TESSLINE* last_outline = outline;
498 for (TESSLINE* other_outline = outline->next; other_outline != NULL;
499 last_outline = other_outline, other_outline = other_outline->next) {
500 if (outline->SameBox(*other_outline)) {
501 last_outline->next = other_outline->next;
502 // This doesn't leak - the outlines share the EDGEPTs.
503 other_outline->loop = NULL;
504 delete other_outline;
505 other_outline = last_outline;
506 // If it is part of a cut, then it can't be a hole any more.
507 outline->is_hole = false;
508 }
509 }
510 }
511}
512
513// Swaps the outlines of *this and next if needed to keep the centers in
514// increasing x.

Callers 2

ApplySeamMethod · 0.80
UndoSeamMethod · 0.80

Calls 1

SameBoxMethod · 0.80

Tested by

no test coverage detected