Pull request #514: RED-6164: Fixed calculation of image is ocr on scanned pages with cv analysis found tables

Merge in RED/redaction-service from RED-6164 to master

* commit '0cf867b97c2a240f2bbdca479ebdc36f64ed3bbb':
  RED-6164: Fixed calculation of image is ocr on scanned pages with cv analysis found tables
This commit is contained in:
Dominique Eiflaender 2023-02-17 14:36:09 +01:00 committed by Viktor Seifert
commit 04343334d8

View File

@ -101,15 +101,16 @@ public class PdfSegmentationService {
page.setPageWidth(cropbox.getWidth()); page.setPageWidth(cropbox.getWidth());
page.setPageHeight(cropbox.getHeight()); page.setPageHeight(cropbox.getHeight());
tableExtractionService.extractTables(cleanRulings, page); // If images is ocr needs to be calculated before textBlocks are moved into tables, otherwise findOcr algorithm needs to be adopted.
buildPageStatistics(page);
increaseDocumentStatistics(page, document);
if (pdfImages != null && pdfImages.containsKey(pageNumber)) { if (pdfImages != null && pdfImages.containsKey(pageNumber)) {
page.setImages(pdfImages.get(pageNumber)); page.setImages(pdfImages.get(pageNumber));
imageService.findOcr(page); imageService.findOcr(page);
} }
tableExtractionService.extractTables(cleanRulings, page);
buildPageStatistics(page);
increaseDocumentStatistics(page, document);
pages.add(page); pages.add(page);
} }