本文整理汇总了C++中EDGEPT::IsHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ EDGEPT::IsHidden方法的具体用法?C++ EDGEPT::IsHidden怎么用?C++ EDGEPT::IsHidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDGEPT
的用法示例。
在下文中一共展示了EDGEPT::IsHidden方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertOutline
/** Convert a TESSLINE into the float-based MFOUTLINE micro-feature format. */
MFOUTLINE ConvertOutline(TESSLINE *outline) {
MFEDGEPT *NewPoint;
MFOUTLINE MFOutline = NIL_LIST;
EDGEPT *EdgePoint;
EDGEPT *StartPoint;
EDGEPT *NextPoint;
if (outline == NULL || outline->loop == NULL)
return MFOutline;
StartPoint = outline->loop;
EdgePoint = StartPoint;
do {
NextPoint = EdgePoint->next;
/* filter out duplicate points */
if (EdgePoint->pos.x != NextPoint->pos.x ||
EdgePoint->pos.y != NextPoint->pos.y) {
NewPoint = NewEdgePoint();
ClearMark(NewPoint);
NewPoint->Hidden = EdgePoint->IsHidden();
NewPoint->Point.x = EdgePoint->pos.x;
NewPoint->Point.y = EdgePoint->pos.y;
MFOutline = push(MFOutline, NewPoint);
}
EdgePoint = NextPoint;
} while (EdgePoint != StartPoint);
if (MFOutline != NULL)
MakeOutlineCircular(MFOutline);
return MFOutline;
}
示例2: CollectEdges
// For all the edge steps in all the outlines, or polygonal approximation
// where there are no edge steps, collects the steps into the bounding_box,
// llsq and/or the x_coords/y_coords. Both are used in different kinds of
// normalization.
// For a description of x_coords, y_coords, see GetEdgeCoords above.
void TBLOB::CollectEdges(const TBOX& box,
TBOX* bounding_box, LLSQ* llsq,
GenericVector<GenericVector<int> >* x_coords,
GenericVector<GenericVector<int> >* y_coords) const {
// Iterate the outlines.
for (const TESSLINE* ol = outlines; ol != NULL; ol = ol->next) {
// Iterate the polygon.
EDGEPT* loop_pt = ol->FindBestStartPt();
EDGEPT* pt = loop_pt;
if (pt == NULL) continue;
do {
if (pt->IsHidden()) continue;
// Find a run of equal src_outline.
EDGEPT* last_pt = pt;
do {
last_pt = last_pt->next;
} while (last_pt != loop_pt && !last_pt->IsHidden() &&
last_pt->src_outline == pt->src_outline);
last_pt = last_pt->prev;
CollectEdgesOfRun(pt, last_pt, denorm_, box,
bounding_box, llsq, x_coords, y_coords);
pt = last_pt;
} while ((pt = pt->next) != loop_pt);
}
}
示例3: FindBestStartPt
// Returns the first non-hidden EDGEPT that has a different src_outline to
// its predecessor, or, if all the same, the lowest indexed point.
EDGEPT* TESSLINE::FindBestStartPt() const {
EDGEPT* best_start = loop;
int best_step = loop->start_step;
// Iterate the polygon.
EDGEPT* pt = loop;
do {
if (pt->IsHidden()) continue;
if (pt->prev->IsHidden() || pt->prev->src_outline != pt->src_outline)
return pt; // Qualifies as the best.
if (pt->start_step < best_step) {
best_step = pt->start_step;
best_start = pt;
}
} while ((pt = pt->next) != loop);
return best_start;
}
示例4: plot
void TESSLINE::plot(ScrollView* window, ScrollView::Color color,
ScrollView::Color child_color) {
if (is_hole)
window->Pen(child_color);
else
window->Pen(color);
window->SetCursor(start.x, start.y);
EDGEPT* pt = loop;
do {
bool prev_hidden = pt->IsHidden();
pt = pt->next;
if (prev_hidden)
window->SetCursor(pt->pos.x, pt->pos.y);
else
window->DrawTo(pt->pos.x, pt->pos.y);
} while (pt != loop);
}
示例5: ExtractFeatures
// Extracts sets of 3-D features of length kStandardFeatureLength (=12.8), as
// (x,y) position and angle as measured counterclockwise from the vector
// <-1, 0>, from blob using two normalizations defined by bl_denorm and
// cn_denorm. See SetpuBLCNDenorms for definitions.
// If outline_cn_counts is not nullptr, on return it contains the cumulative
// number of cn features generated for each outline in the blob (in order).
// Thus after the first outline, there were (*outline_cn_counts)[0] features,
// after the second outline, there were (*outline_cn_counts)[1] features etc.
void Classify::ExtractFeatures(const TBLOB& blob,
bool nonlinear_norm,
GenericVector<INT_FEATURE_STRUCT>* bl_features,
GenericVector<INT_FEATURE_STRUCT>* cn_features,
INT_FX_RESULT_STRUCT* results,
GenericVector<int>* outline_cn_counts) {
DENORM bl_denorm, cn_denorm;
tesseract::Classify::SetupBLCNDenorms(blob, nonlinear_norm,
&bl_denorm, &cn_denorm, results);
if (outline_cn_counts != nullptr)
outline_cn_counts->truncate(0);
// Iterate the outlines.
for (TESSLINE* ol = blob.outlines; ol != nullptr; ol = ol->next) {
// Iterate the polygon.
EDGEPT* loop_pt = ol->FindBestStartPt();
EDGEPT* pt = loop_pt;
if (pt == nullptr) continue;
do {
if (pt->IsHidden()) continue;
// Find a run of equal src_outline.
EDGEPT* last_pt = pt;
do {
last_pt = last_pt->next;
} while (last_pt != loop_pt && !last_pt->IsHidden() &&
last_pt->src_outline == pt->src_outline);
last_pt = last_pt->prev;
// Until the adaptive classifier can be weaned off polygon segments,
// we have to force extraction from the polygon for the bl_features.
ExtractFeaturesFromRun(pt, last_pt, bl_denorm, kStandardFeatureLength,
true, bl_features);
ExtractFeaturesFromRun(pt, last_pt, cn_denorm, kStandardFeatureLength,
false, cn_features);
pt = last_pt;
} while ((pt = pt->next) != loop_pt);
if (outline_cn_counts != nullptr)
outline_cn_counts->push_back(cn_features->size());
}
results->NumBL = bl_features->size();
results->NumCN = cn_features->size();
results->YBottom = blob.bounding_box().bottom();
results->YTop = blob.bounding_box().top();
results->Width = blob.bounding_box().width();
}