Tesseract: Improved detection

This commit is contained in:
Michael 2024-01-22 18:01:51 +00:00
parent b05a95cc45
commit 1b7e699944

View file

@ -24,6 +24,10 @@ function tesseract_ocr_detection(&$media)
{
$ocr = new TesseractOCR();
try {
$languages = $ocr->availableLanguages();
if ($languages) {
$ocr->lang(implode('+', $languages));
}
$ocr->tempDir(System::getTempPath());
$ocr->imageData($media['img_str'], strlen($media['img_str']));
$media['description'] = $ocr->run();