({{, (RefLink[ImagePosition, paclet:ref/ImagePosition])[image]
gives an association of image positions for each identified category of objects in image.}, {, (RefLink[ImagePosition, paclet:ref/ImagePosition])[image,obj] 
gives a list of image positions for subimages identified as instances of the specified category.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ImagePosition, paclet:ref/ImagePosition]) attempts to find instances of an object category present in an image and returns a list of {x,y} positions.

Coordinates {x,y} are assumed to be in the standard image coordinate system.

Possible forms for category include:

The following options can be given:

(RefLink[ImagePosition, paclet:ref/ImagePosition]) uses machine learning, and its training set and methods may change in different versions of the Wolfram Language, yielding different results.

(RefLink[ImagePosition, paclet:ref/ImagePosition]) may download resources that will be stored in your local object store at (RefLink[$LocalBase, paclet:ref/$LocalBase]), and can be listed using (RefLink[LocalObjects, paclet:ref/LocalObjects])[] and removed using (RefLink[ResourceRemove, paclet:ref/ResourceRemove]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (9)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Find the image positions of birds in an image:

i=;

ImagePosition[i,(Entity["bird", Entity["Concept","Bird::56ny3"], "Entity[\"Concept\", \"Bird::56ny3\"]", "concept"])]

HighlightImage[i,%]

OpenersExampleSection1(Spacer1)Scope  (2)

Find a list of positions for each identified category of objects in an image:

ImagePosition[]

Find a list of positions for the specified object category:

ImagePosition[,(Entity["elephants", Entity["Species","Family:Elephantidae"], "Entity[\"Species\", \"Family:Elephantidae\"]", "species specification"])]

OpenersExampleSection2(Spacer1)Options  (4)

OpenersExampleSubsection0(Spacer1)AcceptanceThreshold  (1)

Objects with low probability are not returned:

i=;

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

Allowing a lower probability may result in more objects being recognized:

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),AcceptanceThreshold->.2]

HighlightImage[i,{Red,%,Blue,%%}]

OpenersExampleSubsection1(Spacer1)MaxFeatures  (1)

By default, all the detected objects are returned:

i=;

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

Specify a maximum number of results:

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),MaxFeatures->2]

OpenersExampleSubsection2(Spacer1)MaxOverlapFraction  (1)

The detected bounding boxes may overlap each other:

i=;

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

HighlightImage[i,%]

Find only non-intersecting objects:

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),MaxOverlapFraction->0]

HighlightImage[i,%]

OpenersExampleSubsection3(Spacer1)TargetDevice  (1)

By default, the function is evaluated on CPU:

i=;

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"])]

Use the (RefLink[TargetDevice, paclet:ref/TargetDevice]) option to specify a different device:

ImagePosition[i,(Entity["wineglass", Entity["Concept","Wineglass::w5dj5"], "Entity[\"Concept\", \"Wineglass::w5dj5\"]", "concept"]),TargetDevice->"GPU"]

OpenersExampleSection3(Spacer1)Applications  (1)

Track a moving object in a sequence of images:

movie={,,,,,,,,,,,};

positions=ImagePosition[#,(Entity["domestic dog", Entity["Concept","CanisFamiliaris::597qc"], "Entity[\"Concept\", \"CanisFamiliaris::597qc\"]", "concept"])]&/@movie

ListAnimate[MapThread[HighlightImage,{movie,positions}],SaveDefinitions->True]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

(RefLink[ImagePosition, paclet:ref/ImagePosition]) is equivalent to (RefLink[ImageCases, paclet:ref/ImageCases])[image, (RefLink[All, paclet:ref/All]) -> "Position"]:

ImagePosition[]

ImageCases[,All->"Position"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ImageBoundingBoxes, paclet:ref/ImageBoundingBoxes])  ▪  (RefLink[ImageCases, paclet:ref/ImageCases])  ▪  (RefLink[HighlightImage, paclet:ref/HighlightImage])  ▪  (RefLink[ImageContainsQ, paclet:ref/ImageContainsQ])  ▪  (RefLink[Position, paclet:ref/Position])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Image Processing & Analysis, paclet:guide/ImageProcessing])}, {▪(RefLinkPlain[Computer Vision, paclet:guide/ComputerVision])}})}})