ImageContents

ImageContents[image]

gives a dataset of identified entities in image.

ImageContents[image,category]

gives a dataset that only contains entities in the specified category.

ImageContents[image,category,prop]

includes the properties prop for each identified object.

ImageContents[video,]

gives a time series of detected objects in frames of video.

Details and Options

  • ImageContents is also known as object detection and attempts to find instances of an object in an image and returns a dataset of identified properties such as name, bounding box and probability.
  • 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
    "Confidence"confidence of the identification
    "Dimensions"width and height of the subimage
    "Image"the identified subimage
    "Position"center of the identified bounding box
    {prop1,prop2,}a list of properties
  • Masked subimage properties:
  • "Mask"binary mask indicating the object
    "MaskBoundingBox"the bounding box of the masked image
    "MaskCentroid"centroid of the mask
    "MaskedImage"subimage masked by the component shape
    "MaskMedoid"medoid of the mask
    "MaskPosition"center of the mask bounding box
  • The following options can be given:
  • AcceptanceThreshold Automaticidentification acceptance threshold
    MaxFeatures Automaticmaximum number of subimages to return
    MaxOverlapFraction Automaticmaximum bounding box overlap
    PerformanceGoal"Balanced"aspects of performance to try to optimize
    TargetDevice "CPU"the target device on which to compute
  • When no content is found at an acceptable threshold, Missing["NotRecognized"] is returned.
  • ImageContents uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
  • ImageContents 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  (1)

Identify contents of an image:

Get results only in the specified category:

Scope  (11)

Data  (2)

Detect objects in an image:

Detect objects in frames of video:

Objects at a given time:

Categories  (3)

Find all the detectable objects in an image:

Find all birds in an image:

Group together the detection for multiple categories:

Properties  (6)

Return all properties for all classes of objects:

Return one property for all classes:

Return one property for a specified class:

Return multiple properties for all objects:

Return multiple properties for the specified class:

Query properties of the concept:

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  (4)

Get a summary of all the identified entities in an image:

Get a summary only in the specified category:

Specify which properties to include in the summary:

Perform object detection and segmentation:

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

Text

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

CMS

Wolfram Language. 2019. "ImageContents." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/ImageContents.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_imagecontents, author="Wolfram Research", title="{ImageContents}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ImageContents.html}", note=[Accessed: 20-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_imagecontents, organization={Wolfram Research}, title={ImageContents}, year={2025}, url={https://reference.wolfram.com/language/ref/ImageContents.html}, note=[Accessed: 20-January-2025 ]}