ImageContainsQ

ImageContainsQ[image,category]

returns True if an instance of the specified category is detected in image.

ImageContainsQ[image,{category1,category2,}]

returns True if at least one instance of each of the categoryi is detected in image.

ImageContainsQ[image,category1|category2|]

returns True if image contains an instance of at least one of categoryi.

Details and Options

  • ImageContainsQ tries to find subimages of image that may be an instance of a given 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 following options can be given:
  • AcceptanceThreshold Automaticidentification acceptance threshold
    MaxOverlapFractionAutomaticmaximum bounding box overlap
    TargetDevice "CPU"the target device on which to compute
  • ImageContainsQ uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
  • ImageContainsQ 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)

Check whether an image contains a specific category of objects:

This image contains at least a bird:

The image does not contain dogs:

Test for the simultaneous presence of multiple categories:

Scope  (3)

Test of whether an image contains an instance of a particular object:

Test of whether an image contains an instance of all the specified objects:

Test of whether an image contains an instance of any of the specified objects:

Options  (2)

AcceptanceThreshold  (1)

Using the default AcceptanceThreshold, an object may not be identified:

Specify a lower threshold to accept a less certain match:

TargetDevice  (1)

By default, the function is evaluated on CPU:

Use the TargetDevice option to specify a different device:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_imagecontainsq, author="Wolfram Research", title="{ImageContainsQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ImageContainsQ.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_imagecontainsq, organization={Wolfram Research}, title={ImageContainsQ}, year={2019}, url={https://reference.wolfram.com/language/ref/ImageContainsQ.html}, note=[Accessed: 21-December-2024 ]}