Skip to content

deltqz/oneocr-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneOCR-CLI

Simple CLI tool to extract the text from an image using OneOCR, the OCR engine used by W11's Snipping Tool. Based on b1tg work, who found out how it works via reverse engineering. Main differences from the original project: rewritten in Rust, no need for OpenCV at all, plain output (no numbered lines).

Usage example

In the terminal:

oneocr image_001.png >text.txt

Prerequisites:

Installation:

1 - Get the latest build from the releases section.
2 - Extract the OneOCR folder to any directory.
3 - Execute the included install.bat file, then delete it if you want. Done!

This last step is neccesary to copy oneocr.dll, oneocr.onemodel and onnxruntime.dll from the Snipping Tool folder. This also adds oneocr to PATH, so you can run it from any folder via CLI or batching. If you copy the required files and add the OneOCR folder to PATH manually, you don't have to run the bat at all. PowerShell is only needed by the bat file to perform those two tasks, it's not a OneOCR-CLI dependency.

I can't include the required files in the release because of potential licensing issues, since it's privative software that you already have on your PC anyway. For me, the files are in this location, but it may be different for you.

C:\Program Files\WindowsApps\Microsoft.ScreenSketch_11.2510.31.0_x64__8wekyb3d8bbwe\SnippingTool

About

CLI for OneOCR, the OCR engine used by W11's Snipping Tool.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages

  • Rust 82.7%
  • Batchfile 17.3%