eynollah icon indicating copy to clipboard operation
eynollah copied to clipboard

allow cropping separately

Open bertsky opened this issue 3 years ago • 7 comments

I know OCR-D integration is still underway, but just wanted to bring to attention that OCR-D currently lacks a neural (or in fact, any useable) cropping tool, and thus it would be extremely helpful if eynollah's (or sbb_textline_detection's) UNet-based model for that would be wrapped independent of the overall segmentation.

bertsky avatar Mar 18 '21 12:03 bertsky

Actually for my usage and mostly for data preparation, I have provided a page-extractor tool. I will soon publish it on our qurator github then OCR-D can also use it dependently.

vahidrezanezhad avatar Mar 18 '21 14:03 vahidrezanezhad

https://github.com/qurator-spk/sbb_page_extractor

vahidrezanezhad avatar Mar 18 '21 16:03 vahidrezanezhad

https://github.com/qurator-spk/sbb_page_extractor

Not public yet?

bertsky avatar Mar 18 '21 17:03 bertsky

https://github.com/qurator-spk/sbb_page_extractor

Not public yet?

Sorry was my fault. It is public now

vahidrezanezhad avatar Mar 18 '21 17:03 vahidrezanezhad

Thanks @vahidrezanezhad!

bertsky avatar Mar 18 '21 18:03 bertsky

As far as I can understand this, sbb_page_extractor is one processing step of eynollah, maybe it could just be an eynollah option to only do this aspect of the overall layout analysis (with no code duplication?)

mikegerber avatar Mar 22 '21 15:03 mikegerber

I agree with @mikegerber, can we instead make page extraction available as a command line option in the current codebase of eynollah @vahidrezanezhad?

cneud avatar Jun 08 '21 20:06 cneud

I agree with @mikegerber, can we instead make page extraction available as a command line option in the current codebase of eynollah @vahidrezanezhad?

Page extraction was already available by eynollah. What you need is to enable plotting and then save output images and page image is one of those outputs.

vahidrezanezhad avatar May 08 '23 19:05 vahidrezanezhad

I don't know about other use cases (plotting / cropped image is not used by OCR-D), but to wrap the cropper into a separate processor, I think we do need some additional boilerplate, because that's also a chance to avoid the at once build_pagexml approach. In OCR-D, we need incremental annotation, so we can freely exchange individual steps in between workflows. (I.e. regarding eynollah, currently one cannot have prior processors, as their PAGE would be ignored.)

So IMO that should be a minimalistic crop_processor.py that simply delegates to extract_page, but uses only its second result to create a Border on the input PAGE. (Of course, we could also add another Processor class to processor.py.)

bertsky avatar May 09 '23 13:05 bertsky