openalpr raises Segmentation fault with tesseract 4.0.0
It's since this change https://github.com/tesseract-ocr/tesseract/commit/ad5ee18415bf59b9f5d1fd1806cb3aad3f18f381
tesseract 4.0.0 is installed in Ubuntu 18.04
#0 0x00007ffff5f52568 in tesseract::LTRResultIterator::WordFontAttributes(bool*, bool*, bool*, bool*, bool*, bool*, int*, int*) const ()
from /usr/lib/x86_64-linux-gnu/libtesseract.so.4
#1 0x00007ffff7b13093 in alpr::TesseractOcr::recognize_line(int, alpr::PipelineData*) () from /usr/lib/libopenalpr.so.2
#2 0x00007ffff7b141a0 in alpr::OCR::performOCR(alpr::PipelineData*) () from /usr/lib/libopenalpr.so.2
#3 0x00007ffff7ae79b3 in alpr::AlprImpl::analyzeSingleCountry(cv::Mat, cv::Mat, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >) ()
from /usr/lib/libopenalpr.so.2
#4 0x00007ffff7ae9f1d in alpr::AlprImpl::recognizeFullDetails(cv::Mat, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >) ()
from /usr/lib/libopenalpr.so.2
#5 0x00007ffff7aecc35 in alpr::AlprImpl::recognize(cv::Mat, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >) ()
from /usr/lib/libopenalpr.so.2
#6 0x00007ffff7aed5a8 in alpr::AlprImpl::recognize(unsigned char*, int, int, int, std::vector<alpr::AlprRegionOfInterest, std::allocator<alpr::AlprRegionOfInterest> >) () from /usr/lib/libopenalpr.so.2
#7 0x00007ffff7ae06e0 in alpr::Alpr::recognize(unsigned char*, int, int, int, std::vector<alpr::AlprRegionOfInterest, std::allocator<alpr::AlprRegionOfInterest> >) () from /usr/lib/libopenalpr.so.2
#8 0x0000555555568d96 in detectandshow(alpr::Alpr*, cv::Mat, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool) ()
#9 0x0000555555566c91 in main ()
Fixed by change in tesseract https://github.com/tesseract-ocr/tesseract/pull/1669
on which version is fixed ?
I get this error in syslog on 18.04 ubuntu with tesseract 4.0.0-beta.1:
May 9 17:28:39 vagrant kernel: [ 2753.296331] alpr[3939]: segfault at 8 ip 00007fa738a3f568 sp 00007fff5e81d938 error 4 in libtesseract.so.4.0.0[7fa738988000+30d000]
@karborator
On Ubuntu 18.04 LTS I've fixed this using PPA / packages from notesalexp.org.
sudo add-apt-repository ppa:alex-p/tesseract-ocr
sudo apt-get update
sudo apt-get upgrade
tesseract 4.1.0-rc2-48-g5320
leptonica-1.78.0
libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.2) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0
Found AVX
Found SSE
alpr version: 2.3.0
Didnt work for me :(
Most helpful comment
@karborator
On Ubuntu 18.04 LTS I've fixed this using PPA / packages from notesalexp.org.
alpr version: 2.3.0