mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-11-17 01:44:14 +01:00
adapt ocrd-sbb-binarize
This commit is contained in:
parent
49ab269e08
commit
028ed16921
1 changed files with 3 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ class SbbBinarizeProcessor(Processor):
|
||||||
|
|
||||||
if oplevel == 'page':
|
if oplevel == 'page':
|
||||||
self.logger.info("Binarizing on 'page' level in page '%s'", page_id)
|
self.logger.info("Binarizing on 'page' level in page '%s'", page_id)
|
||||||
page_image_bin = cv2pil(self.binarizer.run(image=pil2cv(page_image), use_patches=True))
|
page_image_bin = cv2pil(self.binarizer.run_single(image=pil2cv(page_image), use_patches=True))
|
||||||
# update PAGE (reference the image file):
|
# update PAGE (reference the image file):
|
||||||
page_image_ref = AlternativeImageType(comments=page_xywh['features'] + ',binarized,clipped')
|
page_image_ref = AlternativeImageType(comments=page_xywh['features'] + ',binarized,clipped')
|
||||||
page.add_AlternativeImage(page_image_ref)
|
page.add_AlternativeImage(page_image_ref)
|
||||||
|
|
@ -83,7 +83,7 @@ class SbbBinarizeProcessor(Processor):
|
||||||
for region in regions:
|
for region in regions:
|
||||||
region_image, region_xywh = self.workspace.image_from_segment(
|
region_image, region_xywh = self.workspace.image_from_segment(
|
||||||
region, page_image, page_xywh, feature_filter='binarized')
|
region, page_image, page_xywh, feature_filter='binarized')
|
||||||
region_image_bin = cv2pil(self.binarizer.run(image=pil2cv(region_image), use_patches=True))
|
region_image_bin = cv2pil(self.binarizer.run_single(image=pil2cv(region_image), use_patches=True))
|
||||||
# update PAGE (reference the image file):
|
# update PAGE (reference the image file):
|
||||||
region_image_ref = AlternativeImageType(comments=region_xywh['features'] + ',binarized')
|
region_image_ref = AlternativeImageType(comments=region_xywh['features'] + ',binarized')
|
||||||
region.add_AlternativeImage(region_image_ref)
|
region.add_AlternativeImage(region_image_ref)
|
||||||
|
|
@ -95,7 +95,7 @@ class SbbBinarizeProcessor(Processor):
|
||||||
self.logger.warning("Page '%s' contains no text lines", page_id)
|
self.logger.warning("Page '%s' contains no text lines", page_id)
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line_image, line_xywh = self.workspace.image_from_segment(line, page_image, page_xywh, feature_filter='binarized')
|
line_image, line_xywh = self.workspace.image_from_segment(line, page_image, page_xywh, feature_filter='binarized')
|
||||||
line_image_bin = cv2pil(self.binarizer.run(image=pil2cv(line_image), use_patches=True))
|
line_image_bin = cv2pil(self.binarizer.run_single(image=pil2cv(line_image), use_patches=True))
|
||||||
# update PAGE (reference the image file):
|
# update PAGE (reference the image file):
|
||||||
line_image_ref = AlternativeImageType(comments=line_xywh['features'] + ',binarized')
|
line_image_ref = AlternativeImageType(comments=line_xywh['features'] + ',binarized')
|
||||||
line.add_AlternativeImage(region_image_ref)
|
line.add_AlternativeImage(region_image_ref)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue