Comments (14)
Ray says,
I think there is a bug in InitDSProfile.
I suspect if you change if (status == SUCCESS) to if (status == SUCCESS && profile->numDevices > 0)
at openclwrapper.cpp:3426
then it will work. (You have no devices, and unlike the code here: https://docs.libreoffice.org/opencl/html/opencl__device__selection_8h_source.html
it doesn't correctly always add the native CPU as a device, and therefore attempts to write a null buffer, even though it has no devices.)
from tesseract.
still trouble
from tesseract.
note that if we get through this, I will probably enable OpenCL by default for Debian/Ubuntu
from tesseract.
I'm in stuck. How this code (located at oclkernels.h:1086) can work:
pixels.v[i] = imageData[
w*(BURSTS_PER_WORD*(PIXELS_PER_BURST*NUM_CHANNELS)/CHAR_VEC_WIDTH) +
b*((PIXELS_PER_BURST*NUM_CHANNELS)/CHAR_VEC_WIDTH) + i];
where maximum value of index can be 4x higher that size of imageData array
Variables are:
w in range [0 .. count of DWORDS in image),
b in range [0 .. BURSTS_PER_WORD),
i in range [0 .. (PIXELS_PER_BURST*NUM_CHANNELS)/CHAR_VEC_WIDTH )
Constants values:
#define NUM_CHANNELS 4
#define CHAR_VEC_WIDTH 8
#define PIXELS_PER_WORD 32
#define PIXELS_PER_BURST 8
#define BURSTS_PER_WORD (PIXELS_PER_WORD/PIXELS_PER_BURST)
from tesseract.
I get a similar looking segfault (but I didn't confirm with gdb) even on a computer that contains a discrete graphics card. Is OpenCL working for anyone at all?
from tesseract.
it worked for me on some images (there are some issues reported already - IMO 2 color tiff should work). Last week it segfault on linux. I will try windows today...
Also on forum there are some experiments[1]
[1] https://mail.google.com/mail/u/0/#search/opencl
from tesseract.
I can't get fully worked OpenCL configuration. But I have a much different environment (without any other dependencies except leptonica). I've got errors like:
Access violation reading location 0x58B87000
That's a position after imageData host's buffer.
from tesseract.
I am not sure what do you mean with "any other dependencies except leptonica" - to run tesseract with opencl support you need libtiff and opencl sdk that support your hardware...
from tesseract.
@jbreiden:
it works for me on windows:
tesseract-opencl.exe ....\testing\phototest.tif -
[OD] Load opencl.dll successful!
[DS] Profile file not available (tesseract_opencl_profile_devices.dat); performi
ng profiling.
[DS] Device: "Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz" (OpenCL) evaluation...
[OD] write binary[kernel-Intel(R)_Core(TM)i7-4800MQ_CPU@_2.70GHz.bin] succesfully
[DS] Device: "Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz" (OpenCL) evaluated
[DS] composeRGBPixel: 0.038657 (w=1.2)
[DS] HistogramRect: 0.325462 (w=2.4)
[DS] ThresholdRectToPix: 0.042622 (w=4.5)
[DS] getLineMasksMorph: 0.119543 (w=5.0)
[DS] Score: 1.617007
[DS] Device: "Intel(R) HD Graphics 4600" (OpenCL) evaluation...
[OD] write binary[kernel-Intel(R)_HD_Graphics_4600.bin] succesfully
[DS] Device: "Intel(R) HD Graphics 4600" (OpenCL) evaluated
[DS] composeRGBPixel: 0.153912 (w=1.2)
[DS] HistogramRect: 0.449184 (w=2.4)
[DS] ThresholdRectToPix: 0.048737 (w=4.5)
[DS] getLineMasksMorph: 0.027403 (w=5.0)
[DS] Score: 1.619068
[DS] Device: "(null)" (Native) evaluation...
[DS] Device: "(null)" (Native) evaluated
[DS] composeRGBPixel: 0.088750 (w=1.2)
[DS] HistogramRect: 0.388795 (w=2.4)
[DS] ThresholdRectToPix: 0.182945 (w=4.5)
[DS] getLineMasksMorph: 0.613772 (w=5.0)
[DS] Score: 4.931717
[DS] Scores written to file (tesseract_opencl_profile_devices.dat).
[DS] Device[1] 1:Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz score is 1.617007
[DS] Device[2] 1:Intel(R) HD Graphics 4600 score is 1.619068
[DS] Device[3] 0:(null) score is 4.931717
[DS] Selected Device[1]: "Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz" (OpenCL)
Page 1
This is a lot of 12 point text to test the
ocr code and see if it works on all types
of file format.
The quick brown dog jumped over the
lazy fox. The quick brown dog jumped
over the lazy fox. The quick brown dog
jumped over the lazy fox. The quick
brown dog jumped over the lazy fox.
from tesseract.
Just made a bit changes to exclude libtiff dependency.
I have my own input and output streams.
I see, that I can't request any attention without prepare reproducible error in your environment.
from tesseract.
spSerg: you can request attention, but if we can't reproduce you need to supply more information, such as a backtrace from gdb or the output of valgrind (either works much better when ./configure is run with --enable-debug)
from tesseract.
I'm having an unexpectedly hard time with this.
from tesseract.
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x00007ffff77d3c5f in writeProfileToFile (profile=0x80ac20,
serializer=0x7ffff77dcc45 <serializeScore(ds_device*, void**, unsigned int*)>,
file=0x7ffff78a0b20 "tesseract_opencl_profile_devices.dat") at opencl_device_selection.h:268
#2 0x00007ffff77dd11f in OpenclDevice::getDeviceSelection () at openclwrapper.cpp:3427
#3 0x00007ffff77d5a6c in OpenclDevice::InitOpenclRunEnv_DeviceSelection (argc=0) at openclwrapper.cpp:527
#4 0x00007ffff77d578a in OpenclDevice::InitEnv () at openclwrapper.cpp:431
#5 0x00007ffff75efb2f in tesseract::TessBaseAPI::Init (this=0x7fffffffd9f0, datapath=0x0,
language=0x405a13 "eng", oem=tesseract::OEM_DEFAULT, configs=0x7fffffffe650, configs_size=0,
vars_vec=0x7fffffffd9b0, vars_values=0x7fffffffd9d0, set_only_non_debug_params=false) at baseapi.cpp:299
#6 0x0000000000404327 in main (argc=3, argv=0x7fffffffe638) at tesseractmain.cpp:181
from tesseract.
Please check master branch or commits f46dfdc and 5db7602.
from tesseract.
Related Issues (20)
- Linker Error for tesseract53.lib HOT 1
- Add redirect function HOT 1
- Add ICD Codes in english trained Data HOT 2
- Some CI jobs (GitHub Actions) are failing HOT 10
- uuencode-generated text is OCRed with many mistakes HOT 2
- Error! The command "tesseract" was not found. HOT 2
- Error! The command "tesseract" was not found
- unicharset_extractor segfault HOT 31
- Please add the API call to translate the language code to the full language name HOT 3
- Warning: LSTMTrainer deserialized an LSTMRecognizer! Error, data/eng/eng_num_vert.lstm is an integer (fast) model, cannot continue training HOT 7
- Add the NN for a 'random' ASCII language HOT 1
- "min_characters_to_try" parameter does not work HOT 2
- phonetic symbols and special characters HOT 1
- inform where we can find tesseract.exe HOT 1
- Native Crash in otsuthr.cpp HOT 2
- CI: vcpkg failure due to missing xz tarball HOT 4
- link error LNK1120 with text2image.exe
- Mac m1, not able to compile HOT 2
- OCR of Indian Currency Sign " ₹" HOT 2
- please support linux binary , like fzf HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tesseract.