ImageCases
✖
ImageCases
gives an association of lists of subimages for each identified category of objects in image.
gives a list of subimages identified as an instance of the specified category.
gives an association with lists of subimages identified as being instances of each of the categoryi.
Details and Options


- ImageCases is also known as object detection and 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 wordspec word sense specification, as used in WordData Entity[…] any appropriate entity category1category2… 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 (default) "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 Automatic identification acceptance threshold MaxFeatures Automatic maximum number of subimages to return MaxOverlapFraction Automatic maximum bounding box overlap PerformanceGoal "Balanced" aspects of performance to try to optimize 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 allBasic Examples (3)Summary of the most common use cases
Find identified subimages of an image:

https://wolfram.com/xid/0enzd2uuq-c8mi0q

Find subimages identified as a dog:

https://wolfram.com/xid/0enzd2uuq-z78axq

Get the detected and segmented objects of an image:

https://wolfram.com/xid/0enzd2uuq-pnneyv

Scope (11)Survey of the scope of standard use cases
Data (2)
Categories (2)
Properties (7)
Find the birds' bounding boxes:

https://wolfram.com/xid/0enzd2uuq-uzx6q8


https://wolfram.com/xid/0enzd2uuq-zlmoeb

Query properties of the concept:

https://wolfram.com/xid/0enzd2uuq-ns5hpx

Group together the detection for multiple categories:

https://wolfram.com/xid/0enzd2uuq-2vy3ub

Return the specified properties for all the detectable categories:

https://wolfram.com/xid/0enzd2uuq-ncbbau

Get the detected and segmented objects of an image:

https://wolfram.com/xid/0enzd2uuq-mj18b2

Mask of each detected subimage:

https://wolfram.com/xid/0enzd2uuq-rbc9jc

Options (4)Common values & functionality for each option
AcceptanceThreshold (1)
MaxFeatures (1)
MaxOverlapFraction (1)
The detected bounding boxes may overlap each other:

https://wolfram.com/xid/0enzd2uuq-rnkvfy

https://wolfram.com/xid/0enzd2uuq-x2r6r9


https://wolfram.com/xid/0enzd2uuq-m5but2

Find only non-intersecting objects:

https://wolfram.com/xid/0enzd2uuq-x9wjm5

TargetDevice (1)
By default, the function is evaluated on CPU:

https://wolfram.com/xid/0enzd2uuq-w5dfg6

https://wolfram.com/xid/0enzd2uuq-z2ecct

Use the TargetDevice option to specify a different device:

https://wolfram.com/xid/0enzd2uuq-vf245g

Applications (1)Sample problems that can be solved with this function
Build an image captioning function using the counts of detected objects:

https://wolfram.com/xid/0enzd2uuq-uc5ohk

Transform the object counts in a string:

https://wolfram.com/xid/0enzd2uuq-l2cjpl

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

https://wolfram.com/xid/0enzd2uuq-qwekvv

https://wolfram.com/xid/0enzd2uuq-njk94v

Try the function on a different image:

https://wolfram.com/xid/0enzd2uuq-ueq8x8

Caption an image with no identified objects:

https://wolfram.com/xid/0enzd2uuq-yzinv0

Wolfram Research (2019), ImageCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCases.html (updated 2025).
Text
Wolfram Research (2019), ImageCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCases.html (updated 2025).
Wolfram Research (2019), ImageCases, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCases.html (updated 2025).
CMS
Wolfram Language. 2019. "ImageCases." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/ImageCases.html.
Wolfram Language. 2019. "ImageCases." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. 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
Wolfram Language. (2019). ImageCases. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCases.html
BibTeX
@misc{reference.wolfram_2025_imagecases, author="Wolfram Research", title="{ImageCases}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCases.html}", note=[Accessed: 16-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_imagecases, organization={Wolfram Research}, title={ImageCases}, year={2025}, url={https://reference.wolfram.com/language/ref/ImageCases.html}, note=[Accessed: 16-April-2025
]}