< Back

Get-ImageAnalysis

Sun Jan 19, 2020 5:35 pm

NAME Get-ImageAnalysis



SYNOPSIS

Returns information about visual content found in web hosted images.





SYNTAX

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





DESCRIPTION

Function returns variety of information about visual content found in an image, like Color schemes, Face

rectangles, Tags, caption (Small description of Image), head couts, Age & gender of people in Image, celebrity

identification and much much more.

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>

[Parameter(ValueFromPipeline=$True)]

[String] $Path,



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



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



PS Root\\>"http://cdn.deccanchronicle.com/sites/de ... DELLA2.jpg" | Get-ImageAnalysis



Tags : {person, man, glasses, cellphone...}

Caption : Satya Nadella with glasses holding a cell phone

PeopleCount : 1

Faces : @{age=44; gender=Male; faceRectangle=}

IsBlackAndWhite : False

ForegroundColor : Blue

BackgroundColor : Blue

ProminentColors : {Blue, White}

URL : http://cdn.deccanchronicle.com/sites/de ... DELLA2.jpg



Passing an image URL through pipeline to the cmdlet will return you the image analysis information









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



PS Root\\>("http://i.huffpost.com/gen/2018240/image ... cebook.jpg"

|Get-ImageAnalysis).faces



age gender faceRectangle

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

31 Male @{left=902; top=394; width=159; height=159}

28 Female @{left=300; top=531; width=144; height=144}

31 Male @{left=478; top=316; width=137; height=137}

27 Male @{left=1254; top=254; width=133; height=133}

29 Female @{left=1486; top=456; width=131; height=131}

32 Female @{left=685; top=121; width=129; height=129}



In above example I selected the 'Faces' property of the result and it returned all Identified faces, their Age and

gender.











RELATED LINKS