diff --git a/Makefile.am b/Makefile.am index ba51594d..25d413e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -727,6 +727,9 @@ tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccstruct tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccutil tesseract_CPPFLAGS += -I$(top_srcdir)/src/dict tesseract_CPPFLAGS += -I$(top_srcdir)/src/viewer +if OPENCL +tesseract_CPPFLAGS += -I$(top_srcdir)/src/opencl +endif tesseract_CPPFLAGS += $(AM_CPPFLAGS) if VISIBILITY tesseract_CPPFLAGS += -DTESS_IMPORTS diff --git a/src/ccstruct/otsuthr.cpp b/src/ccstruct/otsuthr.cpp index 68973941..ddceecfb 100644 --- a/src/ccstruct/otsuthr.cpp +++ b/src/ccstruct/otsuthr.cpp @@ -75,7 +75,7 @@ int OtsuThreshold(Image src_pix, int left, int top, int width, int height, std:: // or to be a convincing background we must have a large fraction of H. // In between we assume this channel contains no thresholding information. int hi_value = best_omega_0 < H * 0.5; - (*thresholds)[ch] = best_t; + thresholds[ch] = best_t; if (best_omega_0 > H * 0.75) { any_good_hivalue = true; hi_values[ch] = 0; diff --git a/src/opencl/openclwrapper.cpp b/src/opencl/openclwrapper.cpp index 578f8f50..587a8c97 100644 --- a/src/opencl/openclwrapper.cpp +++ b/src/opencl/openclwrapper.cpp @@ -47,10 +47,14 @@ # endif # include +# include # include // for memset, strcpy, ... # include # include "errcode.h" // for ASSERT_HOST +# include "image.h" // for Image + +namespace tesseract { GPUEnv OpenclDevice::gpuEnv; @@ -2193,7 +2197,7 @@ static double getLineMasksMorphMicroBench(GPUEnv *env, TessScoreEvaluationInputD # endif OpenclDevice::gpuEnv = *env; OpenclDevice::initMorphCLAllocations(wpl, input.height, input.pix); - Image pix_vline = nullptr, *pix_hline = nullptr, *pix_closed = nullptr; + Image pix_vline = nullptr, pix_hline = nullptr, pix_closed = nullptr; OpenclDevice::pixGetLinesCL(nullptr, input.pix, &pix_vline, &pix_hline, &pix_closed, true, closing_brick, closing_brick, max_line_width, max_line_width, min_line_length, min_line_length); @@ -2252,8 +2256,6 @@ static double getLineMasksMorphMicroBench(GPUEnv *env, TessScoreEvaluationInputD * Device Selection *****************************************************************************/ -# include - // encode score object as byte string static ds_status serializeScore(ds_device *device, uint8_t **serializedScore, unsigned int *serializedScoreSize) { @@ -2453,4 +2455,6 @@ bool OpenclDevice::selectedDeviceIsOpenCL() { return (device.type == DS_DEVICE_OPENCL_DEVICE); } +} // namespace + #endif diff --git a/src/opencl/openclwrapper.h b/src/opencl/openclwrapper.h index 9360b0d5..fcf535ad 100644 --- a/src/opencl/openclwrapper.h +++ b/src/opencl/openclwrapper.h @@ -30,6 +30,9 @@ # include # endif +namespace tesseract { + +class Image; struct TessDeviceScore; // device type @@ -170,5 +173,7 @@ public: static bool selectedDeviceIsOpenCL(); }; +} + #endif // USE_OPENCL #endif // TESSERACT_OPENCL_OPENCLWRAPPER_H_