blog post: https://b1tg.github.io/post/win11-oneocr/
Tested on Win11 23H2 + SnippingTool 11.2409.25.0
Build this code needs opencv installed.
How to use:
The code depends on the DLLs and offline AI model, the easiest way is copy those files from SnippingTool folder, puts them in the same folder of ocr.exe
includes:
oneocr.dlloneocr.onemodelonnxruntime.dll
On my computer the SnippingTool folder located at C:\Program Files\WindowsApps\Microsoft.ScreenSketch_11.2409.25.0_x64__8wekyb3d8bbwe\SnippingTool (You may need to change the access rights in the Security Tab of the properties (add your user as the owner))
Install OpenCV (4.6.0)
also add the opencv_world460.dll
Install VS with MSVC / C++ packages.
Use x64 Native Tools Command Prompt for VS 20XX to build the app for x64 systems.
The build scripts now use /EHsc for C++ exception handling and will look for OpenCV in either:
- the
OPENCV_DIRenvironment variable, or - common install locations such as
C:\Tools\OpenCV_4_6\build
Make sure the OpenCV 4.6.0 headers and opencv_world460.lib are available before building.
