Created
July 4, 2022 09:08
-
-
Save aspose-com-gists/0f97a5118b8764e070403eaecd7bf1f6 to your computer and use it in GitHub Desktop.
Convert Screenshot to Text with OCR in C# .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize an instance of AsposeOcr | |
Aspose.OCR.AsposeOcr api = new Aspose.OCR.AsposeOcr(); | |
// Recognize screenshot image with OCR | |
string result = api.RecognizeImage("Test.png"); | |
// Display the recognized text | |
Console.WriteLine(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get screenshot from URL for OCR | |
string uri = "https://qph.fs.quoracdn.net/main-qimg-0ff82d0dc3543dcd3b06028f5476c2e4"; | |
// Initialize an instance of AsposeOcr | |
AsposeOcr api = new AsposeOcr(); | |
// Recognize image | |
string result = api.RecognizeImageFromUri(uri); | |
// Print result | |
Console.WriteLine($"Text:\n {result}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment