mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-19 23:19:07 +08:00
Fix regression (broken unit tests)
Fixes: 95019a8c
("fix issue #3940 - remove colormap before thresholding")
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
1ae0ec9a82
commit
23613c5c24
@ -293,8 +293,8 @@ bool ImageThresholder::ThresholdToPix(Image *pix) {
|
||||
// allows the caller to modify the output.
|
||||
*pix = original.copy();
|
||||
} else {
|
||||
Image tmp;
|
||||
if (pixGetColormap(original)) {
|
||||
Image tmp;
|
||||
Image without_cmap =
|
||||
pixRemoveColormap(original, REMOVE_CMAP_BASED_ON_SRC);
|
||||
int depth = pixGetDepth(without_cmap);
|
||||
@ -304,9 +304,11 @@ bool ImageThresholder::ThresholdToPix(Image *pix) {
|
||||
tmp = without_cmap.copy();
|
||||
}
|
||||
without_cmap.destroy();
|
||||
OtsuThresholdRectToPix(tmp, pix);
|
||||
tmp.destroy();
|
||||
} else {
|
||||
OtsuThresholdRectToPix(pix_, pix);
|
||||
}
|
||||
OtsuThresholdRectToPix(tmp, pix);
|
||||
tmp.destroy();
|
||||
}
|
||||
original.destroy();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user