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

This commit is contained in:
deiflaender 2023-02-17 12:13:39 +01:00
parent f8a0a911bc
commit 0cf867b97c

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);
} }