RED-8481: Use visual layout parsing to detect signatures

addressed review comments
This commit is contained in:
yhampe 2024-02-15 12:19:26 +01:00
parent bdf1161c91
commit fa048b2fe0

View File

@ -22,6 +22,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class VisualLayoutParsingAdapter {
private static String SIGNATURES = "signature";
public Map<Integer, List<VisualLayoutParsingResult>> buildExtractedTablesPerPage(VisualLayoutParsingResponse visualLayoutParsingResponse) {
Map<Integer, List<VisualLayoutParsingResult>> tableCells = new HashMap<>();
@ -66,7 +68,7 @@ public class VisualLayoutParsingAdapter {
List<ClassifiedImage> signatures = new ArrayList<>();
tableObjects.stream().forEach(t -> {
if(t.getLabel().equals("signature")) {
if(t.getLabel().equals(SIGNATURES)) {
ClassifiedImage signature = new ClassifiedImage(new Rectangle2D.Float(t.getBox().getX1(),t.getBox().getY1(),t.getBox().getX2() - t.getBox().getX1(),t.getBox().getY2() - t.getBox().getY1()),
ImageType.SIGNATURE,false,pageNumber);