WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

FindImageShapes [image,"model"]

obtains graphic primitives of shapes in an image.

FindImageShapes [video,]

finds shapes in frames of video.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Applications  
See Also
Related Guides
History
Cite this Page

FindImageShapes [image,"model"]

obtains graphic primitives of shapes in an image.

FindImageShapes [video,]

finds shapes in frames of video.

Details

  • FindImageShapes attempts to find shapes such as lines, circles and ellipses in an image.
  • Possible "model" specifications include:
  • "Line" a list of InfiniteLine objects
    "LineSegment" a list of Line objects
    "Circle" a list of Circle objects
    "Ellipse" a list of transformed Circle objects
    {model1,model2,} an association of shapes grouped by each modeli
  • FindImageShapes expects an image in which the shapes are highlighted as bright pixels over dark backgrounds.
  • Highlight contours such as lines and circles using EdgeDetect , RidgeFilter , GradientFilter and more.

Examples

open all close all

Basic Examples  (1)

Find and highlight largest ellipses in an image:

Wolfram Language code: i = [image];
Wolfram Language code: e = FindImageShapes[GradientFilter[i, 10], "Ellipse"];

Highlight two larger ellipses:

Wolfram Language code: HighlightImage[i, MaximalBy[e, RegionMeasure, 2]]

Scope  (2)

Detect and visualize straight lines in an image:

Wolfram Language code: img = [image];
Wolfram Language code: ridges = ImageAdjust[RidgeFilter[img, 1]]
Wolfram Language code: lines = FindImageShapes[ridges, "Line"];
Wolfram Language code: HighlightImage[img, lines]

Find and highlight line segments:

Wolfram Language code: segments = FindImageShapes[ridges, "LineSegment"];
Wolfram Language code: HighlightImage[img, segments]

Detect and visualize ellipses:

Wolfram Language code: img = [image];
Wolfram Language code: edges = ImageMultiply[EdgeDetect[img, 4], Dilation[EdgeDetect[img, 8], 3]]
Wolfram Language code: ellipses = FindImageShapes[edges, "Ellipse"];
Wolfram Language code: HighlightImage[img, Graphics[ellipses]]

Applications  (1)

Detect and visualize the iris:

Wolfram Language code: img = [image];

Highlight image edges:

Wolfram Language code: edges = ImageMultiply[EdgeDetect[img, 8], Dilation[EdgeDetect[img, 16], 3]]

Find and highlight the largest detected circle:

Wolfram Language code: circle = MaximalBy[FindImageShapes[edges, "Circle"], RegionMeasure]
Wolfram Language code: HighlightImage[img, circle]
Wolfram Research (2023), FindImageShapes, Wolfram Language function, https://reference.wolfram.com/language/ref/FindImageShapes.html (updated 2025).

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2026_findimageshapes, author="Wolfram Research", title="{FindImageShapes}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FindImageShapes.html}", note=[Accessed: 13-August-2026]}

BibLaTeX

@online{reference.wolfram_2026_findimageshapes, organization={Wolfram Research}, title={FindImageShapes}, year={2025}, url={https://reference.wolfram.com/language/ref/FindImageShapes.html}, note=[Accessed: 13-August-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /