mirror of
https://github.com/qurator-spk/sbb_binarization.git
synced 2025-06-08 03:40:14 +02:00
Merge pull request #28 from qurator-spk/fix-unbound-var
extract page_image also for operation_level region
This commit is contained in:
commit
3518618a01
1 changed files with 1 additions and 1 deletions
|
@ -74,10 +74,10 @@ class SbbBinarizeProcessor(Processor):
|
||||||
self.add_metadata(pcgts)
|
self.add_metadata(pcgts)
|
||||||
pcgts.set_pcGtsId(file_id)
|
pcgts.set_pcGtsId(file_id)
|
||||||
page = pcgts.get_Page()
|
page = pcgts.get_Page()
|
||||||
|
page_image, page_xywh, _ = self.workspace.image_from_page(page, page_id, feature_filter='binarized')
|
||||||
|
|
||||||
if oplevel == 'page':
|
if oplevel == 'page':
|
||||||
LOG.info("Binarizing on 'page' level in page '%s'", page_id)
|
LOG.info("Binarizing on 'page' level in page '%s'", page_id)
|
||||||
page_image, page_xywh, _ = self.workspace.image_from_page(page, page_id, feature_filter='binarized')
|
|
||||||
bin_image = cv2pil(binarizer.run(image=pil2cv(page_image), use_patches=True))
|
bin_image = cv2pil(binarizer.run(image=pil2cv(page_image), use_patches=True))
|
||||||
# update METS (add the image file):
|
# update METS (add the image file):
|
||||||
bin_image_path = self.workspace.save_image_file(bin_image,
|
bin_image_path = self.workspace.save_image_file(bin_image,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue