本文整理汇总了C++中BLOB_CHOICE::yshift方法的典型用法代码示例。如果您正苦于以下问题:C++ BLOB_CHOICE::yshift方法的具体用法?C++ BLOB_CHOICE::yshift怎么用?C++ BLOB_CHOICE::yshift使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLOB_CHOICE
的用法示例。
在下文中一共展示了BLOB_CHOICE::yshift方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PosAndSizeAgree
// Returns true if *this and other agree on the baseline and x-height
// to within some tolerance based on a given estimate of the x-height.
bool BLOB_CHOICE::PosAndSizeAgree(const BLOB_CHOICE& other, float x_height,
bool debug) const {
double baseline_diff = fabs(yshift() - other.yshift());
if (baseline_diff > kMaxBaselineDrift * x_height) {
if (debug) {
tprintf("Baseline diff %g for %d v %d\n",
baseline_diff, unichar_id_, other.unichar_id_);
}
return false;
}
double this_range = max_xheight() - min_xheight();
double other_range = other.max_xheight() - other.min_xheight();
double denominator = ClipToRange(MIN(this_range, other_range),
1.0, kMaxOverlapDenominator * x_height);
double overlap = MIN(max_xheight(), other.max_xheight()) -
MAX(min_xheight(), other.min_xheight());
overlap /= denominator;
if (debug) {
tprintf("PosAndSize for %d v %d: bl diff = %g, ranges %g, %g / %g ->%g\n",
unichar_id_, other.unichar_id_, baseline_diff,
this_range, other_range, denominator, overlap);
}
return overlap >= kMinXHeightMatch;
}
示例2:
/**
* BLOB_CHOICE::BLOB_CHOICE
*
* Constructor to build a BLOB_CHOICE from another BLOB_CHOICE.
*/
BLOB_CHOICE::BLOB_CHOICE(const BLOB_CHOICE &other) {
unichar_id_ = other.unichar_id();
rating_ = other.rating();
certainty_ = other.certainty();
fontinfo_id_ = other.fontinfo_id();
fontinfo_id2_ = other.fontinfo_id2();
script_id_ = other.script_id();
matrix_cell_ = other.matrix_cell_;
min_xheight_ = other.min_xheight_;
max_xheight_ = other.max_xheight_;
yshift_ = other.yshift();
classifier_ = other.classifier_;
}