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

Method FindBestStartPt

deps/tesseract/ccstruct/blobs.cpp:299–314  ·  view source on GitHub ↗

Returns the first non-hidden EDGEPT that has a different src_outline to its predecessor, or, if all the same, the lowest indexed point.

Source from the content-addressed store, hash-verified

297// Returns the first non-hidden EDGEPT that has a different src_outline to
298// its predecessor, or, if all the same, the lowest indexed point.
299EDGEPT* TESSLINE::FindBestStartPt() const {
300 EDGEPT* best_start = loop;
301 int best_step = loop->start_step;
302 // Iterate the polygon.
303 EDGEPT* pt = loop;
304 do {
305 if (pt->IsHidden()) continue;
306 if (pt->prev->IsHidden() || pt->prev->src_outline != pt->src_outline)
307 return pt; // Qualifies as the best.
308 if (pt->start_step < best_step) {
309 best_step = pt->start_step;
310 best_start = pt;
311 }
312 } while ((pt = pt->next) != loop);
313 return best_start;
314}
315
316// Iterate the given list of outlines, converting to TESSLINE by polygonal
317// approximation and recursively any children, returning the current tail

Callers 2

ExtractFeaturesMethod · 0.80
CollectEdgesMethod · 0.80

Calls 1

IsHiddenMethod · 0.80

Tested by

no test coverage detected