|
|
|
@ -83,7 +83,7 @@ class SbbBinarizeProcessor(Processor):
|
|
|
|
|
for region in regions:
|
|
|
|
|
region_image, region_xywh = self.workspace.image_from_segment(
|
|
|
|
|
region, page_image, page_xywh, feature_filter='binarized')
|
|
|
|
|
region_image_bin = cv2pil(binarizer.run(image=pil2cv(region_image), use_patches=True))
|
|
|
|
|
region_image_bin = cv2pil(self.binarizer.run(image=pil2cv(region_image), use_patches=True))
|
|
|
|
|
# update PAGE (reference the image file):
|
|
|
|
|
region_image_ref = AlternativeImageType(comments=region_xywh['features'] + ',binarized')
|
|
|
|
|
region.add_AlternativeImage(region_image_ref)
|
|
|
|
@ -95,7 +95,7 @@ class SbbBinarizeProcessor(Processor):
|
|
|
|
|
self.logger.warning("Page '%s' contains no text lines", page_id)
|
|
|
|
|
for line in lines:
|
|
|
|
|
line_image, line_xywh = self.workspace.image_from_segment(line, page_image, page_xywh, feature_filter='binarized')
|
|
|
|
|
line_image_bin = cv2pil(binarizer.run(image=pil2cv(line_image), use_patches=True))
|
|
|
|
|
line_image_bin = cv2pil(self.binarizer.run(image=pil2cv(line_image), use_patches=True))
|
|
|
|
|
# update PAGE (reference the image file):
|
|
|
|
|
line_image_ref = AlternativeImageType(comments=line_xywh['features'] + ',binarized')
|
|
|
|
|
line.add_AlternativeImage(region_image_ref)
|
|
|
|
|