ImageCases

ImageCases[image]

gives an association of lists of subimages for each identified category of objects in image.

ImageCases[image,category]

gives a list of subimages identified as an instance of the specified category.

ImageCases[image,categoryprop]

gives the specified property prop for each identified subimage.

ImageCases[image,{category1,category2,}]

gives an association with lists of subimages identified as being instances of each of the categoryi.

Details and Options

  • ImageCases attempts to find instances of an object category present in an image and returns a list of subimages per category.
  • Possible forms for category include:
  • "concept"named concept, as used in "Concept" entities
    "word"English word, as used in WordData
    wordspecword sense specification, as used in WordData
    Entity[]any appropriate entity
    category1|category2|any of the categoryi
  • The property prop can be any of the following:
  • "BoundingBox"the bounding box given as a Rectangle
    "Dimensions"width and height of the subimage
    "Image"the identified subimage (default)
    "Position"center of the identified bounding box
    "Probability"probability of the identification
    {prop1,prop2,}a list of properties
  • The following options can be given:
  • AcceptanceThreshold Automaticidentification acceptance threshold
    MaxFeatures Automaticmaximum number of subimages to return
    MaxOverlapFraction Automaticmaximum bounding box overlap
    TargetDevice "CPU"the target device on which to compute
  • ImageCases uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
  • ImageCases may download resources that will be stored in your local object store at $LocalBase, and can be listed using LocalObjects[] and removed using ResourceRemove.

Examples

open allclose all

Basic Examples  (2)

Find identified subimages of an image:

Find subimages identified as a dog:

Scope  (7)

Find all the detectable objects in an image:

Find all birds in the image:

Find the birds' bounding boxes:

Return multiple properties:

Query properties of the concept:

Group together the detection for multiple categories:

Return the specified properties for all the detectable categories:

Options  (4)

AcceptanceThreshold  (1)

Objects with low probability are not returned:

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

MaxFeatures  (1)

By default, all the detected objects are returned:

Specify a maximum number of results:

MaxOverlapFraction  (1)

The detected bounding boxes may overlap each other:

Find only non-intersecting objects:

TargetDevice  (1)

By default, the function is evaluated on CPU:

Use the TargetDevice option to specify a different device:

Applications  (1)

Build an image captioning function using the counts of detected objects:

Transform the object counts in a string:

Package all the code in a function to automatically generate captions:

Try the function on a different image:

Caption an image with no identified objects:

Wolfram Research (2019), ImageCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCases.html.

Text

Wolfram Research (2019), ImageCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCases.html.

CMS

Wolfram Language. 2019. "ImageCases." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ImageCases.html.

APA

Wolfram Language. (2019). ImageCases. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCases.html

BibTeX

@misc{reference.wolfram_2023_imagecases, author="Wolfram Research", title="{ImageCases}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCases.html}", note=[Accessed: 22-September-2023 ]}

BibLaTeX

@online{reference.wolfram_2023_imagecases, organization={Wolfram Research}, title={ImageCases}, year={2019}, url={https://reference.wolfram.com/language/ref/ImageCases.html}, note=[Accessed: 22-September-2023 ]}