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:
Resizing the image to be 64px high and with a max width of 800px
Converting the image from color to gray
Extracting only the polygon containing the line's words, and masking off other pixels in black
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.
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 thanBox<dyn Error>
as the error type. This is more convenient to work with in ocrs-cli, which already used anyhow.