I need to use the Tesseract functionality for OCR with OpenCV. Steps that I have performed are:
- Browsed for similar topics; couldn’t reproduce the recommendations from the one dated Sept 2022, owing perhaps to my incompetence.
- Installed tesseract-ocr, leptonica-dev, etc using apt; no tesseract include files were installed, so in my naive wisdom I uninstalled these packages promptly.
- Built OpenCV v.4.6.0 from GitHub repository using mostly defaults in ccmake/cmake
- Specified EXTRA_CONTRIB and WITH_TESSERACT but Tesseract was not installed
- Installed Leptonica from GitHub using website guidance (i.e. only include files seem to have been installed:
reza@BeUlta:~/projects$ which leptonica
reza@BeUlta:~/projects$ locate leptonica
/usr/include/leptonica
/usr/include/leptonica/allheaders.h
...
/usr/share/doc/libleptonica-dev/version-notes.html
/var/lib/dpkg/info/libleptonica-dev.list
/var/lib/dpkg/info/libleptonica-dev.md5sums
- Cloned Tesseract from GitHub but did not build/install it.
- Used the well trodden ccmake/cmake approach for OpenCV but don’t know how OpenCV will use this clone since it presumably expects Tesseract to be built in advance (the three Tesseract parameters are all set to NOT FOUND) for use during the OpenCV build process(es).
Don’t know how to proceed with the next steps! I need access to <tesseract/baseapi.h> for a simple Hello Text C++ sample test.
There are some dated docs for the Windows platform, but I’m on Ubuntu 23.10. Can someone point me in the right direction so that the OpenCV OCR samples will work for me? Thanks.
Regards.