src/textord/textlineprojection.cpp
bool TextlineProjection::BoxOutOfHTextline(const TBOX &box, const DENORM *denorm,
                                           bool debug) const {
  int grad1 = 0;
  int grad2 = 0;
  EvaluateBoxInternal(box, denorm, debug, &grad1, &grad2, nullptr, nullptr);
  int worst_result = std::min(grad1, grad2);
  int total_result = grad1 + grad2;
  if (total_result >= 6) {
    return false; // Strongly in textline.
  }
  // Medium strength: if either gradient is negative, it is likely outside
  // the body of the textline.
  if (worst_result < 0) {
    return true;
  }
  return false;
}
// Returns true if the blob appears to be outside of a textline.
// Such blobs are potentially diacritics (even if large in Thai) and should
// be kept away from initial textline finding.
Returns true if the blob appears to be outside of a textline.
Such blobs are potentially diacritics (even if large in Thai) and should
be kept away from initial textline finding.
Returns true if the blob appears to be outside of a textline . Such blobs are potentially diacritics ( even if large in Thai ) and should be kept away from initial textline finding .
bool TextlineProjection::BoxOutOfHTextline(const TBOX &box, const DENORM *denorm,
                                           bool debug) const {
  int grad1 = 0;
  int grad2 = 0;
  EvaluateBoxInternal(box, denorm, debug, &grad1, &grad2, nullptr, nullptr);
  int worst_result = std::min(grad1, grad2);
  int total_result = grad1 + grad2;
  if (total_result >= 6) {
    return false; 
  }
  if (worst_result < 0) {
    return true;
  }
  return false;
}
bool TextlineProjection :: BoxOutOfHTextline ( const TBOX & box , const DENORM * denorm , bool debug ) const { int grad1 = 0 ; int grad2 = 0 ; EvaluateBoxInternal ( box , denorm , debug , & grad1 , & grad2 , nullptr , nullptr ) ; int worst_result = std :: min ( grad1 , grad2 ) ; int total_result = grad1 + grad2 ; if ( total_result >= 6 ) { return false ; } if ( worst_result < 0 ) { return true ; } return false ; }
Returns true if the blob appears to be outside of a textline.
Returns true if the blob appears to be outside of a textline .
// Strongly in textline. // Medium strength: if either gradient is negative, it is likely outside // the body of the textline.