https://github.com/daijro/psocrcapture
OCR screen capture in native Powershell
https://github.com/daijro/psocrcapture
ocr ocr-recognition powershell screen-capture
Last synced: 10 months ago
JSON representation
OCR screen capture in native Powershell
- Host: GitHub
- URL: https://github.com/daijro/psocrcapture
- Owner: daijro
- License: apache-2.0
- Created: 2022-08-15T09:13:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-16T05:46:29.000Z (over 3 years ago)
- Last Synced: 2025-04-06T06:53:52.595Z (10 months ago)
- Topics: ocr, ocr-recognition, powershell, screen-capture
- Language: PowerShell
- Homepage:
- Size: 12.7 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PowerShell OCR Capture
This project aims to make use of native Windows 10/11 features to allow users to grab text from the contents of their screen. It uses Snipping Tool/Snip & Sketch and the Windows 10 OCR engine. Unlike other screen OCR tools, this project does not require any third-party dependencies. This makes it possible to run on restrictive devices, such as work computers.
### In Action

##### Includes:
- Launches screen capture with "Capture" button, and waits for image to copy to clipboard. Old clipboard contents are restored.
- Upscaling, extending, and centering images for better results. Supports capturing small pieces of text.
- Detecting whether to use Snipping Tool (Windows 10) or Snip & Sketch (Windows 11)
- Includes a "Copy" button to copy contents of the text field
- Window will hide when capturing text
- Runs *fast*
- Error handling
### Usage
Select a region of your screen to scan with the "Capture" button. Recognized text will be returned in an input field.
To run in PowerShell, you will have to set the command execution policy. Simply paste this into a PowerShell instance:
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; ./PsOCRCapture.ps1
```
To run without setting the PowerShell script execution policy, simply download and run [`PsOCRCapture.minified.bat`](https://raw.githubusercontent.com/daijro/PsOCRCapture/main/PsOCRCapture.minified.bat)
---
### Credits
The code behind this tool was inspired by [this reference](https://github.com/HumanEquivalentUnit/PowerShell-Misc/blob/master/Get-Win10OcrTextFromImage.ps1).