robertknight / ocrs

Rust library and CLI tool for OCR (extracting text from images)
Apache License 2.0
1.1k stars 46 forks source link

Make `--text-line-images` debug option apply recognition preprocessing #30

Closed robertknight closed 6 months ago

robertknight commented 6 months ago

Make the --text-line-images debug option apply the same preprocessing that is applied before lines are fed into the text recognition model. This includes:

This makes this option more useful for debugging recognition accuracy issues, as problems arising from the preprocessing become visible.

In the process of doing this functions in ocrs which return dynamic errors were changed to use anyhow::Error rather than Box<dyn Error> as the error type. This is more convenient to work with in ocrs-cli, which already used anyhow.