RED-8481: use visual layout parser for signature extraction
This commit is contained in:
parent
b50899e18c
commit
ab5dc2f46b
@ -12,7 +12,7 @@ plugins {
|
|||||||
description = "redaction-service-server-v1"
|
description = "redaction-service-server-v1"
|
||||||
|
|
||||||
|
|
||||||
val layoutParserVersion = "0.93.0"
|
val layoutParserVersion = "0.94.0"
|
||||||
val jacksonVersion = "2.15.2"
|
val jacksonVersion = "2.15.2"
|
||||||
val droolsVersion = "9.44.0.Final"
|
val droolsVersion = "9.44.0.Final"
|
||||||
val pdfBoxVersion = "3.0.0"
|
val pdfBoxVersion = "3.0.0"
|
||||||
|
|||||||
@ -135,10 +135,14 @@ public class Image implements GenericSemanticNode, IEntity {
|
|||||||
|
|
||||||
Map<Page, Rectangle2D> bboxImage = image.getBBox();
|
Map<Page, Rectangle2D> bboxImage = image.getBBox();
|
||||||
Map<Page, Rectangle2D> bbox = this.getBBox();
|
Map<Page, Rectangle2D> bbox = this.getBBox();
|
||||||
Rectangle2D intersection = bboxImage.get(this.page).createIntersection(bbox.get(this.page));
|
//image needs to be on the same page
|
||||||
double calculatedIntersection = intersection.getWidth() * intersection.getHeight();
|
if(bboxImage.get(this.page) != null) {
|
||||||
double area = bbox.get(this.page).getWidth() * bbox.get(this.page).getHeight();
|
Rectangle2D intersection = bboxImage.get(this.page).createIntersection(bbox.get(this.page));
|
||||||
return (calculatedIntersection / area) > containmentThreshold;
|
double calculatedIntersection = intersection.getWidth() * intersection.getHeight();
|
||||||
|
double area = bbox.get(this.page).getWidth() * bbox.get(this.page).getHeight();
|
||||||
|
return (calculatedIntersection / area) > containmentThreshold;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -146,7 +150,7 @@ public class Image implements GenericSemanticNode, IEntity {
|
|||||||
|
|
||||||
Map<Page, Rectangle2D> bboxImage = image.getBBox();
|
Map<Page, Rectangle2D> bboxImage = image.getBBox();
|
||||||
Map<Page, Rectangle2D> bbox = this.getBBox();
|
Map<Page, Rectangle2D> bbox = this.getBBox();
|
||||||
Rectangle2D intersection = bboxImage.get(this.page).createIntersection(bbox.get(this.page));
|
Rectangle2D intersection = bbox.get(this.page).createIntersection(bboxImage.get(this.page));
|
||||||
double calculatedIntersection = intersection.getWidth() * intersection.getHeight();
|
double calculatedIntersection = intersection.getWidth() * intersection.getHeight();
|
||||||
double area = bbox.get(this.page).getWidth() * bbox.get(this.page).getHeight();
|
double area = bbox.get(this.page).getWidth() * bbox.get(this.page).getHeight();
|
||||||
return (area / calculatedIntersection) > containmentThreshold;
|
return (area / calculatedIntersection) > containmentThreshold;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user