< Back

Get-ImageText

Sun Jan 19, 2020 5:35 pm

NAME Get-ImageText



SYNOPSIS

Cmdlet is capable in extracting text from the web hosted Images.





SYNTAX

Get-ImageText [[-URL] <String>] [<CommonParameters>]





DESCRIPTION

This cmdlet is Using Microsoft cognitive service's "Computer Vision" API as a service to extract text from the web

hosted images by issuing an HTTP calls to the API.

NOTE : You need to subscribe the "Computer Vision API" before using the powershell script from the following link

and setup an environment variable like, $env:MS_ComputerVision_API_key = "YOUR API KEY"



API Subscription Page - https://www.microsoft.com/cognitive-ser ... us/sign-up





PARAMETERS

-URL <String>

Image URL from where you want to extract the text.



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Author: Prateek Singh - @SinghPrateik



-------------------------- EXAMPLE 1 --------------------------



PS Root\\>"https://assets.entrepreneur.com/article ... lauder.jpg" | Get-ImageText



LineNumber LanguageCode Sentence

---------- ------------ --------

1 en I NEVER DREAMED

2 en ABOUT SUCCESS.

3 en I WORKED FOR IT.

4 en -Edt????????e Zaudet



In above example, Function extract the text from the URL passed returns you the sentences and Identified language









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$URLs = "https://assets.entrepreneur.com/article ... ://s-media

-cache-ak0.pinimg.com/736x/41/fe/f6/41fef69d2839b6b9122232c75d568a9e.jpg"



$URLs | Get-ImageText



LineNumber LanguageCode Sentence URL



---------- ------------ -------- ---



1 en I NEVER DREAMED

https://assets.entrepreneur.com/article ... lauder.jpg

2 en ABOUT SUCCESS.

https://assets.entrepreneur.com/article ... lauder.jpg

3 en I WORKED FOR IT.

https://assets.entrepreneur.com/article ... lauder.jpg

4 en -Edt????????e Zaudet

https://assets.entrepreneur.com/article ... lauder.jpg

1 en STOP HATING

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

2 en YOURSELF FOR

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

3 en EVERYTHING YOU

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

4 en AREN'T AND START

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

5 en LOVING YOURSELF

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

6 en FOR EVERYTHING

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

7 en YOU ALREADY ARE.

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg

8 en RECOVERYEXPERTS.COM

https://s-media-cache-ak0.pinimg.com/73 ... 568a9e.jpg



You can also, pass multiple URL's to the cmdlet as it accepts the Pipeline input and will return the results.











RELATED LINKS