mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-11 23:19:04 +08:00
Fix ImageThresholder::OtsuThresholdRectToPix for OpenCL
The ThresholdRectToPix OpenCL kernel only supports 4 channels. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
c044b8c916
commit
8af80b7ba6
@ -273,8 +273,8 @@ void ImageThresholder::OtsuThresholdRectToPix(Pix* src_pix,
|
||||
// only use opencl if compiled w/ OpenCL and selected device is opencl
|
||||
#ifdef USE_OPENCL
|
||||
OpenclDevice od;
|
||||
if ((num_channels == 4 || num_channels == 1) &&
|
||||
od.selectedDeviceIsOpenCL() && rect_top_ == 0 && rect_left_ == 0 ) {
|
||||
if (num_channels == 4 &&
|
||||
od.selectedDeviceIsOpenCL() && rect_top_ == 0 && rect_left_ == 0) {
|
||||
od.ThresholdRectToPixOCL((unsigned char*)pixGetData(src_pix), num_channels,
|
||||
pixGetWpl(src_pix) * 4, thresholds, hi_values,
|
||||
out_pix /*pix_OCL*/, rect_height_, rect_width_,
|
||||
|
Loading…
Reference in New Issue
Block a user