Skip to content

Commit 8af80b7

Browse files
committed
Fix ImageThresholder::OtsuThresholdRectToPix for OpenCL
The ThresholdRectToPix OpenCL kernel only supports 4 channels. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent c044b8c commit 8af80b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ccmain/thresholder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ void ImageThresholder::OtsuThresholdRectToPix(Pix* src_pix,
273273
// only use opencl if compiled w/ OpenCL and selected device is opencl
274274
#ifdef USE_OPENCL
275275
OpenclDevice od;
276-
if ((num_channels == 4 || num_channels == 1) &&
277-
od.selectedDeviceIsOpenCL() && rect_top_ == 0 && rect_left_ == 0 ) {
276+
if (num_channels == 4 &&
277+
od.selectedDeviceIsOpenCL() && rect_top_ == 0 && rect_left_ == 0) {
278278
od.ThresholdRectToPixOCL((unsigned char*)pixGetData(src_pix), num_channels,
279279
pixGetWpl(src_pix) * 4, thresholds, hi_values,
280280
out_pix /*pix_OCL*/, rect_height_, rect_width_,

0 commit comments

Comments
 (0)