提交 cec10372 编写于 作者: R Ray Smith

Fixed BestPix to always return the highest resolution available, even if a...

Fixed BestPix to always return the highest resolution available, even if a lower bit depth than the original
上级 66e686a0
......@@ -206,14 +206,22 @@ class Tesseract : public Wordrec {
sub_langs_[i]->set_pix_original(original_pix ? pixClone(original_pix)
: nullptr);
}
// Returns a pointer to a Pix representing the best available (original) image
// of the page. Can be of any bit depth, but never color-mapped, as that has
// always been dealt with. Note that in grey and color, 0 is black and 255 is
// Returns a pointer to a Pix representing the best available resolution image
// of the page, with best available bit depth as second priority. Result can
// be of any bit depth, but never color-mapped, as that has always been
// removed. Note that in grey and color, 0 is black and 255 is
// white. If the input was binary, then black is 1 and white is 0.
// To tell the difference pixGetDepth() will return 32, 8 or 1.
// In any case, the return value is a borrowed Pix, and should not be
// deleted or pixDestroyed.
Pix* BestPix() const { return pix_original_; }
Pix* BestPix() const {
if (pixGetWidth(pix_original_) == ImageWidth())
return pix_original_;
else if (pix_grey_ != NULL)
return pix_grey_;
else
return pix_binary_;
}
void set_pix_thresholds(Pix* thresholds) {
pixDestroy(&pix_thresholds_);
pix_thresholds_ = thresholds;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册