mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 14:41:36 +08:00
Merged with commit 4ca6ba985b
This commit is contained in:
commit
9c7e99b041
@ -818,14 +818,14 @@ int Classify::GetAdaptiveFeatures(TBLOB *Blob,
|
||||
classify_norm_method.set_value(baseline);
|
||||
Features = ExtractPicoFeatures(Blob);
|
||||
|
||||
*FloatFeatures = Features;
|
||||
|
||||
NumFeatures = Features->NumFeatures;
|
||||
if (NumFeatures > UNLIKELY_NUM_FEAT) {
|
||||
FreeFeatureSet(Features);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ComputeIntFeatures(Features, IntFeatures);
|
||||
*FloatFeatures = Features;
|
||||
|
||||
return NumFeatures;
|
||||
} /* GetAdaptiveFeatures */
|
||||
|
11
configure.ac
11
configure.ac
@ -75,6 +75,7 @@ AM_CONDITIONAL([T_WIN], false)
|
||||
AM_CONDITIONAL([MINGW], false)
|
||||
AM_CONDITIONAL([OSX], false)
|
||||
AM_CONDITIONAL([GRAPHICS_DISABLED], false)
|
||||
AC_SUBST([AM_CPPFLAGS])
|
||||
|
||||
OPENCL_INC="/opt/AMDAPP/include"
|
||||
OPENCL_LIBS="-lOpenCL -ltiff"
|
||||
@ -154,7 +155,7 @@ AC_ARG_ENABLE([cube],
|
||||
AC_MSG_RESULT([$disable_cube])
|
||||
AM_CONDITIONAL([NO_CUBE_BUILD], [test "$disable_cube" = "yes"])
|
||||
if test "$disable_cube" = "yes"; then
|
||||
AC_SUBST([AM_CPPFLAGS], [-DNO_CUBE_BUILD])
|
||||
AM_CPPFLAGS="-DNO_CUBE_BUILD $AM_CPPFLAGS"
|
||||
fi
|
||||
|
||||
# check whether to build embedded version
|
||||
@ -166,7 +167,7 @@ AC_ARG_ENABLE([embedded],
|
||||
AC_MSG_RESULT([$enable_embedded])
|
||||
AM_CONDITIONAL([EMBEDDED], [test "$enable_embedded" = "yes"])
|
||||
if test "$enable_embedded" = "yes"; then
|
||||
AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
|
||||
AM_CPPFLAGS="-DEMBEDDED $AM_CPPFLAGS"
|
||||
fi
|
||||
|
||||
# check whether to build OpenMP support
|
||||
@ -174,7 +175,7 @@ AM_CONDITIONAL([OPENMP], false)
|
||||
AC_OPENMP
|
||||
AS_IF([test "x$OPENMP_CFLAGS" != "x"],
|
||||
[AM_CONDITIONAL([OPENMP], true)
|
||||
AC_SUBST([AM_CPPFLAGS], ["$OPENMP_CXXFLAGS"])
|
||||
AM_CPPFLAGS="$OPENMP_CXXFLAGS $AM_CPPFLAGS"
|
||||
AC_DEFINE([OPENMP], [], [Defined when compiled with OpenMP support])]
|
||||
)
|
||||
|
||||
@ -227,7 +228,7 @@ case "${host_os}" in
|
||||
if !($have_opencl_lib); then
|
||||
AC_MSG_ERROR([Required OpenCL library not found!])
|
||||
fi
|
||||
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
|
||||
AM_CPPFLAGS="-DUSE_OPENCL $AM_CPPFLAGS"
|
||||
OPENCL_CPPFLAGS=""
|
||||
OPENCL_LDFLAGS="-framework OpenCL"
|
||||
fi
|
||||
@ -246,7 +247,7 @@ case "${host_os}" in
|
||||
if !($have_tiff); then
|
||||
AC_MSG_ERROR([Required TIFF headers not found! Try to install libtiff-dev?? package.])
|
||||
fi
|
||||
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
|
||||
AM_CPPFLAGS="-DUSE_OPENCL $AM_CPPFLAGS"
|
||||
OPENCL_CPPFLAGS="-I${OPENCL_INC}"
|
||||
OPENCL_LDFLAGS="${OPENCL_LIBS}"
|
||||
fi
|
||||
|
@ -589,19 +589,5 @@ cleanup:
|
||||
return status;
|
||||
}
|
||||
|
||||
static ds_status getNumDeviceWithEmptyScore(ds_profile* profile,
|
||||
unsigned int* num) {
|
||||
unsigned int i;
|
||||
if (profile == NULL || num==NULL)
|
||||
return DS_MEMORY_ERROR;
|
||||
*num=0;
|
||||
for (i = 0; i < profile->numDevices; i++) {
|
||||
if (profile->devices[i].score == NULL) {
|
||||
*num++;
|
||||
}
|
||||
}
|
||||
return DS_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -458,7 +458,8 @@ int OpenclDevice::GeneratBinFromKernelSource( cl_program program, const char * c
|
||||
{
|
||||
unsigned int i = 0;
|
||||
cl_int clStatus;
|
||||
size_t *binarySizes, numDevices = 0;
|
||||
size_t *binarySizes;
|
||||
cl_uint numDevices;
|
||||
cl_device_id *mpArryDevsID;
|
||||
char **binaries, *str = NULL;
|
||||
|
||||
@ -591,7 +592,7 @@ int OpenclDevice::CompileKernelFile( GPUEnv *gpuInfo, const char *buildOption )
|
||||
const char *source;
|
||||
size_t source_size[1];
|
||||
int b_error, binary_status, binaryExisted, idx;
|
||||
size_t numDevices;
|
||||
cl_uint numDevices;
|
||||
cl_device_id *mpArryDevsID;
|
||||
FILE *fd, *fd1;
|
||||
const char* filename = "kernel.cl";
|
||||
@ -1132,6 +1133,7 @@ OpenclDevice::pixReadMemTiffCl(const l_uint8 *data,size_t size,l_int32 n)
|
||||
// L_MEMSTREAM *memStream;
|
||||
PROCNAME("pixReadMemTiffCl");
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (!data)
|
||||
return (PIX *)ERROR_PTR("data pointer is NULL", procName, NULL);
|
||||
|
||||
@ -1158,6 +1160,13 @@ OpenclDevice::pixReadMemTiffCl(const l_uint8 *data,size_t size,l_int32 n)
|
||||
TIFFCleanup(tif);
|
||||
return NULL;
|
||||
}
|
||||
=======
|
||||
if (pagefound == FALSE) {
|
||||
L_WARNING("tiff page %d not found", procName, i);
|
||||
TIFFCleanup(tif);
|
||||
return NULL;
|
||||
}
|
||||
>>>>>>> 8bff1e618ff4f14dfacd523ff0b57b944999f24f
|
||||
|
||||
TIFFCleanup(tif);
|
||||
return pix;
|
||||
|
Loading…
Reference in New Issue
Block a user