tobiaspsp / psocr Goto Github PK
View Code? Open in Web Editor NEWHome of the PowerShell module "PsOcr" which uses the native Windows 10 OCR engine to convert image files to text
License: MIT License
Home of the PowerShell module "PsOcr" which uses the native Windows 10 OCR engine to convert image files to text
License: MIT License
Was wondering if you could add support for OCRing the image data on the Clipboard so it doesn't have to be saved to a file first.
Hi @TobiasPSP
Does it be able to OCR digital image?
I tried, and it seems not able to see it, any option can be used to enable that?
Thanks
Eric Xin
Dr Weltner,
Not sure if you're still maintaining this. It works great on my Windows 10 machine, but on my Windows 11 machine I get a range of failures (pasted below). Both computers have PsOcr 1.1.0 there are no errors when installing the module, no complaints about missing assemblies.
PS C:\Users\robert> Convert-PsoImageToText .\Documents\code\ocr.png
Exception calling "GetResult" with "0" argument(s): "Value does not fall within the expected range."
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:28 char:12
+ return $awaiter.
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
You cannot call a method on a null-valued expression.
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:112 char:5
+ $content = $storageFile.OpenAsync([Windows.Storage.FileAccessMode ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "Invoke" with "2" argument(s): "Value cannot be null.
Parameter name: source"
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:28 char:12
+ return $awaiter.
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
Exception calling "CreateAsync" with "1" argument(s): "Invalid pointer
Windows.Graphics.Imaging: One or more pointer arguments are null."
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:116 char:5
+ $decoder = [Windows.Graphics.Imaging.BitmapDecoder]::CreateAsync( ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : NullReferenceException
Exception calling "Invoke" with "2" argument(s): "Value cannot be null.
Parameter name: source"
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:28 char:12
+ return $awaiter.
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
You cannot call a method on a null-valued expression.
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:120 char:5
+ $bitmap = $bitmapDecoder.GetSoftwareBitmapAsync()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "Invoke" with "2" argument(s): "Value cannot be null.
Parameter name: source"
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:28 char:12
+ return $awaiter.
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
Exception calling "RecognizeAsync" with "1" argument(s): "Object reference not set to an instance of an object."
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:124 char:5
+ $ocrResult = $ocrEngine.RecognizeAsync($softwareBitmap)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : NullReferenceException
Exception calling "Invoke" with "2" argument(s): "Value cannot be null.
Parameter name: source"
At C:\Users\robert\Documents\WindowsPowerShell\Modules\PsOcr\1.1.0\root.psm1:28 char:12
+ return $awaiter.
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
PS C:\Users\robert>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.