Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --text-mask flag to CLI tool #38

Merged
merged 4 commits into from
Mar 9, 2024
Merged

Add --text-mask flag to CLI tool #38

merged 4 commits into from
Mar 9, 2024

Conversation

robertknight
Copy link
Owner

This saves the binarized version of the text probability map as a PNG file. This
is useful to see where detections were above/below the current confidence
threshold.

Input image:

why-rust

Probability map (text-map.png, generated by --text-map):

Binary mask (text-mask.png, generated by --text-mask):

For use in debugging, this returns the confidence threshold that is applied to
the text probability map produced by `OcrEngine::detect_text_pixels` to get the
binary mask from which word boxes are extracted.
This saves the binarized version of the text probability map as a PNG file. This
is useful to see where detections were above/below the current confidence
threshold.
@robertknight
Copy link
Owner Author

On this image the extracted text is:

Why Rust?
Performance
[
Rust is blazingly fast and memory-
efficient: with no runtime or garbage
collector, it can power performance-
critical services, run on embedded
devices, and easily integrate with other
languages.
Reliability
Rust's rich type system and ownership
model guarantee memory-safety and
thread-safety  enabling you to eliminate
many classes of bugs at compile-time.
Productivity
Rust has great documentation, a friendly
compiler with useful error messages, and
top-notch tooling an integrated
package manager and build tool, smart
multi-editor support with auto-
completion and type inspections, an
auto-formatter, and more.

The spurious third line ("[") is coming from a broken mask where the word "is" is, in "Rust is blazingly...".

@robertknight robertknight merged commit 521aafe into main Mar 9, 2024
2 checks passed
@robertknight robertknight deleted the text-mask-flag branch March 9, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant