简体   繁体   English

Tika与OCR PDF上的Tesseract一起使用时会复制文本

[英]Tika duplicates text when used with Tesseract on OCR PDF

I have a scanned PDF that has been OCRed and now has double layer of a scanned image and a text above it. 我有一个扫描的PDF,它已经是OCRed,现在具有扫描图像的双层以及上面的文本。

If I use Tika with integrated Tesseract to extract text from that PDF I get duplicate text: one comes from OCRed text and another from OCRing image by Tesseract. 如果我将Tika与集成的Tesseract结合使用以从该PDF中提取文本,则会得到重复的文本:一个来自OCRed文本,另一个来自Tesseract的OCRing图像。

I need only OCRed text in this case. 在这种情况下,我只需要OCRed文本。

I can't just disable Tesseract because there may be PDFs containing only images or PDFs that contain text and images. 我不能仅禁用Tesseract,因为可能有一些PDF仅包含图像,或者包含文本和图像的PDF。

Tesseract is integrated in Tika like in Apache Tika extract scanned PDF files Tesseract与Apache Tika一样集成在Tika中, 提取扫描的PDF文件

Is there any way to tell Tika to not use Tesseract for images inside PDF that have OCR text over them? 有什么方法可以告诉Tika不要将Tesseract用于PDF内带有OCR文本的图像?

我们有一个类似的问题,我们试图保持一个简单的if else条件,将pdf传递给默认的pdf扫描仪,如果它变成空,则在pdf上使用tesseract选项进行调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM